Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
23cd0703
Commit
23cd0703
authored
Oct 11, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zdtp: Test that supplementary groups are supported
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
f429de66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
0 deletions
+66
-0
zdtm.sh
test/zdtm.sh
+1
-0
Makefile
test/zdtm/live/static/Makefile
+1
-0
groups.c
test/zdtm/live/static/groups.c
+64
-0
No files found.
test/zdtm.sh
View file @
23cd0703
...
@@ -24,6 +24,7 @@ static/timers
...
@@ -24,6 +24,7 @@ static/timers
static/futex
static/futex
static/futex-rl
static/futex-rl
static/xids00
static/xids00
static/groups
static/pthread00
static/pthread00
streaming/pipe_loop00
streaming/pipe_loop00
streaming/pipe_shared00
streaming/pipe_shared00
...
...
test/zdtm/live/static/Makefile
View file @
23cd0703
...
@@ -47,6 +47,7 @@ TST_NOFILE = \
...
@@ -47,6 +47,7 @@ TST_NOFILE = \
sem
\
sem
\
maps01
\
maps01
\
xids00
\
xids00
\
groups
\
file_fown
\
file_fown
\
eventfs00
\
eventfs00
\
signalfd00
\
signalfd00
\
...
...
test/zdtm/live/static/groups.c
0 → 100644
View file @
23cd0703
#define _GNU_SOURCE
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <grp.h>
#include <sys/wait.h>
#include "zdtmtst.h"
const
char
*
test_doc
=
"Check that supplementary groups are supported"
;
const
char
*
test_author
=
"Pavel Emelianov <xemul@parallels.com>"
;
int
main
(
int
argc
,
char
**
argv
)
{
unsigned
int
ng
,
*
grp
,
*
grp2
,
i
,
max
;
test_init
(
argc
,
argv
);
ng
=
getgroups
(
0
,
NULL
);
if
(
ng
<
0
)
{
err
(
"Can't get groups"
);
return
-
1
;
}
grp
=
malloc
((
ng
+
1
)
*
sizeof
(
*
grp
));
ng
=
getgroups
(
ng
,
grp
);
if
(
ng
<
0
)
{
err
(
"Can't get groups2"
);
return
-
1
;
}
max
=
0
;
for
(
i
=
0
;
i
<
ng
;
i
++
)
if
(
max
<
grp
[
i
])
max
=
grp
[
i
];
grp
[
ng
++
]
=
max
+
1
;
if
(
setgroups
(
ng
,
grp
)
<
0
)
{
err
(
"Can't set groups"
);
return
-
1
;
}
test_daemon
();
test_waitsig
();
grp2
=
malloc
(
ng
*
sizeof
(
*
grp2
));
if
(
getgroups
(
ng
,
grp2
)
!=
ng
)
{
fail
(
"Nr groups changed"
);
return
-
1
;
}
if
(
memcmp
(
grp
,
grp2
,
ng
*
sizeof
(
*
grp
)))
{
fail
(
"Groups have changed"
);
return
-
1
;
}
pass
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment