From 212a60535c5a84efcf236110caa0aa83499aefe2 Mon Sep 17 00:00:00 2001 From: MatthewLi Date: Mon, 12 Sep 2016 06:53:54 -0400 Subject: add ping6 parameters JIRA: YARDSTICK-315 1) make packetsize workable 2) add ping_count parameter Change-Id: Ice2235fc5744b94df6a3f981c23159ca8280d876 Signed-off-by: MatthewLi --- yardstick/benchmark/scenarios/networking/ping6.py | 12 +++++++++++- .../benchmark/scenarios/networking/ping6_benchmark.bash | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'yardstick/benchmark/scenarios') diff --git a/yardstick/benchmark/scenarios/networking/ping6.py b/yardstick/benchmark/scenarios/networking/ping6.py index e68756462..dc896b2c6 100644 --- a/yardstick/benchmark/scenarios/networking/ping6.py +++ b/yardstick/benchmark/scenarios/networking/ping6.py @@ -39,6 +39,7 @@ class Ping6(base.Scenario): # pragma: no cover self.context_cfg = context_cfg self.setup_done = False self.run_done = False + self.ping_options = '' def _pre_setup(self): for node_name in self.host_list: @@ -83,6 +84,10 @@ class Ping6(base.Scenario): # pragma: no cover Ping6.RADVD_SCRIPT) options = self.scenario_cfg['options'] + self.ping_options = "-s %s" % \ + options.get("packetsize", '56') + \ + "-c %s" % \ + options.get("ping_count", '5') host_str = options.get("host", 'host1') self.host_list = host_str.split(',') self.host_list.sort() @@ -126,6 +131,10 @@ class Ping6(base.Scenario): # pragma: no cover if not self.setup_done: options = self.scenario_cfg['options'] + self.ping_options = "-s %s" % \ + options.get("packetsize", '56') + \ + "-c %s" % \ + options.get("ping_count", '5') host_str = options.get("host", 'host1') self.host_list = host_str.split(',') self.host_list.sort() @@ -149,7 +158,8 @@ class Ping6(base.Scenario): # pragma: no cover # run ping6 benchmark self.client.run("cat > ~/ping6.sh", stdin=open(self.ping6_script, "rb")) - cmd = "sudo bash ping6.sh" + cmd_args = "%s" % (self.ping_options) + cmd = "sudo bash ping6.sh %s" % (cmd_args) LOG.debug("Executing command: %s", cmd) status, stdout, stderr = self.client.execute(cmd) diff --git a/yardstick/benchmark/scenarios/networking/ping6_benchmark.bash b/yardstick/benchmark/scenarios/networking/ping6_benchmark.bash index 16cb0f07e..9a08b098a 100644 --- a/yardstick/benchmark/scenarios/networking/ping6_benchmark.bash +++ b/yardstick/benchmark/scenarios/networking/ping6_benchmark.bash @@ -11,6 +11,7 @@ # Run a single ping6 command towards a ipv6 router set -e +ping6_options=$1 source /opt/admin-openrc.sh chmod 600 vRouterKey # TODO find host @@ -29,4 +30,4 @@ wait_vm_ok() { } wait_vm_ok sleep 360 -sudo ip netns exec qdhcp-$(neutron net-list | grep -w ipv4-int-network1 | awk '{print $2}') ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vRouterKey fedora@20.0.0.4 "ping6 -c 1 2001:db8:0:1::1 | grep ttl | awk -F [=\ ] '{printf \$10}'" \ No newline at end of file +sudo ip netns exec qdhcp-$(neutron net-list | grep -w ipv4-int-network1 | awk '{print $2}') ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i vRouterKey fedora@20.0.0.4 "ping6 $ping6_options 2001:db8:0:1::1 | grep rtt | awk -F [\/\ ] '{printf \$8}'" -- cgit 1.2.3-korg