platform/tests: fix bug in netns test which can cause mounting tmpfs over /run
authorThomas Haller <thaller@redhat.com>
Thu, 24 Mar 2016 16:05:39 +0000 (17:05 +0100)
committerThomas Haller <thaller@redhat.com>
Thu, 24 Mar 2016 16:49:15 +0000 (17:49 +0100)
commit12e6984b8763418856218ee8b3a8d3498c44f7f5
tree8f77e2221d44300f63ce6507ae247c30d6b8d8a7
parent76b79df1555c4e8c05dee94bc3eb88bfb49f3fbf
platform/tests: fix bug in netns test which can cause mounting tmpfs over /run

The root-test "/general/netns/bind-to-path" mounts a tmpfs
over /var/run for the duration of the test and unmounts it at
the end.

Due to a bug, we first mount the tmpfs, then switch to another
namespace, and finally unmount /var/run on that other namespace.

That means, when you run the tests as root, it will bork /run
on your system.

Fixes: 46f5c07643e6cbf920a44bebe9ac9d3435a5a7b6
src/platform/tests/test-link.c