selftests: fib_rule_tests: print the result and return 1 if any tests failed
Subsystems (4)
PATCH 1/1 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 <[email protected]>
--- tools/testing/selftests/net/fib_rule_tests.sh | 6 ++++++ 1 file changed, 6 insertions(+)
tools/testing/selftests/net/fib_rule_tests.sh +6 -0
@@ -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
Signature · 1 line
2.19.2
Quoted 20 lines · Hangbin Liu
Fixes 65b2b4939a64 ("selftests: net: initial fib rule tests")Signed-off-by Hangbin Liu <[email protected]>--- tools/testing/selftests/net/fib_rule_tests.sh | 6 ++++++ 1 file changed, 6 insertions(+)tools/testing/selftests/net/fib_rule_tests.sh +1
-0@@ -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
tools/testing/selftests/net/fib_rule_tests.sh setup · line 254
Quoted 9 lines
tools/testing/selftests/net/fib_rule_tests.sh +5
-0@@ -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
Thanks for adding the summary.
Reviewed-by David Ahern <[email protected]>
From: Hangbin Liu <[email protected]>
Date: Tue, 30 Apr 2019 10:46:10 +0800
Quoted 2 lines
Fixes 65b2b4939a64 ("selftests: net: initial fib rule tests")Signed-off-by Hangbin Liu <[email protected]>
Applied.