mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 23:35:21 +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/mnt_ro_bind
|
||||||
ns/static/mount_paths
|
ns/static/mount_paths
|
||||||
ns/static/bind-mount
|
ns/static/bind-mount
|
||||||
static/utsname
|
ns/static/utsname
|
||||||
static/ipc_namespace
|
ns/static/ipc_namespace
|
||||||
static/shm
|
static/shm
|
||||||
static/msgque
|
static/msgque
|
||||||
static/sem
|
ns/static/sem
|
||||||
transition/ipc
|
transition/ipc
|
||||||
static/netns-nf
|
static/netns-nf
|
||||||
static/netns
|
static/netns
|
||||||
@@ -292,6 +292,8 @@ generate_test_list()
|
|||||||
ns/static/rtc
|
ns/static/rtc
|
||||||
ns/static/cow01
|
ns/static/cow01
|
||||||
ns/static/tempfs_ro
|
ns/static/tempfs_ro
|
||||||
|
ns/static/ipc_namespace
|
||||||
|
ns/static/utsname
|
||||||
"
|
"
|
||||||
|
|
||||||
# Add tests which can be executed in an user namespace
|
# Add tests which can be executed in an user namespace
|
||||||
@@ -360,6 +362,8 @@ apparmor
|
|||||||
seccomp_strict
|
seccomp_strict
|
||||||
different_creds
|
different_creds
|
||||||
inotify01
|
inotify01
|
||||||
|
ipc_namespace
|
||||||
|
utsname
|
||||||
"
|
"
|
||||||
|
|
||||||
TEST_EXPECTED_FAILURE="
|
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);
|
old->mq_msgsize_max, new->mq_msgsize_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int test_fn(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
test_init(argc, argv);
|
||||||
|
|
||||||
ret = rand_ipc_ns();
|
ret = rand_ipc_ns();
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_perror("Failed to randomize ipc ns before migration");
|
pr_perror("Failed to randomize ipc ns before migration");
|
||||||
@@ -361,9 +363,3 @@ static int test_fn(int argc, char **argv)
|
|||||||
pass();
|
pass();
|
||||||
return 0;
|
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));
|
sizeof(unlock)/sizeof(struct sembuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int test_fn(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int id, key, val;
|
int id, key, val;
|
||||||
int ret, fail_count = 0;
|
int ret, fail_count = 0;
|
||||||
|
|
||||||
|
test_init(argc, argv);
|
||||||
|
|
||||||
key = ftok(argv[0], 89063453);
|
key = ftok(argv[0], 89063453);
|
||||||
if (key == -1) {
|
if (key == -1) {
|
||||||
pr_perror("Can't make key");
|
pr_perror("Can't make key");
|
||||||
@@ -168,14 +170,3 @@ out:
|
|||||||
pass();
|
pass();
|
||||||
return fail_count;
|
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_NODE "zdtm.nodename.ru"
|
||||||
#define ZDTM_DOMAIN "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 ret;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
test_init(argc, argv);
|
||||||
|
|
||||||
fd = open("/proc/sys/kernel/hostname", O_WRONLY);
|
fd = open("/proc/sys/kernel/hostname", O_WRONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
pr_perror("Can't open hostname");
|
pr_perror("Can't open hostname");
|
||||||
@@ -63,9 +65,3 @@ static int test_fn(int argc, char **argv)
|
|||||||
pass();
|
pass();
|
||||||
return 0;
|
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