Add script which runs all VPP lite tests
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / two_customers_topo.sh
1 source config.sh
2 source odl_utils.sh
3 source topologies/two_customers_topo.sh
4
5 ODL_CONFIG_FILE1="vpp1_customer1.json"
6 ODL_CONFIG_FILE2="vpp2_customer1.json"
7 ODL_CONFIG_FILE3="vpp1_customer2.json"
8 ODL_CONFIG_FILE4="vpp2_customer2.json"
9
10 if [ "$1" == "clean" ] ; then
11   two_customers_topo_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_eid_virtualization {
21   two_customers_topo_setup
22
23   # init to test failed
24   test_result=1
25
26   #read -p  "press any key to continue .." -n1
27
28   ip netns exec vpp1-cus1-ns "${1}" -w 20 -c 1 "${2}"
29   rc=$?
30   if [ $rc -ne 0 ] ; then
31     echo "Error: customer 1 did not receive any response!"
32   fi
33
34   #read -p  "press any key to continue .." -n1
35
36   ip netns exec vpp1-cus2-ns "${1}" -w 20 -c 1 "${2}"
37   rc=$?
38   if [ $rc -ne 0 ] ; then
39     echo "Error: customer 2 did not receive any response!"
40   fi
41
42   two_customers_topo_clean
43
44   if [ $rc -ne 0 ] ; then
45     echo "Test failed!";
46   else
47     echo "Test passed."
48     test_result=0
49   fi
50
51   exit $test_result
52 }