1source config.sh
2source topologies/2_node_topo.sh
3
4if [ "$1" == "clean" ] ; then
5  2_node_topo_clean no_odl
6  exit 0
7fi
8
9if [[ $(id -u) != 0 ]]; then
10  echo "Error: run this as a root."
11  exit 1
12fi
13
14function 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  #                         SEID DEID LLOC RLOC PKTS BYTES
25  check_counters "vpp1" "0" $3   $4   $5   $6   $7   $8
26  assert_rc_ok $? "2_node_topo_clean no_odl" "Counters do not match!"
27
28  # test done
29  maybe_pause
30  2_node_topo_clean no_odl
31  print_status $rc "No ICMP response!"
32  exit $test_result
33}
34
35function test_single_icmp_no_counters
36{
37  2_node_topo_setup no_odl
38  maybe_pause
39  test_result=1
40
41  # send only one ping request
42  ip netns exec vppns1 "${1}" -c 1 "${2}"
43  rc=$?
44
45  # test done
46  maybe_pause
47  2_node_topo_clean no_odl
48  print_status $rc "No ICMP response!"
49  exit $test_result
50}
51