diff options
author | 2016-12-14 04:20:09 -0500 | |
---|---|---|
committer | 2016-12-14 04:20:09 -0500 | |
commit | e5be1b8b5c5e2714ad4a558da2aa3727a70ef516 (patch) | |
tree | 6bbd744ae853e42302fb005ad69bfdf653b753d5 /dovetail/testcase.py | |
parent | 461902c1f4f840d361d014b079371f99544e5c17 (diff) |
[dovetail tool] support shell scripts for testcase validation
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: I5c049a71f11cca71a7914f8af704c1983aba3dca
Signed-off-by: Leo Wang <grakiss.wanglei@huawei.com>
Diffstat (limited to 'dovetail/testcase.py')
-rw-r--r-- | dovetail/testcase.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/dovetail/testcase.py b/dovetail/testcase.py index af8b325e..6f2d76de 100644 --- a/dovetail/testcase.py +++ b/dovetail/testcase.py @@ -23,7 +23,6 @@ class Testcase(object): def __init__(self, testcase_yaml): self.testcase = testcase_yaml.values()[0] - # self.logger.debug('testcase:%s', self.testcase) self.testcase['passed'] = False self.cmds = [] self.sub_testcase_status = {} @@ -35,8 +34,17 @@ class Testcase(object): def prepare_cmd(self): try: - self.cmds = self.testcase['validate']['cmds'] - return True + for cmd in self.testcase['validate']['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) + self.logger.debug('cmds:%s', self.cmds) + if len(self.cmds) > 0: + return True + else: + return False except KeyError: return False @@ -182,8 +190,6 @@ 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) @@ -191,7 +197,7 @@ class FunctestTestcase(Testcase): return False self.logger.debug('cmd_lines:%s', cmd_lines) self.cmds.append(cmd_lines) - return True + return True class YardstickTestcase(Testcase): |