From ea51ae73053436a858a2e894149f0db63c92b2a4 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 28 May 2026 12:56:40 +0200 Subject: [PATCH] test/system: use DISABLE_HC_SYSTEMD for 2 tests The problem is by default we create the systemd timers and run hc in the background. This means any tests who depend on exact hc timing can get broken by this so use the DISABLE_HC_SYSTEMD=true env which makes podman skip creating the systemd timers but still allows you to manually run the commands. Signed-off-by: Paul Holzinger --- test/system/220-healthcheck.bats | 2 ++ test/system/250-systemd.bats | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/system/220-healthcheck.bats b/test/system/220-healthcheck.bats index d5a3d23e5e..200bad33bf 100644 --- a/test/system/220-healthcheck.bats +++ b/test/system/220-healthcheck.bats @@ -429,6 +429,8 @@ function _check_health_log { msg="hc-msg-$(random_string)" hcStatus=$PODMAN_TMPDIR/hcStatus + # Disable systemd healthcheck in the background as they mess up the timings of the manual commands. + export DISABLE_HC_SYSTEMD="true" run_podman run -d --name $ctr \ --health-cmd "touch /tmp/abc; sleep 20; echo $msg" \ $IMAGE /home/podman/pause diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats index 614185dbab..23e3abc1fa 100644 --- a/test/system/250-systemd.bats +++ b/test/system/250-systemd.bats @@ -55,6 +55,7 @@ function mv-safely() { # Helper to start a systemd service running a container function service_setup() { + local extra_args="$1" # January 2024: we can no longer do "run_podman generate systemd" followed # by "echo $output >file", because generate-systemd is deprecated and now # says so loudly, to stderr, with no way to silence it. Since BATS gloms @@ -65,6 +66,7 @@ function service_setup() { run_podman generate systemd --files --name \ -e http_proxy -e https_proxy -e no_proxy \ -e HTTP_PROXY -e HTTPS_PROXY -e NO_PROXY \ + $extra_args \ --new $cname mv-safely "container-$cname.service" $UNIT_FILE ) @@ -359,7 +361,7 @@ LISTEN_FDNAMES=listen_fdnames" | sort) $IMAGE /home/podman/pause # run container in systemd unit - service_setup + service_setup "-e DISABLE_HC_SYSTEMD=true" run_podman container inspect $cname --format "{{.ID}}" oldID="$output"