tests: fix dummy0 flakes

Once we add a new network device, systemd-udev may execute some rules.
In particular, we see that on Fedora it sets the MAC address (presumably
based on the host name and device name). This setting races with ours
'ip link set address', as a result, "checkpoint and restore with netdevice"
test sometimes fails telling the MAC address is not as expected.

In the future there may be some other udev rules etc., so the overall
solution is to wait until systemd-udev is finished applying the rules,
thus eliminating the race.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2026-06-16 10:43:37 -07:00
committed by Rodrigo Campos
parent 4196f12948
commit b2ada85ed3
3 changed files with 4 additions and 0 deletions
+1
View File
@@ -25,6 +25,7 @@ function setup() {
# Create a dummy interface to move to the container.
ip link add dummy0 type dummy
udevadm settle
}
function teardown() {
+1
View File
@@ -28,6 +28,7 @@ function setup() {
# Create a dummy interface to move to the container.
ip link add dummy0 type dummy
udevadm settle
}
function teardown() {
+2
View File
@@ -252,6 +252,7 @@ function teardown() {
# Create a dummy interface to move to the container.
ip link add dummy0 type dummy
udevadm settle
update_config ' .linux.netDevices |= {"dummy0": {} }
| .process.args |= ["ip", "address", "show", "dev", "dummy0"]'
@@ -269,6 +270,7 @@ function teardown() {
# Create a dummy interface to move to the container.
ip link add dummy0 type dummy
udevadm settle
update_config ' .linux.netDevices |= { "dummy0": { "name" : "ctr_dummy0" } }
| .process.args |= ["ip", "address", "show", "dev", "ctr_dummy0"]'