]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tests: use a tmpfs for /var/lock and handle broken symlinks fix/tests-var-lock
authorVincent Bernat <vincent@bernat.ch>
Tue, 4 May 2021 15:07:49 +0000 (17:07 +0200)
committerVincent Bernat <vincent@bernat.ch>
Tue, 4 May 2021 15:37:40 +0000 (17:37 +0200)
tests/integration/fixtures/programs.py

index eb085c215d77fe1a83e17d0e2efd318b906cab6f..04e2715374a139dc428c372efc380d9d38d751c4 100644 (file)
@@ -207,11 +207,11 @@ protocols: files
 services: files
 """)
 
-        # Ensure lock directory also exists
-        try:
-            os.makedirs("/var/lock", mode=0o1777)
-        except FileExistsError:
-            pass
+        # Ensure lock directory also exists. This can be a broken symlink!
+        path = os.path.realpath("/var/lock")
+        if not os.path.isdir(path):
+            os.mkdir(path)
+        mount_tmpfs(path)
 
         # Remove any config
         path = os.path.join(self.config.lldpd.confdir, "lldpd.conf")