Commit 7a2afe33 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

zdtm: allow to execute shm and msgque in userns

Signed-off-by: 's avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fe44213e
...@@ -195,8 +195,8 @@ generate_test_list() ...@@ -195,8 +195,8 @@ generate_test_list()
ns/static/bind-mount ns/static/bind-mount
ns/static/utsname ns/static/utsname
ns/static/ipc_namespace ns/static/ipc_namespace
static/shm ns/static/shm
static/msgque ns/static/msgque
ns/static/sem ns/static/sem
transition/ipc transition/ipc
static/netns-nf static/netns-nf
......
...@@ -28,13 +28,15 @@ struct msg1 { ...@@ -28,13 +28,15 @@ struct msg1 {
#define ANOTHER_TEST_STRING "Yet another test sysv5 msg" #define ANOTHER_TEST_STRING "Yet another test sysv5 msg"
#define ANOTHER_MSG_TYPE 26538 #define ANOTHER_MSG_TYPE 26538
static int test_fn(int argc, char **argv) int main(int argc, char **argv)
{ {
key_t key; key_t key;
int msg, pid; int msg, pid;
struct msg1 msgbuf; struct msg1 msgbuf;
int chret; int chret;
test_init(argc, argv);
key = ftok(argv[0], 822155650); key = ftok(argv[0], 822155650);
if (key == -1) { if (key == -1) {
pr_perror("Can't make key"); pr_perror("Can't make key");
...@@ -134,14 +136,3 @@ err: ...@@ -134,14 +136,3 @@ err:
chret = -errno; chret = -errno;
goto out; goto out;
} }
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;
}
...@@ -100,7 +100,7 @@ static int check_shm_key(int key, size_t size) ...@@ -100,7 +100,7 @@ static int check_shm_key(int key, size_t size)
return check_shm_id(id, size); return check_shm_id(id, size);
} }
static int test_fn(int argc, char **argv) int main(int argc, char **argv)
{ {
key_t key; key_t key;
int shm; int shm;
...@@ -110,6 +110,8 @@ static int test_fn(int argc, char **argv) ...@@ -110,6 +110,8 @@ static int test_fn(int argc, char **argv)
void *mem; void *mem;
uint32_t crc = INIT_CRC; uint32_t crc = INIT_CRC;
test_init(argc, argv);
key = ftok(argv[0], 822155666); key = ftok(argv[0], 822155666);
if (key == -1) { if (key == -1) {
pr_perror("Can't make key"); pr_perror("Can't make key");
...@@ -190,15 +192,3 @@ out_shm: ...@@ -190,15 +192,3 @@ out_shm:
out: out:
return ret; return ret;
} }
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;
}
{'flavor': 'h'} {'flavor': 'ns uns'}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment