]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: always create networkd mock tmpfs for networkd-test.py
authorLuca Boccassi <luca.boccassi@gmail.com>
Sat, 15 Nov 2025 00:37:58 +0000 (00:37 +0000)
committerLennart Poettering <lennart@poettering.net>
Sat, 15 Nov 2025 06:48:29 +0000 (07:48 +0100)
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.

test/networkd-test.py

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