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
7d013ccc
Unverified
Commit
7d013ccc
authored
Feb 02, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: support pure unified cgroup layouts in cgpath test
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
a4f24357
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
cgpath.c
src/tests/cgpath.c
+7
-7
No files found.
src/tests/cgpath.c
View file @
7d013ccc
...
@@ -104,33 +104,33 @@ static int test_running_container(const char *lxcpath, const char *name)
...
@@ -104,33 +104,33 @@ static int test_running_container(const char *lxcpath, const char *name)
goto
err3
;
goto
err3
;
/* test get/set value using memory.soft_limit_in_bytes file */
/* test get/set value using memory.soft_limit_in_bytes file */
ret
=
cgroup_ops
->
get
(
cgroup_ops
,
"
memory.soft_limit_in_bytes"
,
value
,
ret
=
cgroup_ops
->
get
(
cgroup_ops
,
"
pids.max"
,
value
,
sizeof
(
value
)
,
sizeof
(
value
),
c
->
name
,
c
->
config_path
);
c
->
name
,
c
->
config_path
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
TSTERR
(
"cgroup_get failed"
);
TSTERR
(
"cgroup_get failed"
);
goto
err3
;
goto
err3
;
}
}
(
void
)
strlcpy
(
value_save
,
value
,
NAME_MAX
);
(
void
)
strlcpy
(
value_save
,
value
,
NAME_MAX
);
ret
=
cgroup_ops
->
set
(
cgroup_ops
,
"
memory.soft_limit_in_bytes"
,
"512M
"
,
ret
=
cgroup_ops
->
set
(
cgroup_ops
,
"
pids.max"
,
"10000
"
,
c
->
name
,
c
->
config_path
);
c
->
name
,
c
->
config_path
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
TSTERR
(
"cgroup_set failed %d %d"
,
ret
,
errno
);
TSTERR
(
"cgroup_set failed %d %d"
,
ret
,
errno
);
goto
err3
;
goto
err3
;
}
}
ret
=
cgroup_ops
->
get
(
cgroup_ops
,
"
memory.soft_limit_in_bytes
"
,
value
,
ret
=
cgroup_ops
->
get
(
cgroup_ops
,
"
pids.max
"
,
value
,
sizeof
(
value
),
c
->
name
,
c
->
config_path
);
sizeof
(
value
),
c
->
name
,
c
->
config_path
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
TSTERR
(
"cgroup_get failed"
);
TSTERR
(
"cgroup_get failed"
);
goto
err3
;
goto
err3
;
}
}
if
(
strcmp
(
value
,
"
536870912
\n
"
))
{
if
(
strcmp
(
value
,
"
10000
\n
"
))
{
TSTERR
(
"cgroup_set_bypath failed to set value >%s<"
,
value
);
TSTERR
(
"cgroup_set_bypath failed to set value >%s<"
,
value
);
goto
err3
;
goto
err3
;
}
}
/* restore original value */
/* restore original value */
ret
=
cgroup_ops
->
set
(
cgroup_ops
,
"
memory.soft_limit_in_bytes
"
,
ret
=
cgroup_ops
->
set
(
cgroup_ops
,
"
pids.max
"
,
value_save
,
c
->
name
,
c
->
config_path
);
value_save
,
c
->
name
,
c
->
config_path
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
TSTERR
(
"cgroup_set failed"
);
TSTERR
(
"cgroup_set failed"
);
...
...
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