Introduce an option for testing binary API
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / basic_multi_traffic.sh
1 source config.sh
2 source odl_utils.sh
3 source topologies/basic_topo.sh
4
5 ODL_CONFIG_FILE1="vpp1.json"
6 ODL_CONFIG_FILE2="vpp2.json"
7 ODL_CONFIG_FILE3="update_vpp2.json"
8
9 if [ "$1" == "clean" ] ; then
10   basic_topo_clean
11   exit 0
12 fi
13
14 if [[ $(id -u) != 0 ]]; then
15   echo "Error: run this as a root."
16   exit 1
17 fi
18
19 function test_basic_multi_traffic
20 {
21   basic_topo_setup
22
23   # additional setup
24   ODL_CONFIG_DIR=`pwd`/../configs/odl/basic/4o4
25   post_curl "add-mapping" ${ODL_CONFIG_FILE1}
26   post_curl "add-mapping" ${ODL_CONFIG_FILE2}
27
28   test_result=1
29
30   maybe_pause
31
32   ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
33   assert_rc_ok $? basic_topo_clean "No response received!"
34
35   ip netns exec vppns1 "${3}" -w 15 -c 1 "${4}"
36   assert_rc_ok $? basic_topo_clean "No response received!"
37
38   # change IP addresses of destination RLOC
39   echo "set int ip address del host-intervpp2 6.0.3.2/24" | nc 0 5003
40   echo "set int ip address host-intervpp2 6.0.3.20/24" | nc 0 5003
41   echo "set int ip address del host-intervpp2 6:0:3::2/64" | nc 0 5003
42   echo "set int ip address host-intervpp2 6:0:3::20/64" | nc 0 5003
43
44   ODL_CONFIG_DIR=`pwd`/../configs/odl/basic/6o6
45   post_curl "update-mapping" ${ODL_CONFIG_FILE3}
46   ODL_CONFIG_DIR=`pwd`/../configs/odl/basic/4o4
47   post_curl "update-mapping" ${ODL_CONFIG_FILE3}
48
49   maybe_pause
50
51   ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
52   assert_rc_ok $? basic_topo_clean "No response received!"
53
54   ip netns exec vppns1 "${3}" -w 15 -c 1 "${4}"
55   rc=$?
56
57   maybe_pause
58
59   # test done
60   basic_topo_clean
61   print_status $rc "No ICMP response!"
62
63   exit $test_result
64 }
65