diff options
Diffstat (limited to 'src/test/test-cgroup-util.c')
-rw-r--r-- | src/test/test-cgroup-util.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index d49356315e..a3239d73f5 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -14,6 +14,7 @@ #include "string-util.h" #include "strv.h" #include "test-helper.h" +#include "tests.h" #include "user-util.h" #include "util.h" @@ -296,7 +297,7 @@ static void test_shift_path(void) { test_shift_path_one("/foobar/waldo", "/", "/foobar/waldo"); test_shift_path_one("/foobar/waldo", "", "/foobar/waldo"); test_shift_path_one("/foobar/waldo", "/foobar", "/waldo"); - test_shift_path_one("/foobar/waldo", "/fuckfuck", "/foobar/waldo"); + test_shift_path_one("/foobar/waldo", "/hogehoge", "/foobar/waldo"); } static void test_mask_supported(void) { @@ -368,6 +369,17 @@ static void test_is_wanted(void) { "systemd.unified_cgroup_hierarchy=0 " "systemd.legacy_systemd_cgroup_controller=0", 1) >= 0); test_is_wanted_print(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); + test_is_wanted_print(false); + + assert_se(setenv("SYSTEMD_PROC_CMDLINE", + "cgroup_no_v1=all " + "systemd.unified_cgroup_hierarchy=0", 1) >= 0); + test_is_wanted_print(false); } static void test_cg_tests(void) { @@ -447,9 +459,7 @@ static void test_cg_get_keyed_attribute(void) { } int main(void) { - log_set_max_level(LOG_DEBUG); - log_parse_environment(); - log_open(); + test_setup_logging(LOG_DEBUG); test_path_decode_unit(); test_path_get_unit(); |