63c8b5ab70351f0dee1ce22abaf15bb8c3282fc0
[one.git] / tests / data_plane / vpp_lite_topo / test_driver / basic_single_icmp.sh
1 source config.sh
2 source topologies/2_node_topo.sh
3
4 if [ "$1" == "clean" ] ; then
5   2_node_topo_clean no_odl
6   exit 0
7 fi
8
9 if [[ $(id -u) != 0 ]]; then
10   echo "Error: run this as a root."
11   exit 1
12 fi
13
14 function test_single_icmp
15 {
16   2_node_topo_setup no_odl
17   maybe_pause
18   test_result=1
19
20   # send only one ping request
21   ip netns exec vppns1 "${1}" -c 1 "${2}"
22   rc=$?
23
24   # test done
25   maybe_pause
26   2_node_topo_clean no_odl
27   print_status $rc "No ICMP response!"
28   exit $test_result
29 }