From d852c58d6c81978c6a109616e2329df1a82b94b1 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 1 Nov 2024 14:05:06 +0100 Subject: [PATCH] test/system: add regression test for TZDIR local issue Regression test for #23550. Setting the TZDIR env should make no difference for the local timezone as this is not a real timezone name that is resolved from that directory. Signed-off-by: Paul Holzinger (cherry picked from commit fb3a0e93a8233a4735e78081f8cb8d3530b3db04) Signed-off-by: Paul Holzinger --- test/system/030-run.bats | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/system/030-run.bats b/test/system/030-run.bats index 597f407be9..e40bd914df 100644 --- a/test/system/030-run.bats +++ b/test/system/030-run.bats @@ -534,6 +534,11 @@ json-file | f expect="$output" TZ=Pacific/Chatham run_podman run --rm --tz=local $IMAGE date -Iseconds -r $testfile is "$output" "$expect" "podman run with --tz=local, matches host" + + # Force a TZDIR env as local should not try to use the TZDIR at all, #23550. + # This used to fail with: stat /usr/share/zoneinfo/local: no such file or directory. + TZDIR=/usr/share/zoneinfo run_podman run --rm --tz=local $IMAGE date -Iseconds -r $testfile + is "$output" "$expect" "podman run with --tz=local ignored TZDIR" } # bats test_tags=ci:parallel