All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] Fix selftests icmp_redirect.sh failures
@ 2021-07-07  8:15 Hangbin Liu
  2021-07-07  8:15 ` [PATCH net 1/2] selftests: icmp_redirect: remove from checking for IPv6 route get Hangbin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hangbin Liu @ 2021-07-07  8:15 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, Hangbin Liu

This patchset fixes 2 failures for selftests icmp_redirect.sh.

The first patch is for IPv6 redirecting tests. When disable option
CONFIG_IPV6_SUBTREES, there is not "from ::" info in ip route output.
So we should not check this key word.

The second patch is for testing "mtu exception plus redirect", which do
a PMTU update first and do redirect second. For topology like

                         (MTU 1300)
       |----- R1_1 -------- R1_2 --------|
H1  ---|                                 | ---- H2 (MTU 1500)
       |----- R2_1 -------- R2_2 --------|

After redirecting to R2 patch, the PMTU info in R1 path should be cleard.
So we should not check PMTU info for test "mtu exception plus redirect".

After the fixes, all the test passed now

]# ./icmp_redirect.sh

###########################################################################
Legacy routing
###########################################################################

TEST: IPv4: redirect exception                                      [ OK ]
TEST: IPv6: redirect exception                                      [ OK ]
TEST: IPv4: redirect exception plus mtu                             [ OK ]
TEST: IPv6: redirect exception plus mtu                             [ OK ]
TEST: IPv4: routing reset                                           [ OK ]
TEST: IPv6: routing reset                                           [ OK ]
TEST: IPv4: mtu exception                                           [ OK ]
TEST: IPv6: mtu exception                                           [ OK ]
TEST: IPv4: mtu exception plus redirect                             [ OK ]
TEST: IPv6: mtu exception plus redirect                             [ OK ]

[...]

###########################################################################
Routing with nexthop objects and VRF
###########################################################################

TEST: IPv4: redirect exception                                      [ OK ]
TEST: IPv6: redirect exception                                      [ OK ]
TEST: IPv4: redirect exception plus mtu                             [ OK ]
TEST: IPv6: redirect exception plus mtu                             [ OK ]
TEST: IPv4: routing reset                                           [ OK ]
TEST: IPv6: routing reset                                           [ OK ]
TEST: IPv4: mtu exception                                           [ OK ]
TEST: IPv6: mtu exception                                           [ OK ]
TEST: IPv4: mtu exception plus redirect                             [ OK ]
TEST: IPv6: mtu exception plus redirect                             [ OK ]

Tests passed:  40
Tests failed:   0
Tests xfailed:   0

Hangbin Liu (2):
  selftests: icmp_redirect: remove from checking for IPv6 route get
  selftests: icmp_redirect: IPv6 PMTU info should be cleared after
    redirect

 tools/testing/selftests/net/icmp_redirect.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.31.1


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

* [PATCH net 1/2] selftests: icmp_redirect: remove from checking for IPv6 route get
  2021-07-07  8:15 [PATCH net 0/2] Fix selftests icmp_redirect.sh failures Hangbin Liu
@ 2021-07-07  8:15 ` Hangbin Liu
  2021-07-07 14:49   ` David Ahern
  2021-07-07  8:15 ` [PATCH net 2/2] selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect Hangbin Liu
  2021-07-07 20:51 ` [PATCH net 0/2] Fix selftests icmp_redirect.sh failures patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Hangbin Liu @ 2021-07-07  8:15 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, Hangbin Liu

If the kernel doesn't enable option CONFIG_IPV6_SUBTREES, the RTA_SRC
info will not be exported to userspace in rt6_fill_node(). And ip cmd will
not print "from ::" to the route output. So remove this check.

Fixes: ec8105352869 ("selftests: Add redirect tests")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.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 c19ecc6a8614..3a111ac1edc3 100755
--- a/tools/testing/selftests/net/icmp_redirect.sh
+++ b/tools/testing/selftests/net/icmp_redirect.sh
@@ -315,7 +315,7 @@ check_exception()
 
 	if [ "$with_redirect" = "yes" ]; then
 		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
-		grep -q "${H2_N2_IP6} from :: via ${R2_LLADDR} dev br0.*${mtu}"
+		grep -q "${H2_N2_IP6} .*via ${R2_LLADDR} dev br0.*${mtu}"
 	elif [ -n "${mtu}" ]; then
 		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
 		grep -q "${mtu}"
-- 
2.31.1


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

* [PATCH net 2/2] selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect
  2021-07-07  8:15 [PATCH net 0/2] Fix selftests icmp_redirect.sh failures Hangbin Liu
  2021-07-07  8:15 ` [PATCH net 1/2] selftests: icmp_redirect: remove from checking for IPv6 route get Hangbin Liu
