aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/scenarios/networking/ping6.py
diff options
context:
space:
mode:
authorrexlee8776 <limingjiang@huawei.com>2016-11-08 07:09:55 +0000
committerrexlee8776 <limingjiang@huawei.com>2016-11-09 01:54:30 +0000
commit5e49e33552c581610b1abaa2628cdf90a4ba14ac (patch)
tree67c7ce3abb747b1c0d89997b9d2f088a125853a3 /yardstick/benchmark/scenarios/networking/ping6.py
parente80a6484956de102d14b2b42349ac1e90510cd82 (diff)
bugfix: ipv6 should log in controller node to setup
JIRA: YARDSTICK-363 Change-Id: Ic1f2ab98425512014d746a997b7356d3490c6b33 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking/ping6.py')
-rw-r--r--yardstick/benchmark/scenarios/networking/ping6.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/yardstick/benchmark/scenarios/networking/ping6.py b/yardstick/benchmark/scenarios/networking/ping6.py
index 91183be25..38eade335 100644
--- a/yardstick/benchmark/scenarios/networking/ping6.py
+++ b/yardstick/benchmark/scenarios/networking/ping6.py
@@ -54,7 +54,6 @@ class Ping6(base.Scenario): # pragma: no cover
ip = node.get('ip', None)
pwd = node.get('password', None)
key_fname = node.get('key_filename', '/root/.ssh/id_rsa')
-
if pwd is not None:
LOG.debug("Log in via pw, user:%s, host:%s, password:%s",
user, ip, pwd)
@@ -73,6 +72,14 @@ class Ping6(base.Scenario): # pragma: no cover
status, stdout, stderr = self.client.execute(
"sudo bash pre_setup.sh")
+ def _get_controller_node(self, host_list):
+ for host_name in host_list:
+ node = self.nodes.get(host_name, None)
+ node_role = node.get('role', None)
+ if node_role == 'Controller':
+ return host_name
+ return None
+
def setup(self):
'''scenario setup'''
self.setup_script = pkg_resources.resource_filename(
@@ -102,9 +109,12 @@ class Ping6(base.Scenario): # pragma: no cover
if pre_setup:
self._pre_setup()
- # ssh host1
- self._ssh_host(self.host_list[0])
-
+ # log in a contronller node to setup
+ controller_node_name = self._get_controller_node(self.host_list)
+ LOG.debug("The Controller Node is: %s", controller_node_name)
+ if controller_node_name is None:
+ LOG.exception("Can't find controller node in the context!!!")
+ self._ssh_host(controller_node_name)
self.client.run("cat > ~/metadata.txt",
stdin=open(self.ping6_metadata_script, "rb"))