Introduce an option for testing binary API
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / rtr_two_iface.sh
1 source config.sh
2 source odl_utils.sh
3 source topologies/rtr_two_iface.sh
4
5
6 # set odl config json file names; they are common among all rtr tests
7 ODL_CONFIG_FILE1="elp1.json"
8 ODL_CONFIG_FILE2="elp2.json"
9
10 if [ "$1" == "clean" ] ; then
11   rtr_two_iface_clean
12   exit 0
13 fi
14
15 if [[ $(id -u) != 0 ]]; then
16   echo "Error: run this as a root."
17   exit 1
18 fi
19
20 function test_rtr_two_iface {
21   rtr_two_iface_setup
22
23   maybe_pause
24
25   test_result=1
26   rc=0
27
28   if [ "$1" != "${1#*[0-9].[0-9]}" ]; then
29     ip netns exec vpp1-ns ping -w 20 -c 1 "${1}"
30     rc=$?
31   elif [ "$1" != "${1#*:[0-9a-fA-F]}" ]; then
32     ip netns exec vpp1-ns ping6 -w 20 -c 1 "${1}"
33     rc=$?
34   else
35     echo "Unrecognized IP format '$1'"
36   fi
37
38   maybe_pause
39
40   rtr_two_iface_clean
41   print_status $rc "No ICMP response!"
42   exit $test_result
43 }