From: Daan De Meyer Date: Mon, 25 May 2026 21:37:02 +0000 (+0000) Subject: test-pressure: Fix checks X-Git-Tag: v261-rc2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e098b57810d18520bb7ab7ca8c0c2e7f253184f0;p=thirdparty%2Fsystemd.git test-pressure: Fix checks Follow up for 7e250f70 --- diff --git a/src/test/test-pressure.c b/src/test/test-pressure.c index 6bdae6c19bd..7e89032545e 100644 --- a/src/test/test-pressure.c +++ b/src/test/test-pressure.c @@ -166,14 +166,15 @@ TEST(fake_io_pressure) { /* Shared infrastructure for real pressure tests */ -static int controller_supported_on_unit(sd_bus *bus, const char *unit_path, CGroupMask controller) { +static int controller_supported_on_unit(sd_bus *bus, const char *unit_name, const char *unit_path, CGroupMask controller) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_free_ char *cg = NULL; CGroupMask mask; int r; r = sd_bus_get_property_string(bus, "org.freedesktop.systemd1", unit_path, - "org.freedesktop.systemd1.Unit", "ControlGroup", &error, &cg); + unit_dbus_interface_from_name(unit_name), "ControlGroup", + &error, &cg); if (r < 0) return log_notice_errno(r, "Failed to read ControlGroup property: %s", bus_error_message(&error, r)); @@ -291,7 +292,7 @@ TEST(real_memory_pressure) { ASSERT_OK(bus_wait_for_jobs_one(w, object, /* flags= */ BUS_WAIT_JOBS_LOG_ERROR, /* extra_args= */ NULL)); _cleanup_free_ char *uo = ASSERT_NOT_NULL(unit_dbus_path_from_name(scope)); - r = controller_supported_on_unit(bus, uo, CGROUP_MASK_MEMORY); + r = controller_supported_on_unit(bus, scope, uo, CGROUP_MASK_MEMORY); if (r <= 0) return (void) log_tests_skipped("Memory controller not available on scope"); @@ -434,7 +435,7 @@ TEST(real_cpu_pressure) { ASSERT_OK(bus_wait_for_jobs_one(w, object, /* flags= */ BUS_WAIT_JOBS_LOG_ERROR, /* extra_args= */ NULL)); _cleanup_free_ char *uo = ASSERT_NOT_NULL(unit_dbus_path_from_name(scope)); - r = controller_supported_on_unit(bus, uo, CGROUP_MASK_CPU); + r = controller_supported_on_unit(bus, scope, uo, CGROUP_MASK_CPU); if (r <= 0) return (void) log_tests_skipped("CPU controller not available on scope"); @@ -568,7 +569,7 @@ TEST(real_io_pressure) { ASSERT_OK(bus_wait_for_jobs_one(w, object, /* flags= */ BUS_WAIT_JOBS_LOG_ERROR, /* extra_args= */ NULL)); _cleanup_free_ char *uo = ASSERT_NOT_NULL(unit_dbus_path_from_name(scope)); - r = controller_supported_on_unit(bus, uo, CGROUP_MASK_IO); + r = controller_supported_on_unit(bus, scope, uo, CGROUP_MASK_IO); if (r <= 0) return (void) log_tests_skipped("IO controller not available on scope");