mirror of
https://passt.top/passt
synced 2025-05-29 04:35:33 +02:00
test: Explicitly wait for DAD to complete on SLAAC addresses
Getting a SLAAC address takes a little while because the kernel must complete Duplicate Address Detection (DAD) before marking the address as ready. In several places we have an explicit 'sleep 2' to wait for that to complete. Fixed length delays are never a great idea, although this one is pretty solid. Still, it would be better to explicitly wait for DAD to complete in case of long delays (which might happen on slow emulated hosts, or with heavy load), and to speed the tests up if DAD completes quicker. Replace the fixed sleeps with a loop waiting for DAD to complete. We do this by looping waiting for all tentative addresses to disappear. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
f9d677bff6
commit
75b9c0feb0
3 changed files with 7 additions and 3 deletions
test/two_guests
|
@ -36,7 +36,8 @@ check [ "__ADDR2__" = "__HOST_ADDR__" ]
|
|||
|
||||
test DHCPv6: addresses
|
||||
# Link is up now, wait for DAD to complete
|
||||
sleep 2
|
||||
guest1 while ip -j -6 addr show tentative | jq -e '.[].addr_info'; do sleep 0.1; done
|
||||
guest2 while ip -j -6 addr show tentative | jq -e '.[].addr_info'; do sleep 0.1; done
|
||||
guest1 /sbin/dhclient -6 __IFNAME1__
|
||||
guest2 /sbin/dhclient -6 __IFNAME2__
|
||||
g1out ADDR1_6 ip -j -6 addr show|jq -rM '[.[] | select(.ifname == "__IFNAME1__").addr_info[] | select(.prefixlen == 128).local] | .[0]'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue