summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-08-01 12:48:41 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-09-16 18:06:20 +0200
commitd4d99bc6e4d90da335c62c7a75a2a12e44b428a6 (patch)
treea295cb23628a393f4ea4f41300c1a51721867d4b /src/test
parent5a1c1b534fe13e60ef9bce0dc680ad6f2a0c577f (diff)
downloadsystemd-d4d99bc6e4d90da335c62c7a75a2a12e44b428a6.tar.gz
systemd-d4d99bc6e4d90da335c62c7a75a2a12e44b428a6.tar.bz2
systemd-d4d99bc6e4d90da335c62c7a75a2a12e44b428a6.zip
basic/cgroup-util: let cgroup_unified_flush() return the detected hierarchy
This avoid the use of the global variable. Also rename cgroup_unified_update() to cgroup_unified_cached() and cgroup_unified_flush() to cgroup_unified() to better reflect their new roles.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-cgroup-util.c4
-rw-r--r--src/test/test-condition.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
index b54b5e76c6..f45c5ff760 100644
--- a/src/test/test-cgroup-util.c
+++ b/src/test/test-cgroup-util.c
@@ -385,12 +385,12 @@ static void test_is_wanted(void) {
static void test_cg_tests(void) {
int all, hybrid, systemd, r;
- r = cg_unified_flush();
+ r = cg_unified();
if (r == -ENOMEDIUM) {
log_notice_errno(r, "Skipping cg hierarchy tests: %m");
return;
}
- assert_se(r == 0);
+ assert_se(r >= 0);
all = cg_all_unified();
assert_se(IN_SET(all, 0, 1));
diff --git a/src/test/test-condition.c b/src/test/test-condition.c
index a79263a50b..9a0a4cfee2 100644
--- a/src/test/test-condition.c
+++ b/src/test/test-condition.c
@@ -124,7 +124,7 @@ static void test_condition_test_control_group_controller(void) {
_cleanup_free_ char *controller_name = NULL;
int r;
- r = cg_unified_flush();
+ r = cg_unified();
if (r < 0) {
log_notice_errno(r, "Skipping ConditionControlGroupController tests: %m");
return;