selftests: icmp_redirect: pass xfail=0 to log_test()
authorPo-Hsu Lin <po-hsu.lin@canonical.com>
Fri, 10 Dec 2021 07:25:23 +0000 (15:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:40 +0000 (09:32 +0100)
commita4377575d2e9017abf393bdfb3ef8d19071fabcc
treee3d4200a250b2e6adb9095f33a51c8441f44ec49
parent4cd2d21bbe580fb7539a87c574671e4196d82353
selftests: icmp_redirect: pass xfail=0 to log_test()

[ Upstream commit 3748939bce3fc7a15ef07161826507fbe410bb7a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/net/icmp_redirect.sh