aboutgitcodebugslistschat
path: root/test/pasta
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-10-18 12:35:52 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-10-18 20:27:51 +0200
commit53176ca91d176ea15d8abf3b1429e43bc93e516c (patch)
tree9cb95b8eb757277016c3b9aac69b12382e8fa35b /test/pasta
parent75b9c0feb0b54b040a8c49f160cfc2defe28c045 (diff)
downloadpasst-53176ca91d176ea15d8abf3b1429e43bc93e516c.tar
passt-53176ca91d176ea15d8abf3b1429e43bc93e516c.tar.gz
passt-53176ca91d176ea15d8abf3b1429e43bc93e516c.tar.bz2
passt-53176ca91d176ea15d8abf3b1429e43bc93e516c.tar.lz
passt-53176ca91d176ea15d8abf3b1429e43bc93e516c.tar.xz
passt-53176ca91d176ea15d8abf3b1429e43bc93e516c.tar.zst
passt-53176ca91d176ea15d8abf3b1429e43bc93e516c.zip
test: Wait for DAD on DHCPv6 addresses
After running dhclient -6 we expect the DHCPv6 assigned address to be immediately usable. That's true with the Fedora dhclient-script (and the upstream ISC DHCP one), however it's not true with the Debian dhclient-script. The Debian script can complete with the address still in "tentative" state, and the address won't be usable until Duplicate Address Detection (DAD) completes. That's arguably a bug in Debian (see link below), but for the time being we need to work around it anyway. We usually get away with this, because by the time we do anything where the address matters, DAD has completed. However, it's not robust, so we should explicitly wait for DAD to complete when we get an DHCPv6 address. Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085231 Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/pasta')
-rw-r--r--test/pasta/dhcp2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/pasta/dhcp b/test/pasta/dhcp
index 41556b8..d4f3ad5 100644
--- a/test/pasta/dhcp
+++ b/test/pasta/dhcp
@@ -35,6 +35,8 @@ check [ __MTU__ = 65520 ]
test DHCPv6: address
ns /sbin/dhclient -6 --no-pid __IFNAME__
+# Wait for DAD to complete
+ns while ip -j -6 addr show tentative | jq -e '.[].addr_info'; do sleep 0.1; done
hout HOST_IFNAME6 ip -j -6 route show|jq -rM '[.[] | select(.dst == "default").dev] | .[0]'
nsout ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME__").addr_info[] | select(.prefixlen == 128).local] | .[0]'
hout HOST_ADDR6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__HOST_IFNAME6__").addr_info[] | select(.scope == "global" and .deprecated != true).local] | .[0]'