Heat context code refactor part 2
[yardstick.git] / yardstick / benchmark / runners / iteration.py
index b6d861d..077e0e8 100755 (executable)
@@ -21,7 +21,7 @@ from yardstick.benchmark.runners import base
 LOG = logging.getLogger(__name__)
 
 
-def _worker_process(queue, cls, method_name, scenario_cfg):
+def _worker_process(queue, cls, method_name, scenario_cfg, context_cfg):
 
     sequence = 1
 
@@ -33,12 +33,13 @@ def _worker_process(queue, cls, method_name, scenario_cfg):
 
     runner_cfg['runner_id'] = os.getpid()
 
-    benchmark = cls(runner_cfg)
+    benchmark = cls(scenario_cfg, context_cfg)
     benchmark.setup()
     method = getattr(benchmark, method_name)
 
     queue.put({'runner_id': runner_cfg['runner_id'],
-               'scenario_cfg': scenario_cfg})
+               'scenario_cfg': scenario_cfg,
+               'context_cfg': context_cfg})
 
     sla_action = None
     if "sla" in scenario_cfg:
@@ -53,7 +54,7 @@ def _worker_process(queue, cls, method_name, scenario_cfg):
         errors = ""
 
         try:
-            method(scenario_cfg, data)
+            method(data)
         except AssertionError as assertion:
             # SLA validation failed in scenario, determine what to do now
             if sla_action == "assert":
@@ -108,8 +109,8 @@ If the scenario ends before the time has elapsed, it will be started again.
     '''
     __execution_type__ = 'Iteration'
 
-    def _run_benchmark(self, cls, method, scenario_cfg):
+    def _run_benchmark(self, cls, method, scenario_cfg, context_cfg):
         self.process = multiprocessing.Process(
             target=_worker_process,
-            args=(self.result_queue, cls, method, scenario_cfg))
+            args=(self.result_queue, cls, method, scenario_cfg, context_cfg))
         self.process.start()