ea3a21243d674215a221459fe88d6e6607e6f09c
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / resolver_failover.sh
1 source config.sh
2 source odl_utils.sh
3 source topologies/basic_two_odls.sh
4
5 ODL_CONFIG_FILE1="vpp1.json"
6 ODL_CONFIG_FILE2="vpp2.json"
7
8 if [ "$1" == "clean" ] ; then
9   basic_two_odls_clean
10   exit 0
11 fi
12
13 if [[ $(id -u) != 0 ]]; then
14   echo "Error: run this as a root."
15   exit 1
16 fi
17
18 function start_map_resolver
19 {
20   echo "starting dummy map resolver on interface $1"
21   python scripts/dummy_mr.py "$1" 4342 &
22   mr_id=$!
23 }
24
25 function test_resolver_failover
26 {
27   basic_two_odls_setup
28
29   start_map_resolver "6.0.3.100"
30
31   test_result=1
32
33   maybe_pause
34
35   ip netns exec vppns1 "${1}" -w 20 -c 1 "${2}"
36   rc=$?
37
38   # test done
39   maybe_pause
40
41   basic_two_odls_clean
42   kill $mr_id
43
44   print_status $rc "No ICMP response!"
45   exit $test_result
46 }