summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo wang <grakiss.wanglei@huawei.com>2017-08-28 03:48:40 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-28 03:48:40 +0000
commitfdc5e2bc2ce6a3e813b6ba461d822c26f964c07b (patch)
treebf0bb12240075b5af60c761bcc28e7705f1dc1df
parent344f27b87856faa0f5440d198b81038ae7b45626 (diff)
parent6992a014039eaea3377b984c2bddbad88ed67e2a (diff)
Merge "Bugfix: pre_condition cmds is just executed once"
-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(