From 5514481f13f5a3ebe1a349bdb4735ddc18f9023b Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 16 Jun 2026 10:43:37 -0700 Subject: [PATCH] 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 (cherry picked from commit b2ada85ed3c92ccb58f20a49d877e18832f77271) --- tests/integration/checkpoint.bats | 1 + tests/integration/netdev.bats | 1 + tests/integration/userns.bats | 2 ++ 3 files changed, 4 insertions(+) diff --git a/tests/integration/checkpoint.bats b/tests/integration/checkpoint.bats index 10c5e2201..5f90de2ac 100644 --- a/tests/integration/checkpoint.bats +++ b/tests/integration/checkpoint.bats @@ -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() { diff --git a/tests/integration/netdev.bats b/tests/integration/netdev.bats index b14ad834a..6dddbab07 100644 --- a/tests/integration/netdev.bats +++ b/tests/integration/netdev.bats @@ -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() { diff --git a/tests/integration/userns.bats b/tests/integration/userns.bats index 1f2e83400..b4ae16249 100644 --- a/tests/integration/userns.bats +++ b/tests/integration/userns.bats @@ -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"]'