Skip to content

Commit 0cd0b1f

Browse files
Amit Cohenkuba-moo
authored andcommitted
selftests: lib.sh: Add PING_COUNT to allow sending configurable amount of packets
Currently `ping_do()` and `ping6_do()` send 10 packets. There are cases that it is not possible to catch only the interesting packets using tc rule, so then, it is possible to send many packets and verify that at least this amount of packets hit the rule. Add `PING_COUNT` variable, which is set to 10 by default, to allow tests sending more than 10 packets using the existing ping API. Signed-off-by: Amit Cohen <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 70ec72d commit 0cd0b1f

File tree

1 file changed

+5
-2
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+5
-2
lines changed

tools/testing/selftests/net/forwarding/lib.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ NETIF_TYPE=${NETIF_TYPE:=veth}
2020
NETIF_CREATE=${NETIF_CREATE:=yes}
2121
MCD=${MCD:=smcrouted}
2222
MC_CLI=${MC_CLI:=smcroutectl}
23+
PING_COUNT=${PING_COUNT:=10}
2324
PING_TIMEOUT=${PING_TIMEOUT:=5}
2425
WAIT_TIMEOUT=${WAIT_TIMEOUT:=20}
2526
INTERFACE_TIMEOUT=${INTERFACE_TIMEOUT:=600}
@@ -1111,7 +1112,8 @@ ping_do()
11111112

11121113
vrf_name=$(master_name_get $if_name)
11131114
ip vrf exec $vrf_name \
1114-
$PING $args $dip -c 10 -i 0.1 -w $PING_TIMEOUT &> /dev/null
1115+
$PING $args $dip -c $PING_COUNT -i 0.1 \
1116+
-w $PING_TIMEOUT &> /dev/null
11151117
}
11161118

11171119
ping_test()
@@ -1132,7 +1134,8 @@ ping6_do()
11321134

11331135
vrf_name=$(master_name_get $if_name)
11341136
ip vrf exec $vrf_name \
1135-
$PING6 $args $dip -c 10 -i 0.1 -w $PING_TIMEOUT &> /dev/null
1137+
$PING6 $args $dip -c $PING_COUNT -i 0.1 \
1138+
-w $PING_TIMEOUT &> /dev/null
11361139
}
11371140

11381141
ping6_test()

0 commit comments

Comments
 (0)