From a20aa2e21c0d9e6aaf37566ceac2ea1e0bd0eb87 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 18 Jun 2026 12:41:34 +0200 Subject: [PATCH] tests: shell: Run tests with a fixed TZ Inheriting the system's local TZ is problematic with meta time/hour expressions in dumps. Use UTC-2 since that matches what py test suite is using. While at it, fix up the first two dumps containing such expressions. Signed-off-by: Phil Sutter --- tests/shell/helpers/test-wrapper.sh | 1 + .../shell/testcases/parsing/dumps/exclusive_start_cond.json-nft | 2 +- tests/shell/testcases/parsing/dumps/exclusive_start_cond.nft | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/shell/helpers/test-wrapper.sh b/tests/shell/helpers/test-wrapper.sh index cef38a59..7a73e531 100755 --- a/tests/shell/helpers/test-wrapper.sh +++ b/tests/shell/helpers/test-wrapper.sh @@ -62,6 +62,7 @@ START_TIME="$(cut -d ' ' -f1 /proc/uptime)" export TMPDIR="$NFT_TEST_TESTTMPDIR" export NFT_TEST_LIBRARY_FILE="$NFT_TEST_BASEDIR/helpers/lib.sh" +export TZ='UTC-2' CLEANUP_UMOUNT_VAR_RUN=n diff --git a/tests/shell/testcases/parsing/dumps/exclusive_start_cond.json-nft b/tests/shell/testcases/parsing/dumps/exclusive_start_cond.json-nft index b0fffef2..a1fbaafd 100644 --- a/tests/shell/testcases/parsing/dumps/exclusive_start_cond.json-nft +++ b/tests/shell/testcases/parsing/dumps/exclusive_start_cond.json-nft @@ -1730,7 +1730,7 @@ "key": "time" } }, - "right": "1970-01-01 01:00:00" + "right": "1970-01-01 02:00:00" } } ] diff --git a/tests/shell/testcases/parsing/dumps/exclusive_start_cond.nft b/tests/shell/testcases/parsing/dumps/exclusive_start_cond.nft index 5cd2d1b3..2b94feaa 100644 --- a/tests/shell/testcases/parsing/dumps/exclusive_start_cond.nft +++ b/tests/shell/testcases/parsing/dumps/exclusive_start_cond.nft @@ -73,7 +73,7 @@ table ip t { limit rate 1/second burst 5 packets oifgroup "default" limit rate 1/second burst 5 packets meta cgroup 0 limit rate 1/second burst 5 packets meta ipsec missing - limit rate 1/second burst 5 packets meta time "1970-01-01 01:00:00" + limit rate 1/second burst 5 packets meta time "1970-01-01 02:00:00" limit rate 1/second burst 5 packets meta day "Sunday" limit rate 1/second burst 5 packets meta hour "02:00" limit rate 1/second burst 5 packets socket mark 0x00000000 -- 2.47.3