basic.sh revision bf231ba7
1source config.sh
2source odl_utils.sh
3source topologies/basic_topo.sh
4
5ODL_CONFIG_FILE1="vpp1.json"
6ODL_CONFIG_FILE2="vpp2.json"
7ODL_CONFIG_FILE3="update_vpp2.json"
8
9if [ "$1" == "clean" ] ; then
10  basic_topo_clean
11  exit 0
12fi
13
14if [[ $(id -u) != 0 ]]; then
15  echo "Error: run this as a root."
16  exit 1
17fi
18
19function test_basic
20{
21  if [ "$3" != "no_setup" ] ; then
22    basic_topo_setup
23  fi
24
25  maybe_pause
26  test_result=1
27
28  ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
29  assert_rc_ok $? basic_topo_clean "No ICMP response!"
30
31  maybe_pause
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}
38
39  ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
40  rc=$?
41
42  # test done
43
44  maybe_pause
45  basic_topo_clean
46  print_status $rc "No ICMP response!"
47  exit $test_result
48}
49