diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2017-02-14 13:37:35 +0100 |
---|---|---|
committer | Jose Lausuch <jose.lausuch@ericsson.com> | 2017-02-21 21:18:17 +0000 |
commit | e9334da17298cfeff4ccfb079bb3e3908e85c0e2 (patch) | |
tree | fc7965476298264655195adedcdbe69f4ea31048 /functest/core | |
parent | 93fe04c15c86fff32a118eb52350d528ed72b475 (diff) |
Integrate BAROMETER feature test case
Also, add a executor method in VNFBase
to allow re-write it for some cases
where the feature is another python
script instead of shell script.
Change-Id: Id734553dffe32fdc9a0befc3f4c0e29e5d56fc61
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'functest/core')
-rw-r--r-- | functest/core/feature_base.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/functest/core/feature_base.py b/functest/core/feature_base.py index fe9a9998..2bd1ec83 100644 --- a/functest/core/feature_base.py +++ b/functest/core/feature_base.py @@ -7,6 +7,7 @@ from functest.utils.constants import CONST class FeatureBase(base.TestcaseBase): + def __init__(self, project='functest', case='', repo='', cmd=''): super(FeatureBase, self).__init__() self.project_name = project @@ -19,7 +20,7 @@ class FeatureBase(base.TestcaseBase): def run(self, **kwargs): self.prepare() self.start_time = time.time() - ret = ft_utils.execute_command(self.cmd, output_file=self.result_file) + ret = self.execute() self.stop_time = time.time() self.post() self.parse_results(ret) @@ -27,6 +28,13 @@ class FeatureBase(base.TestcaseBase): self.logger.info("Test result is stored in '%s'" % self.result_file) return base.TestcaseBase.EX_OK + def execute(self): + ''' + Executer method that can be overwritten + By default it executes a shell command. + ''' + return ft_utils.execute_command(self.cmd, output_file=self.result_file) + def prepare(self, **kwargs): pass |