two_customers_topo.sh revision 51b44223
1source config.sh
2source odl_utils.sh
3source topologies/two_customers_topo.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  two_customers_topo_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_eid_virtualization {
21  two_customers_topo_setup
22
23  # init to test failed
24  test_result=1
25
26  if [ "$3" == "wait" ] ; then
27    read -p  "press any key to continue .." -n1
28  fi
29
30  ip netns exec vpp1-cus1-ns "${1}" -w 20 -c 1 "${2}"
31  rc=$?
32  if [ $rc -ne 0 ] ; then
33    echo "Error: customer 1 did not receive any response!"
34  fi
35
36  #read -p  "press any key to continue .." -n1
37
38  ip netns exec vpp1-cus2-ns "${1}" -w 20 -c 1 "${2}"
39  rc=$?
40  if [ $rc -ne 0 ] ; then
41    echo "Error: customer 2 did not receive any response!"
42  fi
43
44  if [ "$3" == "wait" ] ; then
45    read -p  "press any key to continue .." -n1
46  fi
47
48  two_customers_topo_clean
49
50  if [ $rc -ne 0 ] ; then
51    echo "Test failed!";
52  else
53    echo "Test passed."
54    test_result=0
55  fi
56
57  exit $test_result
58}
59