diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-04-13 16:52:16 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2017-04-14 08:57:36 +0200 |
commit | d467ead2a0d8585cd7b702804029ed514f26b513 (patch) | |
tree | 66cfe5b4cef6b728e32663b3bcac995b744a8a60 /functest/core | |
parent | 32ccb8926fd7057fed83f68e9035bd13577bf58a (diff) |
Remove deprecated feature modules
All features running bash programs are now simply defined in
testcases.yaml. All deprecated modules and unit tests are removed.
Change-Id: I7047b6f7a1e43cb8ed5ba2d569d5dcecae68fb86
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/core')
-rw-r--r-- | functest/core/feature.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/functest/core/feature.py b/functest/core/feature.py index 29e0e927..3c95bdaf 100644 --- a/functest/core/feature.py +++ b/functest/core/feature.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import time import functest.core.testcase as base @@ -16,6 +18,7 @@ class Feature(base.TestCase): self.logger = ft_logger.Logger(self.project_name).getLogger() def execute(self, **kwargs): + # pylint: disable=unused-argument,no-self-use return -1 def run(self, **kwargs): @@ -23,7 +26,7 @@ class Feature(base.TestCase): exit_code = base.TestCase.EX_RUN_ERROR self.criteria = "FAIL" try: - if self.execute() == 0: + if self.execute(**kwargs) == 0: exit_code = base.TestCase.EX_OK self.criteria = 'PASS' ft_utils.logger_test_results( @@ -40,5 +43,12 @@ class Feature(base.TestCase): class BashFeature(Feature): def execute(self, **kwargs): - return ft_utils.execute_command( - self.cmd, output_file=self.result_file) + ret = -1 + try: + cmd = kwargs["cmd"] + ret = ft_utils.execute_command(cmd, output_file=self.result_file) + except KeyError: + self.logger.error("Please give cmd as arg. kwargs: %s", kwargs) + except Exception: # pylint: disable=broad-except + self.logger.exception("Execute cmd: %s failed", cmd) + return ret |