aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/main.py
diff options
context:
space:
mode:
authorHans Feldt <hans.feldt@ericsson.com>2015-06-03 18:04:31 +0200
committerHans Feldt <hans.feldt@ericsson.com>2015-06-04 16:01:17 +0200
commit662efbb518793a268fb7e82057ccd9b8c197b386 (patch)
tree313175a69f4291b99fab3652f34b4c0c4555bf17 /yardstick/main.py
parenta6f7294eadf66e54a65edd629513b2841136e924 (diff)
fix exit status at SLA assertion
tested by changing SLA action to assert and lower rtt, yardstick command should exit non zero Change-Id: I2dd091941fb4359add849f218cacc04f364142cd JIRA: YARDSTICK-25 Signed-off-by: Hans Feldt <hans.feldt@ericsson.com>
Diffstat (limited to 'yardstick/main.py')
-rwxr-xr-xyardstick/main.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/yardstick/main.py b/yardstick/main.py
index f270bf9ee..050a56436 100755
--- a/yardstick/main.py
+++ b/yardstick/main.py
@@ -54,6 +54,8 @@ class TaskParser(object):
def atexit_handler():
'''handler for process termination'''
+ base_runner.Runner.terminate_all()
+
if HeatStack.stacks_exist():
print "Deleting all stacks"
HeatStack.delete_all()
@@ -87,6 +89,14 @@ def run_one_scenario(scenario_cfg, context, output_file):
return runner
+def runner_join(runner):
+ '''join (wait for) a runner, exit process at runner failure'''
+ status = runner.join()
+ base_runner.Runner.release(runner)
+ if status != 0:
+ sys.exit("Runner failed")
+
+
def main():
'''yardstick main'''
@@ -110,16 +120,14 @@ def main():
# Wait for runners to finish
for runner in runners:
- runner.join()
+ runner_join(runner)
print "Runner ended, output in", prog_args.output_file
- base_runner.Runner.release(runner)
else:
# run serially
for scenario in scenarios:
runner = run_one_scenario(scenario, context, prog_args.output_file)
- runner.join()
+ runner_join(runner)
print "Runner ended, output in", prog_args.output_file
- base_runner.Runner.release(runner)
if prog_args.keep_deploy:
# keep deployment, forget about stack (hide it for exit handler)