diff mbox series

[B,SRU,3/4] selftests/net: enable msg_zerocopy test

Message ID 20210707114730.40375-4-po-hsu.lin@canonical.com
State New
Headers show
Series Enable fib-onlink-tests.sh and msg_zerocopy.sh in kselftests/net | expand

Commit Message

Po-Hsu Lin July 7, 2021, 11:47 a.m. UTC
From: Willem de Bruijn <willemb@google.com>

BugLink: https://bugs.launchpad.net/bugs/1934759

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>
(backported from commit 830669e691464c005ff7262b74797fb2222da99a)
[PHLin: ignore fib_tests.sh, pmtu.sh, udpgso.sh, udpgso_bench.sh and fib_rule_tests.sh]
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/net/Makefile        | 1 +
 tools/testing/selftests/net/msg_zerocopy.sh | 8 ++++++++
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 66e48dd..10dfd35 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -6,6 +6,7 @@  CFLAGS += -I../../../../usr/include/
 
 TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh rtnetlink.sh
 TEST_PROGS += fib-onlink-tests.sh
+TEST_PROGS += msg_zerocopy.sh
 TEST_PROGS_EXTENDED := in_netns.sh
 TEST_GEN_FILES =  socket
 TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy
diff --git a/tools/testing/selftests/net/msg_zerocopy.sh b/tools/testing/selftests/net/msg_zerocopy.sh
index d571d21..c43c6de 100755
--- a/tools/testing/selftests/net/msg_zerocopy.sh
+++ b/tools/testing/selftests/net/msg_zerocopy.sh
@@ -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>"