test: always create networkd mock tmpfs for networkd-test.py

Match the behaviour of the other test classes that use sd-run and
always create the mock tmpfs runtime dirs.
This will be needed as the new resolve.hook directory won't exist
on boot but will be needed by the test case.
This commit is contained in:
Luca Boccassi
2025-11-15 00:37:58 +00:00
committed by Lennart Poettering
parent 4408db6908
commit f041d40dee

View File

@@ -91,9 +91,8 @@ def setUpModule():
for d in ['/etc/systemd/network', '/run/systemd/network', for d in ['/etc/systemd/network', '/run/systemd/network',
'/run/systemd/netif', '/run/systemd/resolve']: '/run/systemd/netif', '/run/systemd/resolve']:
if os.path.isdir(d): subprocess.check_call(["mount", "-m", "-t", "tmpfs", "none", d])
subprocess.check_call(["mount", "-t", "tmpfs", "none", d]) tmpmounts.append(d)
tmpmounts.append(d)
if os.path.isdir('/run/systemd/resolve'): if os.path.isdir('/run/systemd/resolve'):
os.chmod('/run/systemd/resolve', 0o755) os.chmod('/run/systemd/resolve', 0o755)
shutil.chown('/run/systemd/resolve', 'systemd-resolve', 'systemd-resolve') shutil.chown('/run/systemd/resolve', 'systemd-resolve', 'systemd-resolve')