From: Yu Watanabe Date: Fri, 22 Jul 2022 01:24:09 +0000 (+0900) Subject: test-network: do not stop/restart udevd and related socket units X-Git-Tag: v252-rc1~605^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87b308c825b0a32ecb5bf926c04cd973a597898e;p=thirdparty%2Fsystemd.git test-network: do not stop/restart udevd and related socket units That's not necessary. Moreover, if the socket units are stopped in `setUpModule()`, then there exists a short timespan that we cannot call `udevadm control`, as the control socket may not be opened yet. If we run whole tests, then the first test is NetworkctlTests.test_altname, and it calls `udevadm control` in `setUp()`. Hence, the test may fail. Fixes https://github.com/systemd/systemd-centos-ci/pull/512#issuecomment-1191591008. --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 6a3a2c6f459..6a32bad99fa 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -341,8 +341,7 @@ def clear_udev_rules(): rm_rf(udev_rules_dir) def save_active_units(): - for u in ['systemd-udevd-kernel.socket', 'systemd-udevd-control.socket', 'systemd-udevd.service', - 'systemd-networkd.socket', 'systemd-networkd.service', + for u in ['systemd-networkd.socket', 'systemd-networkd.service', 'systemd-resolved.service', 'firewalld.service']: if call(f'systemctl is-active --quiet {u}') == 0: @@ -352,8 +351,6 @@ def save_active_units(): def restore_active_units(): if 'systemd-networkd.socket' in active_units: call('systemctl stop systemd-networkd.socket systemd-networkd.service') - if 'systemd-udevd-kernel.socket' in active_units or 'systemd-udevd-control.socket' in active_units: - call('systemctl stop systemd-udevd-kernel.socket systemd-udevd-control.socket systemd-udevd.service') for u in active_units: call(f'systemctl restart {u}') @@ -730,6 +727,7 @@ def tearDownModule(): rm_rf('/run/systemd/system/systemd-resolved.service.d') rm_rf('/run/systemd/system/systemd-udevd.service.d') check_output('systemctl daemon-reload') + check_output('systemctl restart systemd-udevd.service') restore_active_units() class Utilities():