resolver_failover.sh revision bf231ba7
1source config.sh
2source odl_utils.sh
3source topologies/basic_two_odls.sh
4
5ODL_CONFIG_FILE1="vpp1.json"
6ODL_CONFIG_FILE2="vpp2.json"
7
8if [ "$1" == "clean" ] ; then
9  basic_two_odls_clean
10  exit 0
11fi
12
13if [[ $(id -u) != 0 ]]; then
14  echo "Error: run this as a root."
15  exit 1
16fi
17
18function 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
25function 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}
47