zdtm: mount tmpfs into /run in a test root

iptables creates /run/xtables.lock file and
we want to have it per-test.

(00.332159)      1: 	Running iptables-restore -w for iptables-restore -w
Fatal: can't open lock file /run/xtables.lock: Permission denied

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Andrei Vagin 2018-05-12 07:05:59 +03:00
parent 839875a442
commit cc88159f8d

View file

@ -100,6 +100,11 @@ static int prepare_mntns(void)
return -1;
}
if (mount("zdtm_run", "/run", "tmpfs", 0, NULL)) {
fprintf(stderr, "Unable to mount /run: %m\n");
return -1;
}
if (umount2("./old", MNT_DETACH)) {
fprintf(stderr, "umount(./old) failed: %m\n");
return -1;