ref:bbd3e590660cd6035bdf6e83bf285f8b73ac5671

ci: run the user unit check in containers without a login session

systemd-analyze --user verify needs XDG_RUNTIME_DIR and notes the missing system bus; neither is about the unit. Found in the first Anvil run, where the builds, unit tests and lint passed. Refs #9 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPNw4PCgkEfhyCjQT19wsb
SHA: bbd3e590660cd6035bdf6e83bf285f8b73ac5671
Author: Cole Christensen <cole.christensen@gmail.com>
Date: 2026-09-13 11:41
Parents: 6839697
2 files changed +8 -0
Type
scripts/ci/anvil-test.sh +6 −0
@@ -103,5 +103,11 @@
cmd_packaging() {
section "packaging tests"
# systemd-analyze --user verify needs a user runtime directory, which a CI container (root, no login session) lacks
if [[ -z "${XDG_RUNTIME_DIR:-}" ]]; then
XDG_RUNTIME_DIR="$(mktemp -d)"
chmod 700 "${XDG_RUNTIME_DIR}"
export XDG_RUNTIME_DIR
fi
SUNSHINE_QEMU_PKG_REQUIRE_TOOLS=1 bash tests/packaging/linux/qemu/test_sunshine_qemu.sh
}
tests/packaging/linux/qemu/test_sunshine_qemu.sh +2 −0
@@ -64,5 +64,7 @@
local output status
output="$(systemd-analyze ${mode:+"${mode}"} verify "${dir}/${name/@/@${instance}}" 2>&1)"
status=$?
# without a system bus (a CI container) --user verify says so; that is about the host, not the unit
output="$(printf '%s\n' "${output}" | grep -v '^Failed to connect to system bus: ' || true)"
[[ ${status} == 0 && -z "${output}" ]] || fail "systemd-analyze ${mode} verify ${name} (exit ${status}): ${output}"
}