]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests: net: fib_rule_tests: fix support for running individual tests
authorAlaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Thu, 30 Jun 2022 10:24:49 +0000 (12:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Jul 2022 12:37:13 +0000 (13:37 +0100)
parsing and usage of -t got missed in the previous patch.
this patch fixes it

Fixes: 00670779b23e ("selftests: net: fib_rule_tests: add support to select a test to run")
Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/fib_rule_tests.sh

index bbe3b379927abacc9a944bd74a11c38999564123..c245476fa29d6533f2e8dc35c0c5829849aac9e4 100755 (executable)
@@ -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"