From: Vincent Bernat Date: Fri, 9 Apr 2021 09:59:07 +0000 (+0200) Subject: tests: catch problem with creation of chroot in tests X-Git-Tag: 1.0.10~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7535505355c24593b2e3890f08d7fe445c85f780;p=thirdparty%2Flldpd.git tests: catch problem with creation of chroot in tests --- diff --git a/tests/integration/fixtures/programs.py b/tests/integration/fixtures/programs.py index b1c2c04c..e389c011 100644 --- a/tests/integration/fixtures/programs.py +++ b/tests/integration/fixtures/programs.py @@ -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 diff --git a/tests/integration/test_basic.py b/tests/integration/test_basic.py index 4a9459ff..b8cd49b1 100644 --- a/tests/integration/test_basic.py +++ b/tests/integration/test_basic.py @@ -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()