summaryrefslogtreecommitdiff
path: root/test/test-network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-07-22 10:24:09 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-07-22 10:31:38 +0900
commit87b308c825b0a32ecb5bf926c04cd973a597898e (patch)
treeb6f06c422b25b5721d43acefebc96bbd0e1c66e2 /test/test-network
parent8d0c34f3673e6c28eb0c5abaf639260260249099 (diff)
downloadsystemd-87b308c825b0a32ecb5bf926c04cd973a597898e.tar.gz
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.
Diffstat (limited to 'test/test-network')
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index 6a3a2c6f45..6a32bad99f 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():