Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
fe17b651
Commit
fe17b651
authored
Nov 04, 2016
by
Wolfgang Bumiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: resource limit config entries
Signed-off-by:
Wolfgang Bumiller
<
w.bumiller@proxmox.com
>
parent
93f9e90d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
get_item.c
src/tests/get_item.c
+64
-0
No files found.
src/tests/get_item.c
View file @
fe17b651
...
...
@@ -174,6 +174,70 @@ int main(int argc, char *argv[])
}
printf
(
"lxc.mount.entry returned %d %s
\n
"
,
ret
,
v2
);
ret
=
c
->
get_config_item
(
c
,
"lxc.limit"
,
v3
,
2047
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
"%d: get_config_item(limit) returned %d
\n
"
,
__LINE__
,
ret
);
goto
out
;
}
if
(
!
c
->
set_config_item
(
c
,
"lxc.limit.nofile"
,
"1234:unlimited"
))
{
fprintf
(
stderr
,
"%d: failed to set limit.nofile
\n
"
,
__LINE__
);
goto
out
;
}
ret
=
c
->
get_config_item
(
c
,
"lxc.limit.nofile"
,
v2
,
255
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"%d: get_config_item(lxc.limit.nofile) returned %d
\n
"
,
__LINE__
,
ret
);
goto
out
;
}
if
(
strcmp
(
v2
,
"1234:unlimited"
))
{
fprintf
(
stderr
,
"%d: lxc.limit.nofile returned wrong value: %d %s not 14 1234:unlimited
\n
"
,
__LINE__
,
ret
,
v2
);
goto
out
;
}
printf
(
"lxc.limit.nofile returned %d %s
\n
"
,
ret
,
v2
);
if
(
!
c
->
set_config_item
(
c
,
"lxc.limit.stack"
,
"unlimited"
))
{
fprintf
(
stderr
,
"%d: failed to set limit.stack
\n
"
,
__LINE__
);
goto
out
;
}
ret
=
c
->
get_config_item
(
c
,
"lxc.limit.stack"
,
v2
,
255
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"%d: get_config_item(lxc.limit.stack) returned %d
\n
"
,
__LINE__
,
ret
);
goto
out
;
}
if
(
strcmp
(
v2
,
"unlimited"
))
{
fprintf
(
stderr
,
"%d: lxc.limit.stack returned wrong value: %d %s not 9 unlimited
\n
"
,
__LINE__
,
ret
,
v2
);
goto
out
;
}
printf
(
"lxc.limit.stack returned %d %s
\n
"
,
ret
,
v2
);
#define LIMIT_STACK "lxc.limit.stack = unlimited\n"
#define ALL_LIMITS "lxc.limit.nofile = 1234:unlimited\n" LIMIT_STACK
ret
=
c
->
get_config_item
(
c
,
"lxc.limit"
,
v3
,
2047
);
if
(
ret
!=
sizeof
(
ALL_LIMITS
)
-
1
)
{
fprintf
(
stderr
,
"%d: get_config_item(limit) returned %d
\n
"
,
__LINE__
,
ret
);
goto
out
;
}
if
(
strcmp
(
v3
,
ALL_LIMITS
))
{
fprintf
(
stderr
,
"%d: lxc.limit returned wrong value: %d %s not %d %s
\n
"
,
__LINE__
,
ret
,
v3
,
(
int
)
sizeof
(
ALL_LIMITS
)
-
1
,
ALL_LIMITS
);
goto
out
;
}
printf
(
"lxc.limit returned %d %s
\n
"
,
ret
,
v3
);
if
(
!
c
->
clear_config_item
(
c
,
"lxc.limit.nofile"
))
{
fprintf
(
stderr
,
"%d: failed clearing limit.nofile
\n
"
,
__LINE__
);
goto
out
;
}
ret
=
c
->
get_config_item
(
c
,
"lxc.limit"
,
v3
,
2047
);
if
(
ret
!=
sizeof
(
LIMIT_STACK
)
-
1
)
{
fprintf
(
stderr
,
"%d: get_config_item(limit) returned %d
\n
"
,
__LINE__
,
ret
);
goto
out
;
}
if
(
strcmp
(
v3
,
LIMIT_STACK
))
{
fprintf
(
stderr
,
"%d: lxc.limit returned wrong value: %d %s not %d %s
\n
"
,
__LINE__
,
ret
,
v3
,
(
int
)
sizeof
(
LIMIT_STACK
)
-
1
,
LIMIT_STACK
);
goto
out
;
}
printf
(
"lxc.limit returned %d %s
\n
"
,
ret
,
v3
);
if
(
!
c
->
set_config_item
(
c
,
"lxc.aa_profile"
,
"unconfined"
))
{
fprintf
(
stderr
,
"%d: failed to set aa_profile
\n
"
,
__LINE__
);
goto
out
;
...
...
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