test-condition: drop cgroup version check

After f74ca66e68, we do not check the
cgroup version of the runtime environment, and unconditionally returns 0
for "v1", and 1 for "v2".
This commit is contained in:
Yu Watanabe
2025-04-14 20:33:08 +09:00
committed by Luca Boccassi
parent cc983fc9dc
commit 6d203bd830

View File

@@ -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);
}