diff mbox series

[v1,bpf-next,6/8] selftests/bpf: Add setup/cleanup subcommands

Message ID 20240329191907.1808635-7-jrife@google.com (mailing list archive)
State New
Headers show
Series selftests/bpf: Add sockaddr tests for kernel networking | expand

Commit Message

Jordan Rife March 29, 2024, 7:18 p.m. UTC
Add optional setup/cleanup subcommands to test_sock_addr.sh to allow
those phases to be driven externally by the sock_addr_kern test program.

Signed-off-by: Jordan Rife <jrife@google.com>
---
 tools/testing/selftests/bpf/test_sock_addr.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/test_sock_addr.sh b/tools/testing/selftests/bpf/test_sock_addr.sh
index 3b9fdb8094aa2..dc0dff612b0d2 100755
--- a/tools/testing/selftests/bpf/test_sock_addr.sh
+++ b/tools/testing/selftests/bpf/test_sock_addr.sh
@@ -55,4 +55,12 @@  TEST_IPv4="127.0.0.4/8"
 TEST_IPv6="::6/128"
 MAX_PING_TRIES=5
 
-main
+if [ $# = 0 ]; then
+	main
+elif [ $1 = "setup" ]; then
+	setup
+elif [ $1 = "cleanup" ]; then
+	cleanup
+else
+	echo "invalid option: $1"
+fi