2022-06-01 18:36:12

by Alaa Mohamed

[permalink] [raw]
Subject: [PATCH net-next] selftests: net: fib_rule_tests: add support to run individual tests

add -t option to run individual tests in the test with -t option

Signed-off-by: Alaa Mohamed <[email protected]>
---
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"
--
2.25.1



2022-06-01 20:20:24

by Roopa Prabhu

[permalink] [raw]
Subject: Re: [PATCH net-next] selftests: net: fib_rule_tests: add support to run individual tests


On 5/30/22 11:12, Alaa Mohamed wrote:
> add -t option to run individual tests in the test with -t option
>
> Signed-off-by: Alaa Mohamed <[email protected]>
> ---

Alaa, I suggest you send a v2 with a fixes tag for this. This actually
completes commit "816cda9ae531" which went in incomplete.

For examples of fixes tag, look for "Fixes" in git log. change the patch
title to convey the fix.

rest looks good.



> 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"