* [PATCH] test/passt/ndp: Add delay in SLAAC prefix test before looking for kernel_ra address
@ 2024-11-25 10:37 Stefano Brivio
2024-11-26 2:28 ` David Gibson
0 siblings, 1 reply; 3+ messages in thread
From: Stefano Brivio @ 2024-11-25 10:37 UTC (permalink / raw)
To: passt-dev; +Cc: David Gibson
I'm not exactly sure why we need this delay, but commit 9a0e544f05bf
("test: Improve test for NDP assigned prefix") broke the tests for me.
I think it's because the kernel (at least all the versions I'm testing
with) might not mark an address as 'kernel_ra' right away, so the jq
expression doesn't return any result when we check.
Fixes: 9a0e544f05bf ("test: Improve test for NDP assigned prefix")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
test/passt/ndp | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/passt/ndp b/test/passt/ndp
index 56b385b..9a1c9a4 100644
--- a/test/passt/ndp
+++ b/test/passt/ndp
@@ -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]'
--
@@ -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]'
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] test/passt/ndp: Add delay in SLAAC prefix test before looking for kernel_ra address
2024-11-25 10:37 [PATCH] test/passt/ndp: Add delay in SLAAC prefix test before looking for kernel_ra address Stefano Brivio
@ 2024-11-26 2:28 ` David Gibson
2024-11-26 6:18 ` Stefano Brivio
0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2024-11-26 2:28 UTC (permalink / raw)
To: Stefano Brivio; +Cc: passt-dev
[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]
On Mon, Nov 25, 2024 at 11:37:19AM +0100, Stefano Brivio wrote:
> I'm not exactly sure why we need this delay, but commit 9a0e544f05bf
> ("test: Improve test for NDP assigned prefix") broke the tests for me.
>
> I think it's because the kernel (at least all the versions I'm testing
> with) might not mark an address as 'kernel_ra' right away, so the jq
> expression doesn't return any result when we check.
>
> Fixes: 9a0e544f05bf ("test: Improve test for NDP assigned prefix")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This will do the job, but I think we can do better. There's logic
above this to explicitly wait for DAD which doesn't seem to be
working. Having another look at it, I think that's just because the
conditions I used are a bit sloppy. I'm about to send a patch which
improves them, which I hope will fix the problem you're seeing.
> ---
> test/passt/ndp | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/test/passt/ndp b/test/passt/ndp
> index 56b385b..9a1c9a4 100644
> --- a/test/passt/ndp
> +++ b/test/passt/ndp
> @@ -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]'
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] test/passt/ndp: Add delay in SLAAC prefix test before looking for kernel_ra address
2024-11-26 2:28 ` David Gibson
@ 2024-11-26 6:18 ` Stefano Brivio
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Brivio @ 2024-11-26 6:18 UTC (permalink / raw)
To: David Gibson; +Cc: passt-dev
On Tue, 26 Nov 2024 13:28:22 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:
> On Mon, Nov 25, 2024 at 11:37:19AM +0100, Stefano Brivio wrote:
> > I'm not exactly sure why we need this delay, but commit 9a0e544f05bf
> > ("test: Improve test for NDP assigned prefix") broke the tests for me.
> >
> > I think it's because the kernel (at least all the versions I'm testing
> > with) might not mark an address as 'kernel_ra' right away, so the jq
> > expression doesn't return any result when we check.
> >
> > Fixes: 9a0e544f05bf ("test: Improve test for NDP assigned prefix")
> > Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
>
> This will do the job, but I think we can do better. There's logic
> above this to explicitly wait for DAD which doesn't seem to be
> working. Having another look at it, I think that's just because the
> conditions I used are a bit sloppy. I'm about to send a patch which
> improves them, which I hope will fix the problem you're seeing.
Ah, right, thanks, I missed the fact that the filter on the previous
wait didn't actually match the filter for ADDR6. Your new patch fixes
the issue, so I'm discarding this one of course.
--
Stefano
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-26 6:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-25 10:37 [PATCH] test/passt/ndp: Add delay in SLAAC prefix test before looking for kernel_ra address Stefano Brivio
2024-11-26 2:28 ` David Gibson
2024-11-26 6:18 ` Stefano Brivio
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).