tests:base:ethernets: Improve stability of autopkgtests#223
Conversation
59ce930 to
60c072b
Compare
Codecov Report
@@ Coverage Diff @@
## main #223 +/- ##
==========================================
- Coverage 99.19% 99.02% -0.18%
==========================================
Files 61 56 -5
Lines 11206 9343 -1863
==========================================
- Hits 11116 9252 -1864
- Misses 90 91 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
1906350 to
d4966ba
Compare
| # don't let NM trample over our fake AP | ||
| with open('/run/NetworkManager/conf.d/test-blacklist.conf', 'w') as f: | ||
| f.write('[main]\nplugins=keyfile\n[keyfile]\nunmanaged-devices+=nptestsrv,%s\n' % klass.dev_w_ap) | ||
| with open('/etc/NetworkManager/conf.d/99-test-denylist.conf', 'w') as f: |
There was a problem hiding this comment.
Out of curiosity, why the change from /run to /etc ?
There was a problem hiding this comment.
This is because the changes in /run would be overwritten by our test system's /etc/NetworkManager/conf.d/90-test-ignore.conf, because /etc/ drop-in configs are read after /run/ drop-ins and the /etc/ drop-in uses a hard overwrite of unmanaged-devices=... in order to reset the system's default in /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf (guess we could also downgrade the test systems static /etc/ drop-in to /run/ which should have the same effect).
So with this change we would have the following order:
- base system: (system config, to be overwritten)
/usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf - setUpClass: (static test system config, i.e. management interface eth0, en*)
/etc/NetworkManager/conf.d/90-test-ignore.conf - create_devices: (dynamic test interfaces, like eth42, eth43, wlan1, ...)
/etc/NetworkManager/conf.d/99-test-denylist.conf
[...] you can add additional .conf files to the /etc/NetworkManager/conf.d directory. These will be read in order, with later files overriding earlier ones. Packages might install further configuration snippets to /usr/lib/NetworkManager/conf.d. This directory is parsed first, even before NetworkManager.conf. Scripts can also put per-boot configuration into /run/NetworkManager/conf.d. This directory is parsed second, also before NetworkManager.conf. The loading of a file /run/NetworkManager/conf.d/name.conf can be prevented by adding a file /etc/NetworkManager/conf.d/name.conf. Likewise, a file /usr/lib/NetworkManager/conf.d/name.conf can be shadowed by putting a file of the same name to either /etc/NetworkManager/conf.d or /run/NetworkManager/conf.d.
https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html
|
This PR should be integrated with https://git.launchpad.net/~ubuntu-core-dev/netplan/+git/ubuntu/commit/?id=abdfe5deb62ed312dec56a67ae4dae42a348fbf1 |
9fe1820 to
9ba6a33
Compare
Make sure the "unmanaged-devices" are kept in check so that NetworkManager does not take control over some network interfaces that are controlled by the test system, such as the routers veth42, veth42, fake wifi AP, ...
9ba6a33 to
e7c4638
Compare
Make sure NetworkManager's
unmanaged-devicesare kept in check so that NM does not take control over some network interfaces that are controlled by the test system, such as the routers veth42, veth42, fake wifi AP, ...Replaces the "autopkgtest-fixes.patch" Distro patch.
Changing the location of the denylist from /run to /etc because the changes in /run would be overwritten by our test system's /etc/NetworkManager/conf.d/90-test-ignore.conf, because /etc/ drop-in configs are read after /run/ drop-ins and the /etc/ drop-in uses a hard overwrite of
unmanaged-devices=...in order to reset the system's default in /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf (guess we could also downgrade the test systems static /etc/ drop-in to /run/ which should have the same effect).So with this change we would have the following order:
/usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
/etc/NetworkManager/conf.d/90-test-ignore.conf
/etc/NetworkManager/conf.d/99-test-denylist.conf
https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html
Checklist
make checksuccessfully.make check-coverage).