3 source topologies/smr_rtr_disjoint.sh
5 # set odl config json file names; they are common among all rtr tests
6 ODL_CONFIG_FILE1="vpp1.json"
7 ODL_CONFIG_FILE2="vpp2.json"
8 ODL_CONFIG_FILE3="elp1.json"
9 ODL_CONFIG_FILE4="elp2.json"
11 if [ "$1" == "clean" ] ; then
12 smr_rtr_disjoint_clean
16 if [[ $(id -u) != 0 ]]; then
17 echo "Error: run this as a root."
21 function test_ns_ping {
22 if [ "$1" != "${1#*[0-9].[0-9]}" ]; then
23 ip netns exec $2 ping -w 15 -c 1 "${1}"
25 elif [ "$1" != "${1#*:[0-9a-fA-F]}" ]; then
26 ip netns exec $2 ping6 -w 15 -c 1 "${1}"
29 echo "Unrecognized IP format '$1'"
34 function test_smr_rtr_disjoint {
36 smr_rtr_disjoint_setup
38 if [ "$2" == "wait" ] ; then
39 read -p "press any key to continue .." -n1
46 test_ns_ping $1 vpp1-ns
50 if [ $rc -ne 0 ] ; then
51 echo "IPv6 over IPv4 test failed: No ICMP response received within specified timeout limit!"
53 echo "IPv6 over IPv4 test passed."
57 if [ "$2" == "wait" ] ; then
58 read -p "press any key to continue .." -n1
62 smr_rtr_disjoint_reconfigure
64 if [ "$2" == "wait" ] ; then
65 read -p "Forwarding reconfigured press any key to continue .." -n1
68 # TEST IP6 over disjoint IP4 and IP6 underlay
69 test_ns_ping $1 vpp1-ns
73 if [ $rc -ne 0 ] ; then
74 echo "SMR + disjoint locators test failed: No ICMP response received within specified timeout limit!"
76 echo "SMR + disjoint locators test passed."
80 if [ "$2" == "wait" ] ; then
81 read -p "press any key to continue .." -n1
85 smr_rtr_disjoint_clean