From: Yu Watanabe Date: Mon, 14 Apr 2025 11:33:08 +0000 (+0900) Subject: test-condition: drop cgroup version check X-Git-Tag: v258-rc1~822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d203bd830de999de48858da069b644f8a8d0938;p=thirdparty%2Fsystemd.git test-condition: drop cgroup version check After f74ca66e6833c340a1532578176e55cb494590d0, we do not check the cgroup version of the runtime environment, and unconditionally returns 0 for "v1", and 1 for "v2". --- diff --git a/src/test/test-condition.c b/src/test/test-condition.c index b02f4cce6da..98418d7ac35 100644 --- a/src/test/test-condition.c +++ b/src/test/test-condition.c @@ -121,19 +121,13 @@ TEST(condition_test_path) { TEST(condition_test_control_group_hierarchy) { Condition *condition; - int r; - - r = cg_unified(); - if (IN_SET(r, -ENOMEDIUM, -ENOENT)) - return (void) log_tests_skipped("cgroupfs is not mounted"); - ASSERT_OK(r); - ASSERT_NOT_NULL((condition = condition_new(CONDITION_CONTROL_GROUP_CONTROLLER, "v1", false, false))); - ASSERT_OK_EQ(condition_test(condition, environ), r < CGROUP_UNIFIED_ALL); + ASSERT_NOT_NULL(condition = condition_new(CONDITION_CONTROL_GROUP_CONTROLLER, "v1", false, false)); + ASSERT_OK_ZERO(condition_test(condition, environ)); condition_free(condition); - ASSERT_NOT_NULL((condition = condition_new(CONDITION_CONTROL_GROUP_CONTROLLER, "v2", false, false))); - ASSERT_OK_EQ(condition_test(condition, environ), r >= CGROUP_UNIFIED_ALL); + ASSERT_NOT_NULL(condition = condition_new(CONDITION_CONTROL_GROUP_CONTROLLER, "v2", false, false)); + ASSERT_OK_POSITIVE(condition_test(condition, environ)); condition_free(condition); }