@ 2021-07-07  8:15 ` Hangbin Liu
  2021-07-07 14:51   ` David Ahern
  2021-07-07 20:51 ` [PATCH net 0/2] Fix selftests icmp_redirect.sh failures patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Hangbin Liu @ 2021-07-07  8:15 UTC (permalink / raw)
  To: netdev; +Cc: David Ahern, Hangbin Liu

After redirecting, it's already a new path. So the old PMTU info should
be cleared. The IPv6 test "mtu exception plus redirect" should only
has redirect info without old PMTU.

The IPv4 test can not be changed because of legacy.

Fixes: ec8105352869 ("selftests: Add redirect tests")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 tools/testing/selftests/net/icmp_redirect.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/icmp_redirect.sh b/tools/testing/selftests/net/icmp_redirect.sh
index 3a111ac1edc3..ecbf57f264ed 100755
--- a/tools/testing/selftests/net/icmp_redirect.sh
+++ b/tools/testing/selftests/net/icmp_redirect.sh
@@ -313,9 +313,10 @@ check_exception()
 	fi
 	log_test $? 0 "IPv4: ${desc}"
 
-	if [ "$with_redirect" = "yes" ]; then
+	# No PMTU info for test "redirect" and "mtu exception plus redirect"
+	if [ "$with_redirect" = "yes" ] && [ "$desc" != "redirect exception plus mtu" ]; then
 		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
-		grep -q "${H2_N2_IP6} .*via ${R2_LLADDR} dev br0.*${mtu}"
+		grep -v "mtu" | grep -q "${H2_N2_IP6} .*via ${R2_LLADDR} dev br0"
 	elif [ -n "${mtu}" ]; then
 		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
 		grep -q "${mtu}"
-- 
2.31.1


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

* Re: [PATCH net 1/2] selftests: icmp_redirect: remove from checking for IPv6 route get
  2021-07-07  8:15 ` [PATCH net 1/2] selftests: icmp_redirect: remove from checking for IPv6 route get Hangbin Liu
@ 2021-07-07 14:49   ` David Ahern
  0 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2021-07-07 14:49 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: David Ahern

On 7/7/21 2:15 AM, Hangbin Liu wrote:
> If the kernel doesn't enable option CONFIG_IPV6_SUBTREES, the RTA_SRC
> info will not be exported to userspace in rt6_fill_node(). And ip cmd will
> not print "from ::" to the route output. So remove this check.
> 
> Fixes: ec8105352869 ("selftests: Add redirect tests")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.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 c19ecc6a8614..3a111ac1edc3 100755
> --- a/tools/testing/selftests/net/icmp_redirect.sh
> +++ b/tools/testing/selftests/net/icmp_redirect.sh
> @@ -315,7 +315,7 @@ check_exception()
>  
>  	if [ "$with_redirect" = "yes" ]; then
>  		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
> -		grep -q "${H2_N2_IP6} from :: via ${R2_LLADDR} dev br0.*${mtu}"
> +		grep -q "${H2_N2_IP6} .*via ${R2_LLADDR} dev br0.*${mtu}"
>  	elif [ -n "${mtu}" ]; then
>  		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
>  		grep -q "${mtu}"
> 

Reviewed-by: David Ahern <dsahern@kernel.org>

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

* Re: [PATCH net 2/2] selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect
  2021-07-07  8:15 ` [PATCH net 2/2] selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect Hangbin Liu
