zdtm: add mntns_compare check to mount_complex_sharing

This way we can check that mount tree topology (including sharing
groups) is the same before and after c/r.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
Pavel Tikhomirov 2022-02-22 11:43:59 +03:00 committed by Andrei Vagin
parent ad349597b5
commit 54888c487f

View file

@ -5,6 +5,7 @@
#include <sys/mount.h>
#include <linux/limits.h>
#include "mountinfo.h"
#include "zdtmtst.h"
const char *test_doc = "Check complex sharing options for mounts";
@ -211,6 +212,7 @@ static int mount_loop(void)
int main(int argc, char **argv)
{
struct mntns_zdtm mntns_before, mntns_after;
int ret = 1;
test_init(argc, argv);
@ -223,12 +225,23 @@ int main(int argc, char **argv)
if (mount_loop())
goto err;
if (mntns_parse_mountinfo(&mntns_before))
goto err;
test_daemon();
test_waitsig();
if (mntns_parse_mountinfo(&mntns_after))
goto err;
if (mntns_compare(&mntns_before, &mntns_after))
goto err;
pass();
ret = 0;
err:
mntns_free_all(&mntns_before);
mntns_free_all(&mntns_after);
if (ret)
fail();
return ret;