Fix wrong ipv6 address length
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / basic_no_odl.sh
1 source config.sh
2 source odl_utils.sh
3 source topologies/basic_topo.sh
4
5 if [ "$1" == "clean" ] ; then
6   basic_topo_clean
7   exit 0
8 fi
9
10 if [[ $(id -u) != 0 ]]; then
11   echo "Error: run this as a root."
12   exit 1
13 fi
14
15 function test_basic_no_odl
16 {
17   basic_topo_setup no_odl
18
19   if [ "$3" == "wait" ] ; then
20     read -p  "press any key to continue .." -n1
21   fi
22
23   test_result=1
24
25   ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
26   if [ $? -ne 0 ] ; then
27     echo "No response received!"
28     basic_topo_clean no_odl
29     exit $test_result
30   fi
31
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
38   echo "lisp remote-mapping del vni 0 eid 6.0.2.0/24 rloc 6.0.3.2" | nc 0 5002
39   echo "lisp remote-mapping add vni 0 eid 6.0.2.0/24 rloc 6.0.3.20" | nc 0 5002
40   echo "lisp remote-mapping del vni 0 eid 6:0:2::0/64 rloc 6:0:3::2" | nc 0 5002
41   echo "lisp remote-mapping add vni 0 eid 6:0:2::0/64 rloc 6:0:3::20" | nc 0 5002
42
43   ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
44   rc=$?
45
46   if [ "$3" == "wait" ] ; then
47     read -p  "press any key to continue .." -n1
48   fi
49
50   # test done
51
52   basic_topo_clean no_odl
53   if [ $rc -ne 0 ] ; then
54     echo "Test failed: No ICMP response received within specified timeout limit!"
55   else
56     echo "Test passed."
57     test_result=0
58   fi
59
60   exit $test_result
61 }
62