3 source topologies/multihoming_topo_l2.sh
5 ODL_CONFIG_FILE1="vpp1.json"
6 ODL_CONFIG_FILE2="vpp2.json"
7 ODL_CONFIG_FILE3="update_vpp2.json"
11 if [ "$1" == "wait" ] ; then
12 read -p "press any key to continue .." -n1
16 if [ "$1" == "clean" ] ; then
17 multihoming_topo_clean
21 if [[ $(id -u) != 0 ]]; then
22 echo "Error: run this as a root."
26 function test_multihoming
28 if [ "$3" != "no_setup" ] ; then
29 multihoming_topo_setup
36 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
38 if [ $rc -ne 0 ] ; then
39 echo "No response received!"
42 multihoming_topo_clean
48 # do some port sweeping to see that load balancing works
49 ip netns exec vppns1 nc -n -z "${2}" 1-1000 > /dev/null 2>&1
52 pkts=$(echo "show int" | nc 0 5002 | grep host-intervpp11 | awk '{print $6}' | tr -d '\r')
54 if [ $pkts -gt 450 ] && [ $pkts -lt 550 ] ; then
60 if [ $rc -ne 0 ] ; then
61 echo "Load balancing doesn't work!"
65 multihoming_topo_clean
71 # change IP addresses of destination RLOC
72 echo "set int ip address del host-intervpp12 6.0.3.2/24" | nc 0 5003
73 echo "set int ip address host-intervpp12 6.0.3.20/24" | nc 0 5003
74 echo "set int ip address del host-intervpp12 6:0:3::2/64" | nc 0 5003
75 echo "set int ip address host-intervpp12 6:0:3::20/64" | nc 0 5003
76 post_curl "update-mapping" ${ODL_CONFIG_FILE3}
78 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
85 multihoming_topo_clean
86 if [ $rc -ne 0 ] ; then
87 echo "Test failed: No ICMP response received within specified timeout limit!"