]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/selftests-fib_rule_tests-print-the-result-and-return-1-if-any-tests-failed.patch
3fd67890fbaa98e767a2e7ed1b77a667449bd168
[thirdparty/kernel/stable-queue.git] / queue-4.19 / selftests-fib_rule_tests-print-the-result-and-return-1-if-any-tests-failed.patch
1 From foo@baz Sat 04 May 2019 09:23:44 AM CEST
2 From: Hangbin Liu <liuhangbin@gmail.com>
3 Date: Tue, 30 Apr 2019 10:46:10 +0800
4 Subject: selftests: fib_rule_tests: print the result and return 1 if any tests failed
5
6 From: Hangbin Liu <liuhangbin@gmail.com>
7
8 [ Upstream commit f68d7c44e76532e46f292ad941aa3706cb9e6e40 ]
9
10 Fixes: 65b2b4939a64 ("selftests: net: initial fib rule tests")
11 Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
12 Reviewed-by: David Ahern <dsahern@gmail.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 ---
16 tools/testing/selftests/net/fib_rule_tests.sh | 6 ++++++
17 1 file changed, 6 insertions(+)
18
19 --- a/tools/testing/selftests/net/fib_rule_tests.sh
20 +++ b/tools/testing/selftests/net/fib_rule_tests.sh
21 @@ -27,6 +27,7 @@ log_test()
22 nsuccess=$((nsuccess+1))
23 printf "\n TEST: %-50s [ OK ]\n" "${msg}"
24 else
25 + ret=1
26 nfail=$((nfail+1))
27 printf "\n TEST: %-50s [FAIL]\n" "${msg}"
28 if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
29 @@ -245,4 +246,9 @@ setup
30 run_fibrule_tests
31 cleanup
32
33 +if [ "$TESTS" != "none" ]; then
34 + printf "\nTests passed: %3d\n" ${nsuccess}
35 + printf "Tests failed: %3d\n" ${nfail}
36 +fi
37 +
38 exit $ret