summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2017-08-22 21:24:09 -0400
committerxudan <xudan16@huawei.com>2017-08-23 22:28:53 -0400
commit6992a014039eaea3377b984c2bddbad88ed67e2a (patch)
treeb94274c9d2ca7156ff1a067a93569d879604072d
parent90bd864487045df3dcacb32ced88ab247606e482 (diff)
Bugfix: pre_condition cmds is just executed once
JIRA: DOVETAIL-489 1. All the cmds defined in pre_condition is just executed once for each type i.e. functest, yardstick, bottlenecks... 2. The copy cmds defined in each functest test cases are just executed for the first test case rather than all test cases. 3. Make the cmds to be executed for each test case. Change-Id: I571f0eb9dd3cab77fc8597e5a9b5246398804d3e Signed-off-by: xudan <xudan16@huawei.com>
-rw-r--r--dovetail/test_runner.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/dovetail/test_runner.py b/dovetail/test_runner.py
index 603156fe..d6e910d3 100644
--- a/dovetail/test_runner.py
+++ b/dovetail/test_runner.py
@@ -82,17 +82,13 @@ class DockerRunner(object):
exist_file_name):
return
- if not self.testcase.prepared():
- prepare_failed = False
- cmds = self.testcase.pre_condition()
- if cmds:
- for cmd in cmds:
- ret, msg = Container.exec_cmd(container_id, cmd)
- if ret != 0:
- prepare_failed = True
- break
- if not prepare_failed:
- self.testcase.prepared(True)
+ cmds = self.testcase.pre_condition()
+ if cmds:
+ for cmd in cmds:
+ ret, msg = Container.exec_cmd(container_id, cmd)
+ if ret != 0:
+ self.logger.error("Failed to exec all pre_condition cmds.")
+ break
if not self.testcase.prepare_cmd(self.type):
self.logger.error(