1source config.sh
2source odl_utils.sh
3source topologies/rtr_two_iface.sh
4
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_two_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_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}
44