Skip to content

Commit 3748939

Browse files
Cypresslindavem330
authored andcommitted
selftests: icmp_redirect: pass xfail=0 to log_test()
If any sub-test in this icmp_redirect.sh is failing but not expected to fail. The script will complain: ./icmp_redirect.sh: line 72: [: 1: unary operator expected This is because when the sub-test is not expected to fail, we won't pass any value for the xfail local variable in log_test() and thus it's empty. Fix this by passing 0 as the 4th variable to log_test() for non-xfail cases. v2: added fixes tag Fixes: 0a36a75 ("selftests: icmp_redirect: support expected failures") Signed-off-by: Po-Hsu Lin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ee60e62 commit 3748939

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/net/icmp_redirect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ check_exception()
311311
ip -netns h1 ro get ${H1_VRF_ARG} ${H2_N2_IP} | \
312312
grep -E -v 'mtu|redirected' | grep -q "cache"
313313
fi
314-
log_test $? 0 "IPv4: ${desc}"
314+
log_test $? 0 "IPv4: ${desc}" 0
315315

316316
# No PMTU info for test "redirect" and "mtu exception plus redirect"
317317
if [ "$with_redirect" = "yes" ] && [ "$desc" != "redirect exception plus mtu" ]; then

0 commit comments

Comments
 (0)