@ 2021-07-07 14:51   ` David Ahern
  0 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2021-07-07 14:51 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: David Ahern

On 7/7/21 2:15 AM, Hangbin Liu wrote:
> After redirecting, it's already a new path. So the old PMTU info should
> be cleared. The IPv6 test "mtu exception plus redirect" should only
> has redirect info without old PMTU.
> 
> The IPv4 test can not be changed because of legacy.
> 
> Fixes: ec8105352869 ("selftests: Add redirect tests")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  tools/testing/selftests/net/icmp_redirect.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/icmp_redirect.sh b/tools/testing/selftests/net/icmp_redirect.sh
> index 3a111ac1edc3..ecbf57f264ed 100755
> --- a/tools/testing/selftests/net/icmp_redirect.sh
> +++ b/tools/testing/selftests/net/icmp_redirect.sh
> @@ -313,9 +313,10 @@ check_exception()
>  	fi
>  	log_test $? 0 "IPv4: ${desc}"
>  
> -	if [ "$with_redirect" = "yes" ]; then
> +	# No PMTU info for test "redirect" and "mtu exception plus redirect"
> +	if [ "$with_redirect" = "yes" ] && [ "$desc" != "redirect exception plus mtu" ]; then
>  		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
> -		grep -q "${H2_N2_IP6} .*via ${R2_LLADDR} dev br0.*${mtu}"
> +		grep -v "mtu" | grep -q "${H2_N2_IP6} .*via ${R2_LLADDR} dev br0"
>  	elif [ -n "${mtu}" ]; then
>  		ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
>  		grep -q "${mtu}"
> 

Reviewed-by: David Ahern <dsahern@kernel.org>


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

* Re: [PATCH net 0/2] Fix selftests icmp_redirect.sh failures
  2021-07-07  8:15 [PATCH net 0/2] Fix selftests icmp_redirect.sh failures Hangbin Liu
  2021-07-07  8:15 ` [PATCH net 1/2] selftests: icmp_redirect: remove from checking for IPv6 route get Hangbin Liu
  2021-07-07  8:15 ` [PATCH net 2/2] selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect Hangbin Liu
@ 2021-07-07 20:51 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-07 20:51 UTC (permalink / raw)
  To: Hangbin Liu; +Cc: netdev, dsahern

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Wed,  7 Jul 2021 16:15:28 +0800 you wrote:
> This patchset fixes 2 failures for selftests icmp_redirect.sh.
> 
> The first patch is for IPv6 redirecting tests. When disable option
> CONFIG_IPV6_SUBTREES, there is not "from ::" info in ip route output.
> So we should not check this key word.
> 
> The second patch is for testing "mtu exception plus redirect", which do
> a PMTU update first and do redirect second. For topology like
> 
> [...]

Here is the summary with links:
  - [net,1/2] selftests: icmp_redirect: remove from checking for IPv6 route get
    https://git.kernel.org/netdev/net/c/24b671aad4ea
  - [net,2/2] selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect
    https://git.kernel.org/netdev/net/c/0e02bf5de46a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-07-07 20:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07  8:15 [PATCH net 0/2] Fix selftests icmp_redirect.sh failures Hangbin Liu
2021-07-07  8:15 ` [PATCH net 1/2] selftests: icmp_redirect: remove from checking for IPv6 route get Hangbin Liu
2021-07-07 14:49   ` David Ahern
2021-07-07  8:15 ` [PATCH net 2/2] selftests: icmp_redirect: IPv6 PMTU info should be cleared after redirect Hangbin Liu
2021-07-07 14:51   ` David Ahern
2021-07-07 20:51 ` [PATCH net 0/2] Fix selftests icmp_redirect.sh failures patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.