- 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+margin, step):
+ if "sla" in scenario_cfg:
+ sla_action = scenario_cfg["sla"].get("action", "assert")
+
+ # To both be able to include the stop value and handle backwards stepping
+ def margin(start, stop):
+ return -1 if start > stop else 1
+
+ param_iters = \
+ [range(d['start'], d['stop'] + margin(d['start'], d['stop']),
+ d['step']) for d in runner_cfg['iterators']]
+ param_names = [d['name'] for d in runner_cfg['iterators']]
+
+ iter_type = runner_cfg.get("iter_type", "nested_for_loops")
+
+ if iter_type == 'nested_for_loops':
+ # Create a complete combination set of all parameter lists
+ loop_iter = itertools.product(*param_iters)
+ elif iter_type == 'tuple_loops':
+ # Combine each i;th index of respective parameter list
+ loop_iter = six.moves.zip(*param_iters)
+ else:
+ LOG.warning("iter_type unrecognized: %s", iter_type)
+ raise TypeError("iter_type unrecognized: %s", iter_type)
+
+ # Populate options and run the requested method for each value combination
+ for comb_values in loop_iter:
+
+ if aborted.is_set():
+ break