b3d53aadb2cb21eac50655ce83307149aa5593b0
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / basic_l2.sh
1 source config.sh
2 source odl_utils.sh
3 source topologies/basic_topo_l2.sh
4
5 ODL_CONFIG_FILE1="vpp1.json"
6 ODL_CONFIG_FILE2="vpp2.json"
7
8 if [ "$1" == "clean" ] ; then
9   basic_topo_clean
10   exit 0
11 fi
12
13 if [[ $(id -u) != 0 ]]; then
14   echo "Error: run this as a root."
15   exit 1
16 fi
17
18 function test_basic
19 {
20   if [ "$3" != "no_setup" ] ; then
21     basic_topo_setup
22   fi
23
24   maybe_pause
25   test_result=1
26
27   ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
28   rc=$?
29
30   maybe_pause
31   assert_rc_ok $rc basic_topo_clean "No response received!"
32
33   # test done
34
35   basic_topo_clean
36   print_status $rc "No ICM response!"
37   exit $test_result
38 }