aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samples/ping-parallel.yaml14
-rw-r--r--yardstick/benchmark/runners/base.py10
-rwxr-xr-xyardstick/main.py16
3 files changed, 32 insertions, 8 deletions
diff --git a/samples/ping-parallel.yaml b/samples/ping-parallel.yaml
index 0e632aaaa..1924e76f4 100644
--- a/samples/ping-parallel.yaml
+++ b/samples/ping-parallel.yaml
@@ -17,14 +17,14 @@ scenarios:
duration: 60
interval: 1
sla:
- max_rtt: 15
- action: monitor
+ max_rtt: 10
+ action: assert
-
type: Ping
options:
packetsize: 200
- client: client.demo
- server: server.demo
+ host: client.demo
+ target: server.demo
runner:
type: Duration
duration: 60
@@ -39,10 +39,16 @@ context:
flavor: m1.tiny
user: cirros
+ placement_groups:
+ pgrp1:
+ policy: "availability"
+
servers:
client:
floating_ip: true
+ placement: "pgrp1"
server:
+ placement: "pgrp1"
networks:
test:
diff --git a/yardstick/benchmark/runners/base.py b/yardstick/benchmark/runners/base.py
index 59ec4734a..38ca34f4b 100644
--- a/yardstick/benchmark/runners/base.py
+++ b/yardstick/benchmark/runners/base.py
@@ -74,6 +74,15 @@ class Runner(object):
Runner.queue.put('_TERMINATE_')
Runner.dump_process.join()
+ @staticmethod
+ def terminate_all():
+ '''Terminate all runners (subprocesses)'''
+ log.debug("Terminating all runners")
+ for runner in Runner.runners:
+ runner.process.terminate()
+ runner.process.join()
+ Runner.release(runner)
+
def __init__(self, config, queue):
self.context = {}
self.config = config
@@ -92,3 +101,4 @@ class Runner(object):
def join(self):
self.process.join()
+ return self.process.exitcode
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)