summaryrefslogtreecommitdiff
path: root/test/system/250-systemd.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/system/250-systemd.bats')
-rw-r--r--test/system/250-systemd.bats7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats
index cdac43c1c..4bee13414 100644
--- a/test/system/250-systemd.bats
+++ b/test/system/250-systemd.bats
@@ -33,6 +33,13 @@ function teardown() {
# This test can fail in dev. environment because of SELinux.
# quick fix: chcon -t container_runtime_exec_t ./bin/podman
@test "podman generate - systemd - basic" {
+ # podman initializes this if unset, but systemctl doesn't
+ if is_rootless; then
+ if [ -z "$XDG_RUNTIME_DIR" ]; then
+ export XDG_RUNTIME_DIR=/run/user/$(id -u)
+ fi
+ fi
+
cname=$(random_string)
run_podman create --name $cname --detach $IMAGE top