netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] selftests: pmtu.sh: Remove quotes around commands in setup_xfrm
@ 2019-05-16 17:41 David Ahern
  2019-05-16 17:51 ` Stefano Brivio
  2019-05-16 21:28 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: David Ahern @ 2019-05-16 17:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, sbrivio, David Ahern

From: David Ahern <dsahern@gmail.com>

The first command in setup_xfrm is failing resulting in the test getting
skipped:

+ ip netns exec ns-B ip -6 xfrm state add src fd00:1::a dst fd00:1::b spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
+ out=RTNETLINK answers: Function not implemented
...
  xfrm6 not supported
TEST: vti6: PMTU exceptions                                         [SKIP]
  xfrm4 not supported
TEST: vti4: PMTU exceptions                                         [SKIP]
...

The setup command started failing when the run_cmd option was added.
Removing the quotes fixes the problem:
...
TEST: vti6: PMTU exceptions                                         [ OK ]
TEST: vti4: PMTU exceptions                                         [ OK ]
...

Fixes: 56490b623aa0 ("selftests: Add debugging options to pmtu.sh")
Signed-off-by: David Ahern <dsahern@gmail.com>
---
 tools/testing/selftests/net/pmtu.sh | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index 524b15dabb3c..b9171a7b3aaa 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -430,15 +430,15 @@ setup_xfrm() {
 	veth_a_addr="${2}"
 	veth_b_addr="${3}"
 
-	run_cmd "${ns_a} ip -${proto} xfrm state add src ${veth_a_addr} dst ${veth_b_addr} spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel" || return 1
-	run_cmd "${ns_a} ip -${proto} xfrm state add src ${veth_b_addr} dst ${veth_a_addr} spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel"
-	run_cmd "${ns_a} ip -${proto} xfrm policy add dir out mark 10 tmpl src ${veth_a_addr} dst ${veth_b_addr} proto esp mode tunnel"
-	run_cmd "${ns_a} ip -${proto} xfrm policy add dir in mark 10 tmpl src ${veth_b_addr} dst ${veth_a_addr} proto esp mode tunnel"
-
-	run_cmd "${ns_b} ip -${proto} xfrm state add src ${veth_a_addr} dst ${veth_b_addr} spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel"
-	run_cmd "${ns_b} ip -${proto} xfrm state add src ${veth_b_addr} dst ${veth_a_addr} spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel"
-	run_cmd "${ns_b} ip -${proto} xfrm policy add dir out mark 10 tmpl src ${veth_b_addr} dst ${veth_a_addr} proto esp mode tunnel"
-	run_cmd "${ns_b} ip -${proto} xfrm policy add dir in mark 10 tmpl src ${veth_a_addr} dst ${veth_b_addr} proto esp mode tunnel"
+	run_cmd ${ns_a} ip -${proto} xfrm state add src ${veth_a_addr} dst ${veth_b_addr} spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel || return 1
+	run_cmd ${ns_a} ip -${proto} xfrm state add src ${veth_b_addr} dst ${veth_a_addr} spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
+	run_cmd ${ns_a} ip -${proto} xfrm policy add dir out mark 10 tmpl src ${veth_a_addr} dst ${veth_b_addr} proto esp mode tunnel
+	run_cmd ${ns_a} ip -${proto} xfrm policy add dir in mark 10 tmpl src ${veth_b_addr} dst ${veth_a_addr} proto esp mode tunnel
+
+	run_cmd ${ns_b} ip -${proto} xfrm state add src ${veth_a_addr} dst ${veth_b_addr} spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
+	run_cmd ${ns_b} ip -${proto} xfrm state add src ${veth_b_addr} dst ${veth_a_addr} spi 0x1001 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
+	run_cmd ${ns_b} ip -${proto} xfrm policy add dir out mark 10 tmpl src ${veth_b_addr} dst ${veth_a_addr} proto esp mode tunnel
+	run_cmd ${ns_b} ip -${proto} xfrm policy add dir in mark 10 tmpl src ${veth_a_addr} dst ${veth_b_addr} proto esp mode tunnel
 }
 
 setup_xfrm4() {
-- 
2.11.0


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

* Re: [PATCH net] selftests: pmtu.sh: Remove quotes around commands in setup_xfrm
  2019-05-16 17:41 [PATCH net] selftests: pmtu.sh: Remove quotes around commands in setup_xfrm David Ahern
@ 2019-05-16 17:51 ` Stefano Brivio
  2019-05-16 17:53   ` David Ahern
  2019-05-16 21:28 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Stefano Brivio @ 2019-05-16 17:51 UTC (permalink / raw)
  To: David Ahern; +Cc: davem, netdev, David Ahern

On Thu, 16 May 2019 10:41:31 -0700
David Ahern <dsahern@kernel.org> wrote:

> From: David Ahern <dsahern@gmail.com>
> 
> The first command in setup_xfrm is failing resulting in the test getting
> skipped:
> 
> + ip netns exec ns-B ip -6 xfrm state add src fd00:1::a dst fd00:1::b spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
> + out=RTNETLINK answers: Function not implemented

Thanks for fixing this, I ran into this issue right today and I was
about to send a patch too. For the record, the quotes went all the way
into xfrm_alg_name_match():

	name: 'rfc4106(gcm(aes))'
	entry->name: rfc4106(gcm(aes))

My solution was to remove the single quotes around 'rfc4106(gcm(aes))',
but I just checked yours and it also works on bash and dash, so I don't
really have a preference.

> ...
>   xfrm6 not supported
> TEST: vti6: PMTU exceptions                                         [SKIP]
>   xfrm4 not supported
> TEST: vti4: PMTU exceptions                                         [SKIP]
> ...
> 
> The setup command started failing when the run_cmd option was added.
> Removing the quotes fixes the problem:
> ...
> TEST: vti6: PMTU exceptions                                         [ OK ]
> TEST: vti4: PMTU exceptions                                         [ OK ]
> ...
> 
> Fixes: 56490b623aa0 ("selftests: Add debugging options to pmtu.sh")
> Signed-off-by: David Ahern <dsahern@gmail.com>

Reviewed-and-tested-by: Stefano Brivio <sbrivio@redhat.com>

-- 
Stefano

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

* Re: [PATCH net] selftests: pmtu.sh: Remove quotes around commands in setup_xfrm
  2019-05-16 17:51 ` Stefano Brivio
