linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: icmp_redirect: pass xfail=0 to log_test() for non-xfail cases
@ 2021-12-08  7:11 Po-Hsu Lin
  2021-12-10  2:46 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Po-Hsu Lin @ 2021-12-08  7:11 UTC (permalink / raw)
  To: po-hsu.lin, netdev, linux-kselftest, linux-kernel; +Cc: davem, kuba, skhan

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.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/net/icmp_redirect.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/icmp_redirect.sh b/tools/testing/selftests/net/icmp_redirect.sh
index ecbf57f..7b9d6e3 100755
--- a/tools/testing/selftests/net/icmp_redirect.sh
+++ b/tools/testing/selftests/net/icmp_redirect.sh
@@ -311,7 +311,7 @@ check_exception()
 		ip -netns h1 ro get ${H1_VRF_ARG} ${H2_N2_IP} | \
 		grep -E -v 'mtu|redirected' | grep -q "cache"
 	fi
-	log_test $? 0 "IPv4: ${desc}"
+	log_test $? 0 "IPv4: ${desc}" 0
 
 	# No PMTU info for test "redirect" and "mtu exception plus redirect"
 	if [ "$with_redirect" = "yes" ] && [ "$desc" != "redirect exception plus mtu" ]; then
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: icmp_redirect: pass xfail=0 to log_test() for non-xfail cases
  2021-12-08  7:11 [PATCH] selftests: icmp_redirect: pass xfail=0 to log_test() for non-xfail cases Po-Hsu Lin
@ 2021-12-10  2:46 ` Jakub Kicinski
  2021-12-10  7:16   ` Po-Hsu Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2021-12-10  2:46 UTC (permalink / raw)
  To: Po-Hsu Lin; +Cc: netdev, linux-kselftest, linux-kernel, davem, skhan

On Wed,  8 Dec 2021 15:11:51 +0800 Po-Hsu Lin wrote:
> 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.
> 
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>

Thanks, could you please add a fixes tag (even if the breakage is only
present in linux-next) and CC David Ahern on v2?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests: icmp_redirect: pass xfail=0 to log_test() for non-xfail cases
  2021-12-10  2:46 ` Jakub Kicinski
@ 2021-12-10  7:16   ` Po-Hsu Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Po-Hsu Lin @ 2021-12-10  7:16 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, linux-kselftest, linux-kernel, davem, skhan

On Fri, Dec 10, 2021 at 10:46 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed,  8 Dec 2021 15:11:51 +0800 Po-Hsu Lin wrote:
> > 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.
> >
> > Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
>
> Thanks, could you please add a fixes tag (even if the breakage is only
> present in linux-next) and CC David Ahern on v2?

Sure thing,
I will add fixes tag for this commit:
0a36a75c selftests: icmp_redirect: support expected failures

thanks for the feedback.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-10  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08  7:11 [PATCH] selftests: icmp_redirect: pass xfail=0 to log_test() for non-xfail cases Po-Hsu Lin
2021-12-10  2:46 ` Jakub Kicinski
2021-12-10  7:16   ` Po-Hsu Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).