3 source topologies/2_node_topo.sh
5 ODL_CONFIG_FILE1="vpp1.json"
6 ODL_CONFIG_FILE2="vpp2.json"
7 ODL_CONFIG_FILE3="update_vpp2.json"
9 if [ "$1" == "clean" ] ; then
14 if [[ $(id -u) != 0 ]]; then
15 echo "Error: run this as a root."
21 if [ "$3" != "no_setup" ] ; then
28 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
29 assert_rc_ok $? 2_node_topo_clean "No ICMP response!"
32 # change IP addresses of destination RLOC
33 echo "set int ip address del host-intervpp2 6.0.3.2/24" | nc 0 5003
34 echo "set int ip address host-intervpp2 6.0.3.20/24" | nc 0 5003
35 echo "set int ip address del host-intervpp2 6:0:3::2/64" | nc 0 5003
36 echo "set int ip address host-intervpp2 6:0:3::20/64" | nc 0 5003
37 post_curl "update-mapping" ${ODL_CONFIG_FILE3}
39 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
46 print_status $rc "No ICMP response!"
50 function test_basic_map_register
52 2_node_topo_setup no_odl
53 post_curl "add-key" ${ODL_CONFIG_FILE1}
54 post_curl "add-key" ${ODL_CONFIG_FILE2}
60 wait_for_map_register=10
61 echo "Waiting for map registration $wait_for_map_register seconds .."
62 sleep $wait_for_map_register
64 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
67 count=`echo "show error" | nc 0 5002 | grep 'map-notifies received' | awk '{print $1}'`
68 if [ "$count" -eq 0 ] ; then
69 echo "no map-notifies received! ($count)"
77 print_status $rc "No ICMP response!"
81 function test_rloc_probe
88 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
90 assert_rc_ok $rc 2_node_topo_clean "No ICMP response!"
94 count=`echo "show error" | nc 0 5002 | grep 'rloc-probe replies received' | awk '{print $1}'`
95 if [ "$count" != "1" ] ; then
96 echo "rloc-probe replies received is not 1! ($count)"
100 count=`echo "show error" | nc 0 5003 | grep 'rloc-probe requests received' | awk '{print $1}'`
101 if [ "$count" != "1" ] ; then
102 echo "rloc-probe requests received is not 1! ($count)"
110 print_status $rc "unexpected value"
114 function test_enable_disable
116 if [ "$3" != "no_setup" ] ; then
123 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
124 assert_rc_ok $? 2_node_topo_clean "No ICMP response!"
128 # disable control plane
129 echo "one disable" | nc 0 5002
130 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
131 assert_rc_not_ok $? 2_node_topo_clean "Nothing expected, but received ICMP reply!"
133 # enable control plane
134 echo "one enable" | nc 0 5002
135 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
136 assert_rc_ok $? 2_node_topo_clean "No ICMP response!"
139 echo "gpe disable" | nc 0 5002
140 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
141 assert_rc_not_ok $? 2_node_topo_clean "Nothing expected, but received ICMP reply!"
143 # enable LISP again from control plane
144 echo "one enable" | nc 0 5002
145 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
146 assert_rc_ok $? 2_node_topo_clean "No ICMP response!"
152 print_status $rc "No ICMP response!"