From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [nft PATCH] tests/py: Set a fixed timezone in nft-test.py
Date: Sat, 16 Nov 2019 22:32:18 +0100 [thread overview]
Message-ID: <20191116213218.14698-1-phil@nwl.cc> (raw)
Payload generated for 'meta time' matches depends on host's timezone and
DST setting. To produce constant output, set a fixed timezone in
nft-test.py. Choose UTC-2 since most payloads are correct then, adjust
the remaining two tests.
Fixes: 0518ea3f70d8c ("tests: add meta time test cases")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
tests/py/any/meta.t | 2 +-
tests/py/any/meta.t.payload | 2 +-
tests/py/nft-test.py | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/py/any/meta.t b/tests/py/any/meta.t
index 86e5d258605dc..327f973f1bd5a 100644
--- a/tests/py/any/meta.t
+++ b/tests/py/any/meta.t
@@ -205,7 +205,7 @@ meta random eq 1;ok;meta random 1
meta random gt 1000000;ok;meta random > 1000000
meta time "1970-05-23 21:07:14" drop;ok
-meta time 12341234 drop;ok;meta time "1970-05-23 21:07:14" drop
+meta time 12341234 drop;ok;meta time "1970-05-23 22:07:14" drop
meta time "2019-06-21 17:00:00" drop;ok
meta time "2019-07-01 00:00:00" drop;ok
meta time "2019-07-01 00:01:00" drop;ok
diff --git a/tests/py/any/meta.t.payload b/tests/py/any/meta.t.payload
index 402caae5cad8c..486d7aa566ea3 100644
--- a/tests/py/any/meta.t.payload
+++ b/tests/py/any/meta.t.payload
@@ -1050,7 +1050,7 @@ ip test-ip4 input
# meta time "1970-05-23 21:07:14" drop
ip meta-test input
[ meta load time => reg 1 ]
- [ cmp eq reg 1 0x74a8f400 0x002bd849 ]
+ [ cmp eq reg 1 0x43f05400 0x002bd503 ]
[ immediate reg 0 drop ]
# meta time 12341234 drop
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index ce42b5ddb1cca..6edca3c6a5a2f 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -24,6 +24,7 @@ import tempfile
TESTS_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(TESTS_PATH, '../../py/'))
+os.environ['TZ'] = 'UTC-2'
from nftables import Nftables
--
2.24.0
next reply other threads:[~2019-11-16 21:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-16 21:32 Phil Sutter [this message]
2019-11-18 8:20 ` [nft PATCH] tests/py: Set a fixed timezone in nft-test.py Ander Juaristi
2019-11-18 18:34 ` Pablo Neira Ayuso
2019-11-19 0:20 ` Phil Sutter
2019-11-19 11:06 ` Ander Juaristi
2019-11-19 22:12 ` Pablo Neira Ayuso
2019-11-19 22:20 ` Phil Sutter
2019-11-19 22:33 ` Pablo Neira Ayuso
2019-11-20 11:45 ` Phil Sutter
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=20191116213218.14698-1-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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;
as well as URLs for NNTP newsgroup(s).