selftests/net: enable msg_zerocopy test
authorWillem de Bruijn <willemb@google.com>
Thu, 31 May 2018 16:14:38 +0000 (12:14 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Jun 2018 13:49:39 +0000 (09:49 -0400)
The existing msg_zerocopy test takes additional protocol arguments.
Add a variant that takes no arguments and runs all supported variants.
Call this from kselftest.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/msg_zerocopy.sh

index 7cb0f49efdb70446177b7b1b8958deeacb45ef19..f39100b970afff71c234e9c2e28d5441c704c090 100644 (file)
@@ -6,7 +6,7 @@ CFLAGS += -I../../../../usr/include/
 
 TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh
 TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh udpgso.sh
-TEST_PROGS += udpgso_bench.sh fib_rule_tests.sh
+TEST_PROGS += udpgso_bench.sh fib_rule_tests.sh msg_zerocopy.sh
 TEST_PROGS_EXTENDED := in_netns.sh
 TEST_GEN_FILES =  socket
 TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy
index d571d213418d56048f8edd1da798fe0005a3e4ef..c43c6debda06913ab54542e5fd91c33d4f23b297 100755 (executable)
@@ -21,6 +21,14 @@ readonly DADDR6='fd::2'
 
 readonly path_sysctl_mem="net.core.optmem_max"
 
+# No arguments: automated test
+if [[ "$#" -eq "0" ]]; then
+       $0 4 tcp -t 1
+       $0 6 tcp -t 1
+       echo "OK. All tests passed"
+       exit 0
+fi
+
 # Argument parsing
 if [[ "$#" -lt "2" ]]; then
        echo "Usage: $0 [4|6] [tcp|udp|raw|raw_hdrincl|packet|packet_dgram] <args>"