diff options
author | JingLu5 <lvjing5@huawei.com> | 2016-07-01 11:05:51 +0800 |
---|---|---|
committer | JingLu5 <lvjing5@huawei.com> | 2016-07-04 15:07:38 +0800 |
commit | d51cbf72b8fb2e5c6acc06248919b1401d09c853 (patch) | |
tree | 240c90a42656c609a7a698df6f6dded7c3934c20 /yardstick/cmd | |
parent | 14c7413448e4690fefd0ecad908ec86d6f774d6f (diff) |
Add support for multiple VMs
Verify and add support for multiple target VMs.
This is related to further work with SDNVPN project.
In the task configration file, use 'target' for specifying one target VM and use 'targets' for specifying multiple target VMs.
Change-Id: I682188ef4c2c2c012d5ab00417b69f5b31b87137
Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'yardstick/cmd')
-rw-r--r-- | yardstick/cmd/commands/task.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py index 55898e1cb..2bc5abe29 100644 --- a/yardstick/cmd/commands/task.py +++ b/yardstick/cmd/commands/task.py @@ -374,6 +374,20 @@ def run_one_scenario(scenario_cfg, output_file): context_cfg["target"]["ipaddr"] = \ context_cfg["target"]["ip"] + if "targets" in scenario_cfg: + ip_list = [] + for target in scenario_cfg["targets"]: + if is_ip_addr(target): + ip_list.append(target) + context_cfg['target'] = {} + else: + context_cfg['target'] = Context.get_server(target) + if _is_same_heat_context(scenario_cfg["host"], target): + ip_list.append(context_cfg["target"]["private_ip"]) + else: + ip_list.append(context_cfg["target"]["ip"]) + context_cfg['target']['ipaddr'] = ','.join(ip_list) + if "nodes" in scenario_cfg: context_cfg["nodes"] = parse_nodes_with_context(scenario_cfg) runner = base_runner.Runner.get(runner_cfg) |