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
60066f2d
Commit
60066f2d
authored
Jan 10, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zdtm: Test that rlimits are c/r-ed
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
748be831
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
0 deletions
+68
-0
zdtm.sh
test/zdtm.sh
+1
-0
Makefile
test/zdtm/live/static/Makefile
+1
-0
rlimits00.c
test/zdtm/live/static/rlimits00.c
+66
-0
No files found.
test/zdtm.sh
View file @
60066f2d
...
@@ -66,6 +66,7 @@ static/fifo-ghost
...
@@ -66,6 +66,7 @@ static/fifo-ghost
static/fifo
static/fifo
static/fifo_wronly
static/fifo_wronly
static/zombie00
static/zombie00
static/rlimits00
transition/fork
transition/fork
static/pty00
static/pty00
static/pty01
static/pty01
...
...
test/zdtm/live/static/Makefile
View file @
60066f2d
...
@@ -68,6 +68,7 @@ TST_NOFILE = \
...
@@ -68,6 +68,7 @@ TST_NOFILE = \
inotify00
\
inotify00
\
uptime_grow
\
uptime_grow
\
session00
\
session00
\
rlimits00
\
pty00
\
pty00
\
pty01
\
pty01
\
pty02
\
pty02
\
...
...
test/zdtm/live/static/rlimits00.c
0 → 100644
View file @
60066f2d
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/resource.h>
#include "zdtmtst.h"
const
char
*
test_doc
=
"Check that rlimits are saved"
;
const
char
*
test_author
=
"Pavel Emelianov <xemul@parallels.com>"
;
int
main
(
int
argc
,
char
**
argv
)
{
int
r
,
changed
=
0
;
struct
rlimit
rlims
[
RLIM_NLIMITS
],
trlim
;
test_init
(
argc
,
argv
);
for
(
r
=
0
;
r
<
RLIM_NLIMITS
;
r
++
)
{
if
(
getrlimit
(
r
,
&
rlims
[
r
]))
{
err
(
"Can't get rlimit"
);
goto
out
;
}
if
(
rlims
[
r
].
rlim_cur
>
1
&&
rlims
[
r
].
rlim_cur
!=
RLIM_INFINITY
)
{
rlims
[
r
].
rlim_cur
--
;
if
(
setrlimit
(
r
,
&
rlims
[
r
]))
{
err
(
"Can't set rlimit"
);
goto
out
;
}
changed
=
1
;
}
}
if
(
!
changed
)
{
err
(
"Can't change any rlimir"
);
goto
out
;
}
test_daemon
();
test_waitsig
();
for
(
r
=
0
;
r
<
RLIM_NLIMITS
;
r
++
)
{
if
(
getrlimit
(
r
,
&
trlim
))
{
fail
(
"Can't get rlimit after rst"
);
goto
out
;
}
if
(
rlims
[
r
].
rlim_cur
!=
trlim
.
rlim_cur
)
{
fail
(
"Cur changed"
);
goto
out
;
}
if
(
rlims
[
r
].
rlim_max
!=
trlim
.
rlim_max
)
{
fail
(
"Max changed"
);
goto
out
;
}
}
pass
();
out:
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