selftests: fib_rule_tests: print the result and return 1 if any tests failed [Linux 5.1]

selftests: fib_rule_tests: print the result and return 1 if any tests failed [Linux 5.1]

This Linux kernel change "selftests: fib_rule_tests: print the result and return 1 if any tests failed" is included in the Linux 5.1 release. This change is authored by Hangbin Liu <liuhangbin [at] gmail.com> on Tue Apr 30 10:46:10 2019 +0800. The commit for this change in Linux stable tree is f68d7c4 (patch).

selftests: fib_rule_tests: print the result and return 1 if any tests failed

Fixes: 65b2b4939a64 ("selftests: net: initial fib rule tests")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

There are 6 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 tools/testing/selftests/net/fib_rule_tests.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh
index 5b92c1f..4b7e107 100755
--- a/tools/testing/selftests/net/fib_rule_tests.sh
+++ b/tools/testing/selftests/net/fib_rule_tests.sh
@@ -27,6 +27,7 @@ log_test()
        nsuccess=$((nsuccess+1))
        printf "\n    TEST: %-50s  [ OK ]\n" "${msg}"
    else
+       ret=1
        nfail=$((nfail+1))
        printf "\n    TEST: %-50s  [FAIL]\n" "${msg}"
        if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
@@ -245,4 +246,9 @@ setup
 run_fibrule_tests
 cleanup

+if [ "$TESTS" != "none" ]; then
+   printf "\nTests passed: %3d\n" ${nsuccess}
+   printf "Tests failed: %3d\n"   ${nfail}
+fi
+
 exit $ret

Leave a Reply

Your email address will not be published. Required fields are marked *