From 8d0cdb54eeb27e1eeabec75e8a9cd673f3679f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 30 Jul 2019 21:08:40 +0200 Subject: [PATCH] Do not use legacy time zone names "PST8PDT" is a legacy time zone name whose use in modern code is discouraged. It so happens that using this time zone with musl libc time functions results in different output than for other libc implementations, which breaks the lib/isc/tests/time_test unit test. Use the "America/Los_Angeles" time zone instead in order to get consistent output across all tested libc implementations. (cherry picked from commit f4daf6e0e7d4f347242392fbf3d585707c831b5a) --- lib/isc/tests/time_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/isc/tests/time_test.c b/lib/isc/tests/time_test.c index 101bb57fbc..05f8f531c6 100644 --- a/lib/isc/tests/time_test.c +++ b/lib/isc/tests/time_test.c @@ -38,7 +38,7 @@ isc_time_parsehttptimestamp_test(void **state) { UNUSED(state); - setenv("TZ", "PST8PDT", 1); + setenv("TZ", "America/Los_Angeles", 1); result = isc_time_now(&t); assert_int_equal(result, ISC_R_SUCCESS); @@ -57,7 +57,7 @@ isc_time_formatISO8601_test(void **state) { UNUSED(state); - setenv("TZ", "PST8PDT", 1); + setenv("TZ", "America/Los_Angeles", 1); result = isc_time_now(&t); assert_int_equal(result, ISC_R_SUCCESS); @@ -93,7 +93,7 @@ isc_time_formatISO8601ms_test(void **state) { UNUSED(state); - setenv("TZ", "PST8PDT", 1); + setenv("TZ", "America/Los_Angeles", 1); result = isc_time_now(&t); assert_int_equal(result, ISC_R_SUCCESS); @@ -130,7 +130,7 @@ isc_time_formatISO8601L_test(void **state) { UNUSED(state); - setenv("TZ", "PST8PDT", 1); + setenv("TZ", "America/Los_Angeles", 1); result = isc_time_now(&t); assert_int_equal(result, ISC_R_SUCCESS); @@ -165,7 +165,7 @@ isc_time_formatISO8601Lms_test(void **state) { UNUSED(state); - setenv("TZ", "PST8PDT", 1); + setenv("TZ", "America/Los_Angeles", 1); result = isc_time_now(&t); assert_int_equal(result, ISC_R_SUCCESS); @@ -201,7 +201,7 @@ isc_time_formatshorttimestamp_test(void **state) { UNUSED(state); - setenv("TZ", "PST8PDT", 1); + setenv("TZ", "America/Los_Angeles", 1); result = isc_time_now(&t); assert_int_equal(result, ISC_R_SUCCESS);