From: Christian Brauner Date: Tue, 2 Feb 2021 22:52:18 +0000 (+0100) Subject: tests: support pure unified cgroup layouts in cgpath test X-Git-Tag: lxc-5.0.0~305^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d013cccf9784d69ea3a40b75f2c95979e517e3a;p=thirdparty%2Flxc.git tests: support pure unified cgroup layouts in cgpath test Signed-off-by: Christian Brauner --- diff --git a/src/tests/cgpath.c b/src/tests/cgpath.c index 899f82664..0072cfc9c 100644 --- a/src/tests/cgpath.c +++ b/src/tests/cgpath.c @@ -104,33 +104,33 @@ static int test_running_container(const char *lxcpath, const char *name) goto err3; /* test get/set value using memory.soft_limit_in_bytes file */ - ret = cgroup_ops->get(cgroup_ops, "memory.soft_limit_in_bytes", value, - sizeof(value), c->name, c->config_path); - if (ret < 0) { + ret = cgroup_ops->get(cgroup_ops, "pids.max", value, sizeof(value), + c->name, c->config_path); + if (ret < 0) { TSTERR("cgroup_get failed"); goto err3; } (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); if (ret < 0) { TSTERR("cgroup_set failed %d %d", ret, errno); 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); if (ret < 0) { TSTERR("cgroup_get failed"); goto err3; } - if (strcmp(value, "536870912\n")) { + if (strcmp(value, "10000\n")) { TSTERR("cgroup_set_bypath failed to set value >%s<", value); goto err3; } /* 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); if (ret < 0) { TSTERR("cgroup_set failed");