From d1d7735c30da2bf5696dd0f1573d553259d2fec8 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 9 Jul 2026 17:19:26 +0900 Subject: [PATCH] hack: pass DBUS_SESSION_BUS_ADDRESS to the integration test suite The test suite is executed via "env -i" with an explicit allow-list of environment variables, so DBUS_SESSION_BUS_ADDRESS (exported by .integration-daemon-start in rootless-systemd mode) never reached the test binaries, nor the daemons they spawn via internal/testutil/daemon ("sudo --preserve-env"). Without it, runc inside those daemons cannot detect the systemd user manager ("busctl --user" fails with the per-daemon XDG_RUNTIME_DIR), assumes a rootful systemd, and fails to create the container scope on the system bus: unable to start unit "docker-.scope" ...: Permission denied Also skip TestRunWithAlternativeContainerdShim in rootless-systemd mode: the daemon only passes the SystemdCgroup option to the stock runc runtime, so with an ad-hoc shim name runc falls back to the cgroupfs driver and treats the systemd-style cgroupsPath as a literal path, which cannot be created by a rootless daemon. Co-Authored-By: Claude Fable 5 Signed-off-by: Akihiro Suda --- hack/make/.integration-test-helpers | 1 + integration/container/run_linux_test.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/hack/make/.integration-test-helpers b/hack/make/.integration-test-helpers index 51eb984eb0..ec76810207 100644 --- a/hack/make/.integration-test-helpers +++ b/hack/make/.integration-test-helpers @@ -195,6 +195,7 @@ test_env() { HOME="$ABS_DEST/fake-HOME" go telemetry off env -i \ + DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \ DEST="$ABS_DEST" \ DOCKER_API_VERSION="$DOCKER_API_VERSION" \ DOCKER_BUILDKIT="$DOCKER_BUILDKIT" \ diff --git a/integration/container/run_linux_test.go b/integration/container/run_linux_test.go index 5f8ecf5dc0..d8252e75c2 100644 --- a/integration/container/run_linux_test.go +++ b/integration/container/run_linux_test.go @@ -207,6 +207,11 @@ func TestRunConsoleSize(t *testing.T) { func TestRunWithAlternativeContainerdShim(t *testing.T) { skip.If(t, testEnv.IsRemoteDaemon) skip.If(t, testEnv.DaemonInfo.OSType != "linux") + // The daemon only passes the SystemdCgroup option to the stock runc + // runtime; with an ad-hoc shim name, runc falls back to the cgroupfs + // driver and treats the systemd-style cgroupsPath ("user.slice:docker:ID") + // as a literal path, which cannot be created by a rootless daemon. + skip.If(t, testEnv.IsRootless() && testEnv.DaemonInfo.CgroupDriver == "systemd", "alternative shims do not support the systemd cgroup driver in rootless mode") ctx := testutil.StartSpan(baseContext, t)