Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 0a36a75c6818 ("selftests: icmp_redirect: support expected failures")
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Po-Hsu Lin and committed by
David S. Miller
3748939b ee60e626

+1 -1
+1 -1
tools/testing/selftests/net/icmp_redirect.sh
··· 311 311 ip -netns h1 ro get ${H1_VRF_ARG} ${H2_N2_IP} | \ 312 312 grep -E -v 'mtu|redirected' | grep -q "cache" 313 313 fi 314 - log_test $? 0 "IPv4: ${desc}" 314 + log_test $? 0 "IPv4: ${desc}" 0 315 315 316 316 # No PMTU info for test "redirect" and "mtu exception plus redirect" 317 317 if [ "$with_redirect" = "yes" ] && [ "$desc" != "redirect exception plus mtu" ]; then