rtr_single_iface.sh revision 6ecb3add
1
2source config.sh
3source odl_utils.sh
4source topologies/rtr_single_iface.sh
5
6# set odl config json file names; they are common among all rtr tests
7ODL_CONFIG_FILE1="elp1.json"
8ODL_CONFIG_FILE2="elp2.json"
9
10if [ "$1" == "clean" ] ; then
11  rtr_single_iface_clean
12  exit 0
13fi
14
15if [[ $(id -u) != 0 ]]; then
16  echo "Error: run this as a root."
17  exit 1
18fi
19
20function test_rtr_single_iface {
21  rtr_single_iface_setup
22
23  test_result=1
24
25  ip netns exec vpp-ns1 "${1}" -w 15 -c 1 "${2}"
26  rc=$?
27
28  rtr_single_iface_clean
29
30  if [ $rc -ne 0 ] ; then
31    echo "Test failed: No ICMP response received within specified timeout limit!"
32  else
33    echo "Test passed."
34    test_result=0
35  fi
36
37  exit $test_result
38}
39