Heat: support non-mesh network toplogy
[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 openrc=$1
15 source $openrc
16 shift
17 ping6_options=$*
18 chmod 600 vRouterKey
19
20 # TODO find host
21 vm1_ip=$(nova list|grep VM1 | awk -F [=] '{print $2}' | awk '{print $1}')
22 # echo "vm1_ip=$vm1_ip"
23 wait_vm_ok() {
24     retry=0
25     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@$vm1_ip "exit" >/dev/null 2>&1
26     do
27         sleep 10
28         let retry+=1
29         if [ $retry -ge 40 ];
30         then
31             echo "vm ssh  start timeout !!!"
32             exit 0
33         fi
34     done
35 }
36 wait_vm_ok
37 sleep 360
38 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@$vm1_ip "ping6 $ping6_options 2001:db8:0:1::1 | grep rtt | awk -F [\/\ ] '{printf \$8}'"