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
44 test_ns_ping $1 vpp1-ns
45 assert_rc_ok $? smr_rtr_disjoint_clean "No icmp received!"
50 smr_rtr_disjoint_reconfigure
54 # TEST IP6 over disjoint IP4 and IP6 underlay
55 test_ns_ping $1 vpp1-ns
60 smr_rtr_disjoint_clean
61 print_status $rc "No ICMP response!"