selftests: netfilter: fix exit value for nft_concat_range
Subsystems (4)
PATCH 1/1 selftests: netfilter: fix exit value for nft_concat_range
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.
--- tools/testing/selftests/netfilter/nft_concat_range.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/netfilter/nft_concat_range.sh +1 -1
@@ -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
Signature · 1 line
2.31.1
Quoted 6 lines · On Wed, 9 Feb 2022 16:25:51 +0800 Hangbin Liu <[email protected]> wrote:
When the
nft_concat_rangetest 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.
Oops, right, thanks for fixing this!
Quoted 2 lines
Fixes 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")Signed-off-by Hangbin Liu <[email protected]>
Signature · 1 line
Stefano
Quoted 10 lines · Stefano Brivio
Quoted 6 lines · On Wed, 9 Feb 2022 16:25:51 +0800 Hangbin Liu <[email protected]> wrote:
When the
nft_concat_rangetest 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.
Quoted 6 lines
Oops, right, thanks for fixing this!
Quoted 2 lines
Fixes 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")Signed-off-by Hangbin Liu <[email protected]>Reviewed-by Stefano Brivio <[email protected]>
Applied, thanks