[dovetail tool] support shell scripts for testcase validation 31/25931/1
authorLeo Wang <grakiss.wanglei@huawei.com>
Wed, 14 Dec 2016 07:48:16 +0000 (02:48 -0500)
committerLeo Wang <grakiss.wanglei@huawei.com>
Wed, 14 Dec 2016 07:48:16 +0000 (02:48 -0500)
JIRA: DOVETAIL-46

1. for now a testcase has two kinds of validation types(functest, yardstick),
and it is not enough to check the complete funcionality
2. add new validation type(shell) for extra validation of the test case to make
result more accurate and more convincing.

Change-Id: I60c1b54335b94e0cb150232432adb958b8f5a143
Signed-off-by: Leo Wang <grakiss.wanglei@huawei.com>
dovetail/testcase.py

index 7952292..af8b325 100644 (file)
@@ -23,7 +23,7 @@ class Testcase(object):
 
     def __init__(self, testcase_yaml):
         self.testcase = testcase_yaml.values()[0]
-        self.logger.debug('testcase:%s', self.testcase)
+        self.logger.debug('testcase:%s', self.testcase)
         self.testcase['passed'] = False
         self.cmds = []
         self.sub_testcase_status = {}
@@ -163,7 +163,6 @@ class Testcase(object):
                     else:
                         cls.logger.error('failed to create testcase: %s',
                                          testcase_file)
-        cls.logger.debug(cls.testcase_list)
 
     @classmethod
     def get(cls, testcase_name):
@@ -183,14 +182,16 @@ class FunctestTestcase(Testcase):
     def prepare_cmd(self):
         ret = super(FunctestTestcase, self).prepare_cmd()
         if not ret:
+            return False
+        else:
             for cmd in \
                 dt_cfg.dovetail_config[self.name]['cmds']:
                 cmd_lines = Parser.parse_cmd(cmd, self)
                 if not cmd_lines:
                     return False
+                self.logger.debug('cmd_lines:%s', cmd_lines)
                 self.cmds.append(cmd_lines)
-                return True
-        return ret
+            return True
 
 
 class YardstickTestcase(Testcase):