16cb0f07e1789a1cda5521b0a4886a1546ae73b3
[yardstick.git] / yardstick / benchmark / scenarios / networking / ping6_benchmark.bash
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 # Run a single ping6 command towards a ipv6 router
13 set -e
14 source /opt/admin-openrc.sh
15 chmod 600 vRouterKey
16 # TODO find host
17 wait_vm_ok() {
18     retry=0
19     until timeout 100s 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  "exit" >/dev/null 2>&1
20     do
21         sleep 10
22         let retry+=1
23         if [ $retry -ge 40 ];
24         then
25             echo "vm ssh  start timeout !!!"
26             exit 0
27         fi
28     done
29 }
30 wait_vm_ok
31 sleep 360
32 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}'"