t9604: Fix test for musl libc and new Debian

CST6CDT and the like are POSIX timezone, with no rule for transition. And POSIX doesn't enforce how to interpret the rule if it's omitted. Some libc (e.g. glibc) resorted back to IANA (formerly Olson) db rules for those timezones. Some libc (e.g. FreeBSD) uses a fixed rule. Other libc (e.g. musl) interpret that as no transition at all [1]. In addition, distributions (notoriously Debian-derived, which uses IANA db for CST6CDT and the like) started to split "legacy" timezones like CST6CDT, EST5EDT into `tzdata-legacy', which will not be installed by default [2]. In those cases, t9604 will run into failure. Let's switch to POSIX timezone with rules to change timezone. 1: http://mm.icann.org/pipermail/tz/2024-March/058751.html 2: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1043250 Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Đoàn Trần Công Danh committed Apr 10, 2024 at 10:28 UTC 03e84cca5d66083878901934711d3f1a56c41dbc
1 file changed +23 -6
t/t9604-cvsimport-timestamps.sh
+23 -6
@@ -3,11 +3,28 @@
3 test_description='git cvsimport timestamps'
4 . ./lib-cvs.sh
5
6 +test_lazy_prereq POSIX_TIMEZONE '
7 + local tz=XST-1XDT,M3.5.0,M11.1.0
8 + echo "1711846799 -> 2024-03-31 01:59:59 +0100" >expected &&
9 + TZ="$tz" test-tool date show:iso-local 1711846799 >actual &&
10 + test_cmp expected actual &&
11 + echo "1711846800 -> 2024-03-31 03:00:00 +0200" >expected &&
12 + TZ="$tz" test-tool date show:iso-local 1711846800 >actual &&
13 + test_cmp expected actual &&
14 + echo "1730591999 -> 2024-11-03 01:59:59 +0200" >expected &&
15 + TZ="$tz" test-tool date show:iso-local 1730591999 >actual &&
16 + test_cmp expected actual &&
17 + echo "1730592000 -> 2024-11-03 01:00:00 +0100" >expected &&
18 + TZ="$tz" test-tool date show:iso-local 1730592000 >actual &&
19 + test_cmp expected actual
20 +'
21 +
22 setup_cvs_test_repository t9604
23
8 -test_expect_success PERL 'check timestamps are UTC (TZ=CST6CDT)' '
24 +test_expect_success PERL,POSIX_TIMEZONE 'check timestamps are UTC' '
25
10 - TZ=CST6CDT git cvsimport -p"-x" -C module-1 module &&
26 + TZ=CST6CDT,M4.1.0,M10.5.0 \
27 + git cvsimport -p"-x" -C module-1 module &&
28 git cvsimport -p"-x" -C module-1 module &&
29 (
30 cd module-1 &&
@@ -34,13 +51,13 @@ test_expect_success PERL 'check timestamps are UTC (TZ=CST6CDT)' '
51 test_cmp expect-1 actual-1
52 '
53
37 -test_expect_success PERL 'check timestamps with author-specific timezones' '
54 +test_expect_success PERL,POSIX_TIMEZONE 'check timestamps with author-specific timezones' '
55
56 cat >cvs-authors <<-EOF &&
57 user1=User One <user1@domain.org>
41 - user2=User Two <user2@domain.org> CST6CDT
42 - user3=User Three <user3@domain.org> EST5EDT
43 - user4=User Four <user4@domain.org> MST7MDT
58 + user2=User Two <user2@domain.org> CST6CDT,M4.1.0,M10.5.0
59 + user3=User Three <user3@domain.org> EST5EDT,M4.1.0,M10.5.0
60 + user4=User Four <user4@domain.org> MST7MDT,M4.1.0,M10.5.0
61 EOF
62 git cvsimport -p"-x" -A cvs-authors -C module-2 module &&
63 (