]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tests: catch problem with creation of chroot in tests
authorVincent Bernat <vincent@bernat.ch>
Fri, 9 Apr 2021 09:59:07 +0000 (11:59 +0200)
committerVincent Bernat <vincent@bernat.ch>
Fri, 9 Apr 2021 09:59:07 +0000 (11:59 +0200)
tests/integration/fixtures/programs.py
tests/integration/test_basic.py

index b1c2c04cc9014ebd86071ece457eeba32d919a5f..e389c011e249064a4125152e5a01b4957d087a9c 100644 (file)
@@ -152,15 +152,9 @@ class LldpdFactory(object):
         if self.config.lldpd.privsep.enabled:
             # Chroot
             chroot = self.config.lldpd.privsep.chroot
-            if os.path.isdir(chroot):
-                mount_tmpfs(chroot)
-            else:
-                parent = os.path.abspath(os.path.join(chroot, os.pardir))
-                assert os.path.isdir(parent)
-                mount_tmpfs(parent)
-            if not os.path.isdir(chroot):
-                os.mkdir(chroot)
-            mount_proc(os.path.join(chroot, "proc"))
+            parent = os.path.abspath(os.path.join(chroot, os.pardir))
+            assert os.path.isdir(parent)
+            mount_tmpfs(parent)
             # User/group
             user = self.config.lldpd.privsep.user
             group = self.config.lldpd.privsep.group
index 4a9459ff65c976c0ae6502300948eb91dcdc61c7..b8cd49b1faa489aa419fb20ce5a89aa61ae55bc7 100644 (file)
@@ -4,7 +4,6 @@ import pyroute2
 import scapy.all
 import scapy.contrib.lldp
 
-
 def test_one_neighbor(lldpd1, lldpd, lldpcli, namespaces):
     with namespaces(2):
         lldpd()