]> git.ipfire.org Git - people/ms/linux.git/commitdiff
selftests: netfilter: fix exit value for nft_concat_range
authorHangbin Liu <liuhangbin@gmail.com>
Wed, 9 Feb 2022 08:25:51 +0000 (16:25 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Feb 2022 10:07:06 +0000 (11:07 +0100)
When the nft_concat_range test failed, it exit 1 in the code
specifically.

But when part of, or all of the test passed, it will failed the
[ ${passed} -eq 0 ] check and thus exit with 1, which is the same
exit value with failure result. Fix it by exit 0 when passed is not 0.

Fixes: 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tools/testing/selftests/netfilter/nft_concat_range.sh

index df322e47a54fb8122093dc7562176f9ad3be1e24..b35010cc7f6ae09c1b4c544de8f62e1cef3886e6 100755 (executable)
@@ -1601,4 +1601,4 @@ for name in ${TESTS}; do
        done
 done
 
-[ ${passed} -eq 0 ] && exit ${KSELFTEST_SKIP}
+[ ${passed} -eq 0 ] && exit ${KSELFTEST_SKIP} || exit 0