diff mbox series

[net-next,v2] selftests: net: fib_rule_tests: fix support for running individual tests

Message ID 20220601174316.4278-1-eng.alaamohamedsoliman.am@gmail.com (mailing list archive)
State Accepted
Commit 9c154ab47f5e5ff632d2b7af6342c027d7e04b92
Headers show
Series [net-next,v2] selftests: net: fib_rule_tests: fix support for running individual tests | expand

Commit Message

Alaa Mohamed June 1, 2022, 5:43 p.m. UTC
parsing and usage of -t got missed in the previous patch.
this patch fixes it

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
---
changes in v2:
	edit commit subject and message.
---
 tools/testing/selftests/net/fib_rule_tests.sh | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Roopa Prabhu June 2, 2022, 3:43 a.m. UTC | #1
On 6/1/22 10:43, Alaa Mohamed wrote:
> parsing and usage of -t got missed in the previous patch.
> this patch fixes it
>
> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
> ---

Alaa, need a v3 with Fixes tag

Fixes: 816cda9ae531 ("selftests: net: fib_rule_tests: add support to 
select a test to run")

do a git log and grep for "Fixes:" to see an example


> changes in v2:
> 	edit commit subject and message.
> ---
>   tools/testing/selftests/net/fib_rule_tests.sh | 23 +++++++++++++++++++
>   1 file changed, 23 insertions(+)
>
> diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh
> index bbe3b379927a..c245476fa29d 100755
> --- a/tools/testing/selftests/net/fib_rule_tests.sh
> +++ b/tools/testing/selftests/net/fib_rule_tests.sh
> @@ -303,6 +303,29 @@ run_fibrule_tests()
>   	log_section "IPv6 fib rule"
>   	fib_rule6_test
>   }
> +################################################################################
> +# usage
> +
> +usage()
> +{
> +	cat <<EOF
> +usage: ${0##*/} OPTS
> +
> +        -t <test>   Test(s) to run (default: all)
> +                    (options: $TESTS)
> +EOF
> +}
> +
> +################################################################################
> +# main
> +
> +while getopts ":t:h" opt; do
> +	case $opt in
> +		t) TESTS=$OPTARG;;
> +		h) usage; exit 0;;
> +		*) usage; exit 1;;
> +	esac
> +done
>   
>   if [ "$(id -u)" -ne 0 ];then
>   	echo "SKIP: Need root privileges"
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh
index bbe3b379927a..c245476fa29d 100755
--- a/tools/testing/selftests/net/fib_rule_tests.sh
+++ b/tools/testing/selftests/net/fib_rule_tests.sh
@@ -303,6 +303,29 @@  run_fibrule_tests()
 	log_section "IPv6 fib rule"
 	fib_rule6_test
 }
+################################################################################
+# usage
+
+usage()
+{
+	cat <<EOF
+usage: ${0##*/} OPTS
+
+        -t <test>   Test(s) to run (default: all)
+                    (options: $TESTS)
+EOF
+}
+
+################################################################################
+# main
+
+while getopts ":t:h" opt; do
+	case $opt in
+		t) TESTS=$OPTARG;;
+		h) usage; exit 0;;
+		*) usage; exit 1;;
+	esac
+done
 
 if [ "$(id -u)" -ne 0 ];then
 	echo "SKIP: Need root privileges"