VPP lite test improvements
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / rtr_single_iface.sh
1
2 source config.sh
3 source odl_utils.sh
4 source topologies/rtr_single_iface.sh
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_single_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_single_iface {
21   rtr_single_iface_setup
22
23   if [ "$3" == "wait" ] ; then
24     read -p  "press any key to continue .." -n1
25   fi
26
27   test_result=1
28
29   ip netns exec vpp-ns1 "${1}" -w 20 -c 1 "${2}"
30   rc=$?
31
32   rtr_single_iface_clean
33
34   if [ $rc -ne 0 ] ; then
35     echo "Test failed: No ICMP response received within specified timeout limit!"
36   else
37     echo "Test passed."
38     test_result=0
39   fi
40
41   exit $test_result
42 }