mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
zdtm: allow to execute ipc_namespace and utsname tests in userns
Signed-off-by: Andrew Vagin <avagin@openvz.org> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
5dc505c0ca
commit
fe44213e84
10
test/zdtm.sh
10
test/zdtm.sh
@@ -193,11 +193,11 @@ generate_test_list()
|
||||
ns/static/mnt_ro_bind
|
||||
ns/static/mount_paths
|
||||
ns/static/bind-mount
|
||||
static/utsname
|
||||
static/ipc_namespace
|
||||
ns/static/utsname
|
||||
ns/static/ipc_namespace
|
||||
static/shm
|
||||
static/msgque
|
||||
static/sem
|
||||
ns/static/sem
|
||||
transition/ipc
|
||||
static/netns-nf
|
||||
static/netns
|
||||
@@ -292,6 +292,8 @@ generate_test_list()
|
||||
ns/static/rtc
|
||||
ns/static/cow01
|
||||
ns/static/tempfs_ro
|
||||
ns/static/ipc_namespace
|
||||
ns/static/utsname
|
||||
"
|
||||
|
||||
# Add tests which can be executed in an user namespace
|
||||
@@ -360,6 +362,8 @@ apparmor
|
||||
seccomp_strict
|
||||
different_creds
|
||||
inotify01
|
||||
ipc_namespace
|
||||
utsname
|
||||
"
|
||||
|
||||
TEST_EXPECTED_FAILURE="
|
||||
|
@@ -327,10 +327,12 @@ static void show_ipc_entry(struct ipc_ns *old, struct ipc_ns *new)
|
||||
old->mq_msgsize_max, new->mq_msgsize_max);
|
||||
}
|
||||
|
||||
static int test_fn(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
test_init(argc, argv);
|
||||
|
||||
ret = rand_ipc_ns();
|
||||
if (ret) {
|
||||
pr_perror("Failed to randomize ipc ns before migration");
|
||||
@@ -361,9 +363,3 @@ static int test_fn(int argc, char **argv)
|
||||
pass();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
test_init_ns(argc, argv, CLONE_NEWIPC, test_fn);
|
||||
return -1;
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
{'flavor': 'h'}
|
||||
{'flavor': 'ns uns'}
|
||||
|
@@ -105,11 +105,13 @@ static int check_sem_by_id(int id, int val)
|
||||
sizeof(unlock)/sizeof(struct sembuf));
|
||||
}
|
||||
|
||||
static int test_fn(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int id, key, val;
|
||||
int ret, fail_count = 0;
|
||||
|
||||
test_init(argc, argv);
|
||||
|
||||
key = ftok(argv[0], 89063453);
|
||||
if (key == -1) {
|
||||
pr_perror("Can't make key");
|
||||
@@ -168,14 +170,3 @@ out:
|
||||
pass();
|
||||
return fail_count;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef NEW_IPC_NS
|
||||
test_init_ns(argc, argv, CLONE_NEWIPC, test_fn);
|
||||
#else
|
||||
test_init(argc, argv);
|
||||
test_fn(argc, argv);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
{'flavor': 'h'}
|
||||
{'flavor': 'ns uns'}
|
||||
|
@@ -13,11 +13,13 @@ static struct utsname after;
|
||||
#define ZDTM_NODE "zdtm.nodename.ru"
|
||||
#define ZDTM_DOMAIN "zdtm.nodename.ru"
|
||||
|
||||
static int test_fn(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
int fd;
|
||||
|
||||
test_init(argc, argv);
|
||||
|
||||
fd = open("/proc/sys/kernel/hostname", O_WRONLY);
|
||||
if (fd < 0) {
|
||||
pr_perror("Can't open hostname");
|
||||
@@ -63,9 +65,3 @@ static int test_fn(int argc, char **argv)
|
||||
pass();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
test_init_ns(argc, argv, CLONE_NEWUTS, test_fn);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
{'flavor': 'h'}
|
||||
{'flavor': 'ns uns'}
|
||||
|
Reference in New Issue
Block a user