3 source topologies/3_node_star.sh
5 ODL_CONFIG_FILE1="map1.json"
6 ODL_CONFIG_FILE2="map2.json"
8 if [ "$1" == "clean" ] ; then
13 if [[ $(id -u) != 0 ]]; then
14 echo "Error: run this as a root."
18 function send_ping_from_ns
20 ip netns exec "${1}" "${2}" -w 20 -c 1 "${3}"
21 assert_rc_ok $? 3_node_star_topo_clean "No ICMP Response!"
24 function send_ping_from_ns_no_verify
26 ip netns exec "${1}" "${2}" -c 1 "${3}"
31 3_node_star_topo_setup
32 post_curl "add-mapping" "map3.json"
33 post_curl "add-mapping" "map4.json"
39 # send ping for first EID
40 send_ping_from_ns vpp-ns1 ${1} ${2}
42 # TODO assert counters
46 # send ping for second EID
47 send_ping_from_ns vpp-ns3 ${1} ${2}
51 # verify first tunnel still works
52 send_ping_from_ns vpp-ns1 ${1} ${2}
56 # verify second tunnel still works
57 send_ping_from_ns vpp-ns3 ${1} ${2}
61 3_node_star_topo_clean
62 print_status $rc "No ICMP response!"
66 function test_src_dst_l2
68 3_node_star_topo_setup
69 post_curl "add-mapping" "map3.json"
70 post_curl "add-mapping" "map4.json"
76 # send ping for first EID
77 send_ping_from_ns vpp-ns5 ${1} ${2}
79 # TODO assert counters
83 # send ping for second EID
84 send_ping_from_ns vpp-ns8 ${1} ${2}
88 # verify first tunnel still works
89 send_ping_from_ns vpp-ns5 ${1} ${2}
93 # verify second tunnel still works
94 send_ping_from_ns vpp-ns8 ${1} ${2}
98 3_node_star_topo_clean
99 print_status $rc "No ICMP response!"
103 function mapping_exists
105 python scripts/vat/mapping_exists.py ${VPP_API_TEST} "$1" "$2" ${VAT_TEMPLATES}
108 function test_mapping_timers
110 3_node_star_topo_setup
111 post_curl "add-mapping" "map3.json"
112 post_curl "add-mapping" "map4.json"
118 send_ping_from_ns vpp-ns1 ${1} ${2}
119 send_ping_from_ns vpp-ns3 ${1} ${2}
121 # wait for map-requests to resolve
124 mapping_exists "vpp1" "6.0.1.0/24|6.0.2.0/24"
125 assert_rc_ok $? 3_node_star_topo_clean "mapping not in map-cache!"
126 mapping_exists "vpp1" "6.0.5.0/24|6.0.2.0/24"
127 assert_rc_ok $? 3_node_star_topo_clean "mapping not in map-cache!"
128 mapping_exists "vpp2" "6.0.1.0/24"
129 assert_rc_ok $? 3_node_star_topo_clean "mapping not in map-cache!"
131 # sleep enough so the mapping expires
136 mapping_exists "vpp1" "6.0.1.0/24|6.0.2.0/24"
137 assert_rc_not_ok $? 3_node_star_topo_clean "mapping still present in map-cache!"
138 mapping_exists "vpp1" "6.0.5.0/24|6.0.2.0/24"
139 assert_rc_not_ok $? 3_node_star_topo_clean "mapping still present in map-cache!"
140 mapping_exists "vpp2" "6.0.1.0/24"
141 assert_rc_not_ok $? 3_node_star_topo_clean "mapping still present in map-cache!"
144 3_node_star_topo_clean