public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api 1/3] tests: test_utils: do not rely on system timezone
Date: Fri,  2 Jan 2026 21:31:59 +0100	[thread overview]
Message-ID: <20260102203253.28218-2-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20260102203253.28218-1-s.ivanov@proxmox.com>

the tests for format_date_header inherently rely on a timezone being
set (as the date-format in mail-headers expects one).

running the test in a build-environment like sbuild, which has the
timezone set to UTC fails.

fix this by explicitly setting the timezone to 'Europe/Vienna'.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/tests/test_utils.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/tests/test_utils.pl b/src/tests/test_utils.pl
index 8abcc8b7..ff856ebe 100755
--- a/src/tests/test_utils.pl
+++ b/src/tests/test_utils.pl
@@ -4,10 +4,13 @@ use strict;
 use warnings;
 
 use Test::More;
-use POSIX qw(setlocale strftime);
+use POSIX qw(setlocale strftime tzset);
 
 use PMG::Utils;
 
+$ENV{TZ} = 'Europe/Vienna';
+tzset();
+
 subtest 'format_date_header works' => sub {
     cmp_ok(length(PMG::Utils::format_date_header(localtime())), '>=', 30);
     is(
-- 
2.47.3



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel

  reply	other threads:[~2026-01-02 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-02 20:31 [pmg-devel] [PATCH pmg-api 0/3] enable building with sbuild, by refactoring tests Stoiko Ivanov
2026-01-02 20:31 ` Stoiko Ivanov [this message]
2026-01-02 20:32 ` [pmg-devel] [PATCH pmg-api 2/3] tests: make test nature explicit Stoiko Ivanov
2026-01-02 20:32 ` [pmg-devel] [PATCH pmg-api 3/3] tests: conditionally skip integration tests Stoiko Ivanov
2026-01-28 16:57 ` applied-series: [pmg-devel] [PATCH pmg-api 0/3] enable building with sbuild, by refactoring tests Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260102203253.28218-2-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal