812f6f
From dca9eea70cb33062905aefc389266da931e9d0d6 Mon Sep 17 00:00:00 2001
812f6f
From: Petr Mensik <pemensik@redhat.com>
812f6f
Date: Thu, 14 Mar 2019 15:48:37 +0100
812f6f
Subject: [PATCH] Set TZ again before dns library is initialized
812f6f
812f6f
PKCS11 uses it, initializes TZ offset from dst init. Setting environment
812f6f
in test is too late since use of cmocka.
812f6f
---
812f6f
 lib/dns/tests/dnstap_test.c | 6 +++---
812f6f
 1 file changed, 3 insertions(+), 3 deletions(-)
812f6f
812f6f
diff --git a/lib/dns/tests/dnstap_test.c b/lib/dns/tests/dnstap_test.c
812f6f
index 22d6dc3..5a60b12 100644
812f6f
--- a/lib/dns/tests/dnstap_test.c
812f6f
+++ b/lib/dns/tests/dnstap_test.c
812f6f
@@ -309,9 +309,6 @@ totext_test(void **state) {
812f6f
 
812f6f
 	UNUSED(state);
812f6f
 
812f6f
-	/* make sure text conversion gets the right local time */
812f6f
-	setenv("TZ", "PST8", 1);
812f6f
-
812f6f
 	result = dns_dt_open(TAPSAVED, dns_dtmode_file, mctx, &handle);
812f6f
 	assert_int_equal(result, ISC_R_SUCCESS);
812f6f
 
812f6f
@@ -378,6 +375,9 @@ main(void) {
812f6f
 		cmocka_unit_test_setup_teardown(totext_test, _setup, _teardown),
812f6f
 	};
812f6f
 
812f6f
+	/* make sure text conversion gets the right local time */
812f6f
+	setenv("TZ", "PST8", 1);
812f6f
+
812f6f
 	return (cmocka_run_group_tests(tests, dns_test_init, dns_test_final));
812f6f
 #else
812f6f
 	print_message("1..0 # Skip dnstap not enabled\n");
812f6f
-- 
812f6f
2.20.1
812f6f