mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
zdtm: Add mntns_root_bind02 test
It's an extension of mntns_root_bind, which is differ by one more bind mount. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Acked-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
3a234722df
commit
076c73b21a
@@ -229,6 +229,7 @@ generate_test_list()
|
||||
ns/static/mntns_shared_bind
|
||||
ns/static/mntns_shared_bind02
|
||||
ns/static/mntns_root_bind
|
||||
ns/static/mntns_root_bind02
|
||||
ns/static/mntns_deleted
|
||||
ns/static/inotify01
|
||||
ns/static/mntns_rw_ro_rw
|
||||
@@ -368,6 +369,7 @@ mntns_link_ghost
|
||||
mntns_shared_bind
|
||||
mntns_shared_bind02
|
||||
mntns_root_bind
|
||||
mntns_root_bind02
|
||||
mntns_rw_ro_rw
|
||||
mntns_deleted
|
||||
mount_paths
|
||||
|
1
test/zdtm/.gitignore
vendored
1
test/zdtm/.gitignore
vendored
@@ -206,6 +206,7 @@
|
||||
/live/static/file_locks05
|
||||
/live/static/mlock_setuid
|
||||
/live/static/mntns_root_bind
|
||||
/live/static/mntns_root_bind02
|
||||
/live/static/mntns-deleted-dst
|
||||
/live/static/socket-tcp-local
|
||||
/live/static/socket-tcp6-local
|
||||
|
@@ -222,6 +222,7 @@ TST_DIR = \
|
||||
mntns_shared_bind \
|
||||
mntns_shared_bind02 \
|
||||
mntns_root_bind \
|
||||
mntns_root_bind02 \
|
||||
mnt_ext_auto \
|
||||
mnt_ext_master \
|
||||
mntns_deleted \
|
||||
@@ -366,6 +367,7 @@ sigpending: override LDLIBS += -lrt
|
||||
vdso01: override LDLIBS += -lrt
|
||||
mntns_link_remap: override CFLAGS += -DZDTM_LINK_REMAP
|
||||
mntns_shared_bind02: override CFLAGS += -DSHARED_BIND02
|
||||
mntns_root_bind02: override CFLAGS += -DROOT_BIND02
|
||||
maps02: get_smaps_bits.o
|
||||
mlock_setuid: get_smaps_bits.o
|
||||
inotify01: override CFLAGS += -DINOTIFY01
|
||||
|
@@ -27,7 +27,8 @@ TEST_OPTION(dirname, string, "directory name", 1);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char path[PATH_MAX], bpath[PATH_MAX], spath[PATH_MAX], bspath[PATH_MAX];
|
||||
char subdir1[PATH_MAX], path[PATH_MAX], bpath[PATH_MAX], spath[PATH_MAX], bspath[PATH_MAX];
|
||||
char subdir2[PATH_MAX], bsubdir2[PATH_MAX];
|
||||
pid_t pid;
|
||||
int status;
|
||||
task_waiter_t t;
|
||||
@@ -38,12 +39,19 @@ int main(int argc, char **argv)
|
||||
|
||||
mount(NULL, "/", NULL, MS_SHARED, NULL);
|
||||
|
||||
snprintf(path, sizeof(path), "%s/test", dirname);
|
||||
snprintf(bpath, sizeof(bpath), "%s/test.bind", dirname);
|
||||
snprintf(spath, sizeof(spath), "%s/test/sub", dirname);
|
||||
snprintf(bspath, sizeof(bspath), "%s/test.bind/sub", dirname);
|
||||
snprintf(subdir1, sizeof(subdir1), "%s/subdir1", dirname);
|
||||
snprintf(path, sizeof(path), "%s/test", subdir1);
|
||||
snprintf(bpath, sizeof(bpath), "%s/test.bind", subdir1);
|
||||
snprintf(spath, sizeof(spath), "%s/test/sub", subdir1);
|
||||
snprintf(bspath, sizeof(bspath), "%s/test.bind/sub", subdir1);
|
||||
|
||||
snprintf(subdir2, sizeof(subdir2), "%s/subdir2", dirname);
|
||||
snprintf(bsubdir2, sizeof(bsubdir2), "%s/bsubdir2", dirname);
|
||||
|
||||
if (mkdir(dirname, 0700) ||
|
||||
mkdir(subdir1, 0777) ||
|
||||
mkdir(subdir2, 0777) ||
|
||||
mkdir(bsubdir2, 0777) ||
|
||||
mkdir(path, 0700) ||
|
||||
mkdir(spath, 0700) ||
|
||||
mkdir(bpath, 0700)) {
|
||||
@@ -87,6 +95,13 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef ROOT_BIND02
|
||||
if (mount(subdir2, bsubdir2, NULL, MS_BIND, NULL)) {
|
||||
pr_perror("Unable to mount %s to %s", subdir2, bsubdir2);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
test_daemon();
|
||||
test_waitsig();
|
||||
|
||||
|
1
test/zdtm/live/static/mntns_root_bind02.c
Symbolic link
1
test/zdtm/live/static/mntns_root_bind02.c
Symbolic link
@@ -0,0 +1 @@
|
||||
mntns_root_bind.c
|
1
test/zdtm/live/static/mntns_root_bind02.desc
Symbolic link
1
test/zdtm/live/static/mntns_root_bind02.desc
Symbolic link
@@ -0,0 +1 @@
|
||||
mntns_root_bind.desc
|
Reference in New Issue
Block a user