@ 2019-05-16 17:53   ` David Ahern
  0 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2019-05-16 17:53 UTC (permalink / raw)
  To: Stefano Brivio, David Ahern; +Cc: davem, netdev

On 5/16/19 11:51 AM, Stefano Brivio wrote:
> On Thu, 16 May 2019 10:41:31 -0700
> David Ahern <dsahern@kernel.org> wrote:
> 
>> From: David Ahern <dsahern@gmail.com>
>>
>> The first command in setup_xfrm is failing resulting in the test getting
>> skipped:
>>
>> + ip netns exec ns-B ip -6 xfrm state add src fd00:1::a dst fd00:1::b spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
>> + out=RTNETLINK answers: Function not implemented
> 
> Thanks for fixing this, I ran into this issue right today and I was
> about to send a patch too. For the record, the quotes went all the way
> into xfrm_alg_name_match():
> 
> 	name: 'rfc4106(gcm(aes))'
> 	entry->name: rfc4106(gcm(aes))
> 
> My solution was to remove the single quotes around 'rfc4106(gcm(aes))',
> but I just checked yours and it also works on bash and dash, so I don't
> really have a preference.
> 

None of the other commands have the "" with run_cmd. Not sure why I did
not remove the quotes from the xfrm commands.


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

* Re: [PATCH net] selftests: pmtu.sh: Remove quotes around commands in setup_xfrm
  2019-05-16 17:41 [PATCH net] selftests: pmtu.sh: Remove quotes around commands in setup_xfrm David Ahern
  2019-05-16 17:51 ` Stefano Brivio
@ 2019-05-16 21:28 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-05-16 21:28 UTC (permalink / raw)
  To: dsahern; +Cc: netdev, sbrivio, dsahern

From: David Ahern <dsahern@kernel.org>
Date: Thu, 16 May 2019 10:41:31 -0700

> From: David Ahern <dsahern@gmail.com>
> 
> The first command in setup_xfrm is failing resulting in the test getting
> skipped:
> 
> + ip netns exec ns-B ip -6 xfrm state add src fd00:1::a dst fd00:1::b spi 0x1000 proto esp aead 'rfc4106(gcm(aes))' 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f 128 mode tunnel
> + out=RTNETLINK answers: Function not implemented
> ...
>   xfrm6 not supported
> TEST: vti6: PMTU exceptions                                         [SKIP]
>   xfrm4 not supported
> TEST: vti4: PMTU exceptions                                         [SKIP]
> ...
> 
> The setup command started failing when the run_cmd option was added.
> Removing the quotes fixes the problem:
> ...
> TEST: vti6: PMTU exceptions                                         [ OK ]
> TEST: vti4: PMTU exceptions                                         [ OK ]
> ...
> 
> Fixes: 56490b623aa0 ("selftests: Add debugging options to pmtu.sh")
> Signed-off-by: David Ahern <dsahern@gmail.com>

Applied, thanks David.

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

end of thread, other threads:[~2019-05-16 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 17:41 [PATCH net] selftests: pmtu.sh: Remove quotes around commands in setup_xfrm David Ahern
2019-05-16 17:51 ` Stefano Brivio
2019-05-16 17:53   ` David Ahern
2019-05-16 21:28 ` David Miller

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).