CI: autopkgtest edge cases for slow architectures and without systemd-resolved#550
Merged
slyon merged 3 commits intocanonical:mainfrom Apr 10, 2025
Merged
CI: autopkgtest edge cases for slow architectures and without systemd-resolved#550slyon merged 3 commits intocanonical:mainfrom
slyon merged 3 commits intocanonical:mainfrom
Conversation
When systemd-resolved is not installed or active, we see this test failure
in integration tests:
======================================================================
FAIL: test_manual_addresses (__main__.TestNetworkd.test_manual_addresses)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/autopkgtest-lxc.hth3pnvn/downtmp/build.lIK/real-tree/tests/integration/ethernets.py", line 158, in test_manual_addresses
self.assertRegex(resolv_conf, 'search.*fakesuffix')
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Regex didn't match: 'search.*fakesuffix' not found in '# Generated by NetworkManager\nnameserver 2601::1\nnameserver fe80::449e:58ff:fe88:d68d%eth43\n'
Contributor
Author
|
It's working in Debian with systemd-resolved not enabled by default: https://salsa.debian.org/debian/netplan.io/-/merge_requests/18 |
When a new veth device is created via iproute2 ("ip link add ..."), the kernel
assigns a MAC address. Once udev picks up the interface, it will apply systemd
"MACAddressPolicy=permanent" default policy. But as veths cannot (by nature)
have a permanent MAC, systemd-udev will create a random (but persistent) MAC,
changing the kernel MAC.
Previously we waited for 0.1 sec to (hopefully) pick up the later system-udev
MAC, but sometimes that wasn't enough, and we still got the earlier kernel MAC,
failing certain tests cases, such as:
__main__.TestNetworkManager.test_eth_permanent_mac
__main__.TestNetworkManager.test_rename_interfaces
__main__.TestNetworkd.test_eth_permanent_mac
__main__.TestNetworkd.test_rename_interfaces
This patch drops the "time.sleep(0.1)" and instead triggers our test interfaces
and waits for settlement of those uevents via 'udevadm', to avoid race
conditions.
Contributor
Author
|
All 3 commits are passing CI & test in DebCI as part of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR contains several autopkgtest enhancements:
When a new veth device is created via iproute2 ("ip link add ..."), the kernel
assigns a MAC address. Once udev picks up the interface, it will apply systemd
"MACAddressPolicy=permanent" default policy. But as veths cannot (by nature)
have a permanent MAC, systemd-udev will create a random (but persistent) MAC,
changing the kernel MAC.
Previously we waited for 0.1 sec to (hopefully) pick up the later system-udev
MAC, but sometimes that wasn't enough, and we still got the earlier kernel MAC.
My patch drops the "time.sleep(0.1)" and instead triggers our test interfaces
and waits for settlement of those uevents via 'udevadm', to avoid race
conditions.
... Currently testing in experimental on real DebCI infrastructure.
Also including smaller timing fixes in tests for slow architectures (e.g. riscv64 or loong64) and avoiding systemd-resolved as a test-dependency of autopkgtests.
Checklist
make checksuccessfully.make check-coverage).LaunchpadDebian. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100907