Fix a bug for algorithm of arithmetic runner. 88/1088/1
authorkubi <jean.gaoliang@huawei.com>
Tue, 28 Jul 2015 09:17:02 +0000 (09:17 +0000)
committerkubi <jean.gaoliang@huawei.com>
Tue, 28 Jul 2015 09:17:02 +0000 (09:17 +0000)
since value will overstep the stop value under some condition

JIRA:YARDSTICK-97

Change-Id: I11656206fc9b576283d243a3be249276dba03759
Signed-off-by: kubi <jean.gaoliang@huawei.com>
yardstick/benchmark/runners/arithmetic.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 9efafff..f73d1cd
@@ -48,8 +48,9 @@ def _worker_process(queue, cls, method_name, context, scenario_args):
     sla_action = None
     if "sla" in scenario_args:
         sla_action = scenario_args["sla"].get("action", "assert")
+    margin = 1 if step > 0 else -1
 
-    for value in range(start, stop+step, step):
+    for value in range(start, stop+margin, step):
 
         options[arg_name] = value