public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 2/2] test: Improve test for NDP assigned prefix
Date: Fri, 8 Nov 2024 10:33:41 +0100	[thread overview]
Message-ID: <20241108103341.62a4a4c4@elisabeth> (raw)
In-Reply-To: <20241106014415.1765896-3-david@gibson.dropbear.id.au>

On Wed,  6 Nov 2024 12:44:15 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> In the NDP tests we search explicitly for a guest address with prefix
> length 64.  AFAICT this is an attempt to specifically find the SLAAC
> assigned address, rather than something assigned by other means.  We can do
> that more explicitly by checking for .protocol == "kernel_ra". however.
> 
> The SLAAC prefixes we assigned *will* always be 64-bit, that's hard-coded
> into our NDP implementation.  RFC4862 doesn't really allow anything else
> since the interface identifiers for an Ethernet-like link are 64-bits.
> 
> Let's actually verify that, rather than just assuming it, by extracting the
> prefix length assigned in the guest and checking it as well.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  test/passt/ndp | 4 ++--
>  test/pasta/ndp | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/test/passt/ndp b/test/passt/ndp
> index f54b8ce..56b385b 100644
> --- a/test/passt/ndp
> +++ b/test/passt/ndp
> @@ -23,8 +23,8 @@ hout	HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").d
>  check	[ -n "__IFNAME__" ]
>  
>  test	SLAAC: prefix
> -gout	ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .prefixlen == 64).local] | .[0]'
> -gout	PREFIX6 sipcalc __ADDR6__/64 | grep prefix | cut -d' ' -f4
> +gout	ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .protocol == "kernel_ra") | .local + "/" + (.prefixlen | tostring)] | .[0]'

This makes tests occasionally fail for me. The pasta/ndp tests is not
affected. __PREFIX6__ is empty because there are no addresses with
protocol "kernel_ra" when we check. If I do:

@@ -23,6 +23,7 @@ hout  HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").d
 check  [ -n "__IFNAME__" ]
 
 test   SLAAC: prefix
+sleep  2
 gout   ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.scope == "global" and .protocol == "kernel_ra") | .local + "/" + (.prefixlen | tostring)] | .[0]'
 gout   PREFIX6 sipcalc __ADDR6__ | grep prefix | cut -d' ' -f4
 hout   HOST_ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__HOST_IFNAME6__").addr_info[] | select(.scope == "global" and .deprecated != true).local] | .[0]'

things seem to work, but I didn't test many times, and looking at
47f0bd503210 ("net: Add new protocol attribute to IP addresses"), I
don't see how that would help.

-- 
Stefano


  reply	other threads:[~2024-11-08  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06  1:44 [PATCH 0/2] test: Fixes for prefixlen handling David Gibson
2024-11-06  1:44 ` [PATCH 1/2] test: Don't require 64-bit prefixes in perf tests David Gibson
2024-11-19 20:43   ` Stefano Brivio
2024-11-06  1:44 ` [PATCH 2/2] test: Improve test for NDP assigned prefix David Gibson
2024-11-08  9:33   ` Stefano Brivio [this message]
2024-11-07 14:54 ` [PATCH 0/2] test: Fixes for prefixlen handling Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241108103341.62a4a4c4@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).