rtr_two_iface_two_customers.sh revision 572c17d6
1source config.sh
2source odl_utils.sh
3source topologies/rtr_two_iface_two_customers.sh
4
5ODL_CONFIG_FILE1="vpp1_customer1.json"
6ODL_CONFIG_FILE2="vpp2_customer1.json"
7ODL_CONFIG_FILE3="vpp1_customer2.json"
8ODL_CONFIG_FILE4="vpp2_customer2.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_two_customers {
21  rtr_two_iface_two_customers_setup
22  sleep 1
23
24  test_result=0
25  rc=0
26
27  ip netns exec vpp1-cus1-ns "${1}" -w 20 -c 1 "${2}"
28  rc=$?
29  if [ $rc -ne 0 ] ; then
30    echo "Error: customer 1 did not receive any response!"
31    test_result=1
32  fi
33
34  ip netns exec vpp1-cus2-ns "${1}" -w 20 -c 1 "${2}"
35  rc=$?
36  if [ $rc -ne 0 ] ; then
37    echo "Error: customer 2 did not receive any response!"
38    test_result=1
39  fi
40
41  rtr_two_iface_two_customers_clean
42
43  if [ $rc -ne 0 ] ; then
44    echo "Test failed: No ICMP response received within specified timeout limit!"
45  else
46    echo "Test passed."
47  fi
48
49  exit $test_result
50}
51