]> git.ipfire.org Git - thirdparty/lldpd.git/commit
tests/integration: mount /proc in namespaces
authorVincent Bernat <vincent@bernat.im>
Fri, 18 Mar 2016 15:52:40 +0000 (16:52 +0100)
committerVincent Bernat <vincent@bernat.im>
Fri, 18 Mar 2016 18:34:54 +0000 (19:34 +0100)
commit3046da4bab1b75d1537d76d2c5fd440677b5e114
treed5cce291af3d96d128a7df4c04db174808ba9eec
parent87f484516d951f080efb9d523ee289fd360fe0c8
tests/integration: mount /proc in namespaces

Because of the use of a PID namespace, we must mount /proc into the
appropriate namespace. We don't do that directly when creating
namespaces as clone() doesn't account for the namespace change with
setns() when we are still in the same process. We also fork a process to
do the mount as it seems mount() doesn't get that we are in a different
mount namespace either. Obviously, setns() has some drawbacks we need to
workaround.

We also mount /proc in the chroot. It's absolutely not safe to do so,
but that's only for address sanitizer to work as expected.
tests/integration/fixtures/programs.py