selftests: forwarding: lib: Add ping6_, ping_test_fails()
authorPetr Machata <petrm@nvidia.com>
Thu, 13 Jul 2023 16:15:30 +0000 (18:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Jul 2023 09:20:15 +0000 (10:20 +0100)
Add two helpers to run a ping test that succeeds when the pings themselves
fail.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/lib.sh

index 9ddb68d..71f7c0c 100755 (executable)
@@ -1215,6 +1215,15 @@ ping_test()
        log_test "ping$3"
 }
 
+ping_test_fails()
+{
+       RET=0
+
+       ping_do $1 $2
+       check_fail $?
+       log_test "ping fails$3"
+}
+
 ping6_do()
 {
        local if_name=$1
@@ -1237,6 +1246,15 @@ ping6_test()
        log_test "ping6$3"
 }
 
+ping6_test_fails()
+{
+       RET=0
+
+       ping6_do $1 $2
+       check_fail $?
+       log_test "ping6 fails$3"
+}
+
 learning_test()
 {
        local bridge=$1