[PATCH v2 1/2] selftests: net: remove meaningless help option

Subsystems: kernel selftest framework, networking [general], the rest

STALE1737d

5 messages, 3 authors, 2022-01-14 · open the first message on its own page

[PATCH v2 1/2] selftests: net: remove meaningless help option

From: Li Zhijian <hidden>
Date: 2021-12-02 02:30:57

$ ./fcnal-test.sh -t help
Test names: help

Looks it intent to list the available tests but it didn't do the right
thing. I will add another option the do that in the later patch.

Signed-off-by: Li Zhijian <redacted>
---
 tools/testing/selftests/net/fcnal-test.sh | 2 --
 1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 7f5b265fcb90..5cb59947eed2 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -4068,8 +4068,6 @@ do
 	# setup namespaces and config, but do not run any tests
 	setup)		 setup; exit 0;;
 	vrf_setup)	 setup "yes"; exit 0;;
-
-	help)            echo "Test names: $TESTS"; exit 0;;
 	esac
 done
 
-- 
2.33.0


[PATCH v2 2/2] selftests: add option to list all available tests

From: Li Zhijian <hidden>
Date: 2021-12-02 02:30:37

$ ./fcnal-test.sh -l
Test names: ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter
ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter
use_cases

Signed-off-by: Li Zhijian <redacted>
---
 tools/testing/selftests/net/fcnal-test.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 5cb59947eed2..7e78be99aa4c 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -3993,6 +3993,7 @@ usage: ${0##*/} OPTS
 	-4          IPv4 tests only
 	-6          IPv6 tests only
 	-t <test>   Test name/set to run
+	-l          List all available tests
 	-p          Pause on fail
 	-P          Pause after each test
 	-v          Be verbose
@@ -4006,10 +4007,15 @@ TESTS_IPV4="ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter"
 TESTS_IPV6="ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter"
 TESTS_OTHER="use_cases"
 
+list()
+{
+	echo "Test names: $TESTS_IPV4 $TESTS_IPV6 $TESTS_OTHER"
+}
+
 PAUSE_ON_FAIL=no
 PAUSE=no
 
-while getopts :46t:pPvh o
+while getopts :46lt:pPvh o
 do
 	case $o in
 		4) TESTS=ipv4;;
@@ -4018,6 +4024,7 @@ do
 		p) PAUSE_ON_FAIL=yes;;
 		P) PAUSE=yes;;
 		v) VERBOSE=1;;
+		l) list; exit 0;;
 		h) usage; exit 0;;
 		*) usage; exit 1;;
 	esac
-- 
2.33.0


Re: [PATCH v2 2/2] selftests: add option to list all available tests

From: lizhijian@fujitsu.com <hidden>
Date: 2022-01-13 05:53:23

ping


On 02/12/2021 10:29, Li Zhijian wrote:
quoted hunk
$ ./fcnal-test.sh -l
Test names: ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter
ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter
use_cases

Signed-off-by: Li Zhijian <redacted>
---
  tools/testing/selftests/net/fcnal-test.sh | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 5cb59947eed2..7e78be99aa4c 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -3993,6 +3993,7 @@ usage: ${0##*/} OPTS
  	-4          IPv4 tests only
  	-6          IPv6 tests only
  	-t <test>   Test name/set to run
+	-l          List all available tests
  	-p          Pause on fail
  	-P          Pause after each test
  	-v          Be verbose
@@ -4006,10 +4007,15 @@ TESTS_IPV4="ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter"
  TESTS_IPV6="ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter"
  TESTS_OTHER="use_cases"
  
+list()
+{
+	echo "Test names: $TESTS_IPV4 $TESTS_IPV6 $TESTS_OTHER"
+}
+
  PAUSE_ON_FAIL=no
  PAUSE=no
  
-while getopts :46t:pPvh o
+while getopts :46lt:pPvh o
  do
  	case $o in
  		4) TESTS=ipv4;;
@@ -4018,6 +4024,7 @@ do
  		p) PAUSE_ON_FAIL=yes;;
  		P) PAUSE=yes;;
  		v) VERBOSE=1;;
+		l) list; exit 0;;
  		h) usage; exit 0;;
  		*) usage; exit 1;;
  	esac

Re: [PATCH v2 2/2] selftests: add option to list all available tests

From: David Ahern <hidden>
Date: 2022-01-13 15:21:34

On 1/12/22 10:53 PM, lizhijian@fujitsu.com wrote:
ping
seems to have been lost in the void

On 02/12/2021 10:29, Li Zhijian wrote:
quoted
$ ./fcnal-test.sh -l
Test names: ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter
ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter
use_cases

Signed-off-by: Li Zhijian <redacted>
---
  tools/testing/selftests/net/fcnal-test.sh | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 5cb59947eed2..7e78be99aa4c 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -3993,6 +3993,7 @@ usage: ${0##*/} OPTS
  	-4          IPv4 tests only
  	-6          IPv6 tests only
  	-t <test>   Test name/set to run
+	-l          List all available tests
  	-p          Pause on fail
  	-P          Pause after each test
  	-v          Be verbose
@@ -4006,10 +4007,15 @@ TESTS_IPV4="ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter"
  TESTS_IPV6="ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter"
  TESTS_OTHER="use_cases"
  
+list()
+{
+	echo "Test names: $TESTS_IPV4 $TESTS_IPV6 $TESTS_OTHER"
+}
Just add the test list at the end of usage() like this:
@@ -4019,6 +4019,9 @@ usage: ${0##*/} OPTS
        -p          Pause on fail
        -P          Pause after each test
        -v          Be verbose
+
+Tests:
+       $TESTS_IPV4 $TESTS_IPV6 $TESTS_OTHER
 EOF
 }


Re: [PATCH v2 2/2] selftests: add option to list all available tests

From: lizhijian@fujitsu.com <hidden>
Date: 2022-01-14 01:54:21


On 13/01/2022 23:21, David Ahern wrote:
On 1/12/22 10:53 PM, lizhijian@fujitsu.com wrote:
quoted
ping
seems to have been lost in the void
quoted
On 02/12/2021 10:29, Li Zhijian wrote:
quoted
$ ./fcnal-test.sh -l
Test names: ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter
ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter
use_cases

Signed-off-by: Li Zhijian <redacted>
---
   tools/testing/selftests/net/fcnal-test.sh | 9 ++++++++-
   1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 5cb59947eed2..7e78be99aa4c 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -3993,6 +3993,7 @@ usage: ${0##*/} OPTS
   	-4          IPv4 tests only
   	-6          IPv6 tests only
   	-t <test>   Test name/set to run
+	-l          List all available tests
   	-p          Pause on fail
   	-P          Pause after each test
   	-v          Be verbose
@@ -4006,10 +4007,15 @@ TESTS_IPV4="ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter"
   TESTS_IPV6="ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter"
   TESTS_OTHER="use_cases"
   
+list()
+{
+	echo "Test names: $TESTS_IPV4 $TESTS_IPV6 $TESTS_OTHER"
+}
Just add the test list at the end of usage() like this:
it sounds good

Thanks
Zhijian
quoted hunk
@@ -4019,6 +4019,9 @@ usage: ${0##*/} OPTS
         -p          Pause on fail
         -P          Pause after each test
         -v          Be verbose
+
+Tests:
+       $TESTS_IPV4 $TESTS_IPV6 $TESTS_OTHER
  EOF
  }

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help