Skip to contentSkip to conversation

selftests: netfilter: fix exit value for nft_concat_range

PATCH Applied Hangbin Liu 3 participants 3 messages Feb 9, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")
---
 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
index df322e47a54f..b35010cc7f6a 100755
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Wed, 9 Feb 2022 16:25:51 +0800 Hangbin Liu <[email protected]> wrote:

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.

Oops, right, thanks for fixing this!

Quoted 2 lines
Fixes 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")
Signature · 1 line
Stefano
maintainer Applied
#2 lore raw
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_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.

Quoted 6 lines

Oops, right, thanks for fixing this!

Quoted 2 lines
Fixes 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation")

Applied, thanks