From e9334da17298cfeff4ccfb079bb3e3908e85c0e2 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Tue, 14 Feb 2017 13:37:35 +0100 Subject: 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 --- functest/core/feature_base.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'functest/core') 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 -- cgit 1.2.3-korg