mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
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:
committed by
Rodrigo Campos
parent
4196f12948
commit
b2ada85ed3
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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"]'
|
||||
|
||||
Reference in New Issue
Block a user