1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-05 09:17:44 +03:00

test-network: reprocess the loopback network interface

Fixes the issue reported at https://github.com/systemd/systemd-centos-ci/pull/585#issuecomment-1385537641.

(cherry picked from commit df0a741cdd)
This commit is contained in:
Yu Watanabe 2023-01-18 18:53:42 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 1710948120
commit efc4cbaa7f

View File

@ -1063,6 +1063,10 @@ class NetworkctlTests(unittest.TestCase, Utilities):
self.assertRegex(output, r'Link File: (/usr)?/lib/systemd/network/99-default.link')
self.assertRegex(output, r'Network File: /run/systemd/network/11-dummy.network')
# This test may be run on the system that has older udevd than 70f32a260b5ebb68c19ecadf5d69b3844896ba55 (v249).
# In that case, the udev DB for the loopback network interface may already have ID_NET_LINK_FILE property.
# Let's reprocess the interface and drop the property.
check_output(*udevadm_cmd, 'trigger', '--settle', '--action=add', '/sys/class/net/lo')
output = check_output(*networkctl_cmd, '-n', '0', 'status', 'lo', env=env)
print(output)
self.assertRegex(output, r'Link File: n/a')