From 104cdb42d0b7ed0ec46b7ca9b32e7c9beb0e13a0 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 4 May 2021 17:07:49 +0200 Subject: [PATCH] tests: use a tmpfs for /var/lock and handle broken symlinks --- tests/integration/fixtures/programs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/fixtures/programs.py b/tests/integration/fixtures/programs.py index eb085c21..04e27153 100644 --- a/tests/integration/fixtures/programs.py +++ b/tests/integration/fixtures/programs.py @@ -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") -- 2.39.5