The fib_nexthops.sh kselftest maintains counters for passed and failed
tests, but skipped tests are currently included in the failure count.
As a result, the overall test is reported as failed whenever at least
one test case is skipped.

Fix the result accounting so that only actual test failures are
counted as failures.

https://virtuozzo.atlassian.net/browse/VSTOR-120995

Signed-off-by: Aleksei Oladko <[email protected]>
---
 tools/testing/selftests/net/fib_nexthops.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/fib_nexthops.sh 
b/tools/testing/selftests/net/fib_nexthops.sh
index 77c83d9508d3..f8b2efb0882e 100755
--- a/tools/testing/selftests/net/fib_nexthops.sh
+++ b/tools/testing/selftests/net/fib_nexthops.sh
@@ -76,11 +76,11 @@ log_test()
                printf "TEST: %-60s  [ OK ]\n" "${msg}"
                nsuccess=$((nsuccess+1))
        else
-               ret=1
-               nfail=$((nfail+1))
                if [[ $rc -eq $ksft_skip ]]; then
                        printf "TEST: %-60s  [SKIP]\n" "${msg}"
                else
+                       ret=1
+                       nfail=$((nfail+1))
                        printf "TEST: %-60s  [FAIL]\n" "${msg}"
                fi
 
-- 
2.43.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to