diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /src/test/test-cgroup-setup.c | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip |
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/test/test-cgroup-setup.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/test/test-cgroup-setup.c b/src/test/test-cgroup-setup.c index e669e9b..8b5d02d 100644 --- a/src/test/test-cgroup-setup.c +++ b/src/test/test-cgroup-setup.c @@ -14,12 +14,10 @@ static void test_is_wanted_print_one(bool header) { _cleanup_free_ char *cmdline = NULL; log_info("-- %s --", __func__); - assert_se(proc_cmdline(&cmdline) >= 0); + ASSERT_OK(proc_cmdline(&cmdline)); log_info("cmdline: %s", cmdline); - if (header) { - log_info("default-hierarchy=" DEFAULT_HIERARCHY_NAME); + if (header) (void) system("findmnt -n /sys/fs/cgroup"); - } log_info("is_unified_wanted() → %s", yes_no(cg_is_unified_wanted())); log_info("is_hybrid_wanted() → %s", yes_no(cg_is_hybrid_wanted())); @@ -33,33 +31,33 @@ TEST(is_wanted_print) { } TEST(is_wanted) { - assert_se(setenv("SYSTEMD_PROC_CMDLINE", - "systemd.unified_cgroup_hierarchy", 1) >= 0); + ASSERT_OK(setenv("SYSTEMD_PROC_CMDLINE", + "systemd.unified_cgroup_hierarchy", 1)); test_is_wanted_print_one(false); - assert_se(setenv("SYSTEMD_PROC_CMDLINE", - "systemd.unified_cgroup_hierarchy=0", 1) >= 0); + ASSERT_OK(setenv("SYSTEMD_PROC_CMDLINE", + "systemd.unified_cgroup_hierarchy=0", 1)); test_is_wanted_print_one(false); - assert_se(setenv("SYSTEMD_PROC_CMDLINE", + ASSERT_OK(setenv("SYSTEMD_PROC_CMDLINE", "systemd.unified_cgroup_hierarchy=0 " - "systemd.legacy_systemd_cgroup_controller", 1) >= 0); + "systemd.legacy_systemd_cgroup_controller", 1)); test_is_wanted_print_one(false); - assert_se(setenv("SYSTEMD_PROC_CMDLINE", + ASSERT_OK(setenv("SYSTEMD_PROC_CMDLINE", "systemd.unified_cgroup_hierarchy=0 " - "systemd.legacy_systemd_cgroup_controller=0", 1) >= 0); + "systemd.legacy_systemd_cgroup_controller=0", 1)); test_is_wanted_print_one(false); /* cgroup_no_v1=all implies unified cgroup hierarchy, unless otherwise * explicitly specified. */ - assert_se(setenv("SYSTEMD_PROC_CMDLINE", - "cgroup_no_v1=all", 1) >= 0); + ASSERT_OK(setenv("SYSTEMD_PROC_CMDLINE", + "cgroup_no_v1=all", 1)); test_is_wanted_print_one(false); - assert_se(setenv("SYSTEMD_PROC_CMDLINE", + ASSERT_OK(setenv("SYSTEMD_PROC_CMDLINE", "cgroup_no_v1=all " - "systemd.unified_cgroup_hierarchy=0", 1) >= 0); + "systemd.unified_cgroup_hierarchy=0", 1)); test_is_wanted_print_one(false); } |