Skip to contentSkip to conversation

tests: shell: Run tests with a fixed TZ

PATCH Applied Phil Sutter 1 participant 2 messages Jun 18 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 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.

---
 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(-)
tests/shell/helpers/test-wrapper.sh +1 -0
index cef38a59b776c..7a73e531f7e42 100755
@@ -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
 
tests/shell/testcases/parsing/dumps/exclusive_start_cond.json-nft +1 -1
index b0fffef2d2a33..a1fbaafd1aa13 100644
@@ -1730,7 +1730,7 @@
                   "key": "time"
                 }
               },
-              "right": "1970-01-01 01:00:00"
+              "right": "1970-01-01 02:00:00"
             }
           }
         ]
tests/shell/testcases/parsing/dumps/exclusive_start_cond.nft +1 -1
index 5cd2d1b3c576e..2b94feaa77d8e 100644
@@ -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
Signature · 1 line
2.54.0
author reviewer Applied
#1 lore raw
Quoted 7 lines · Phil Sutter

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.

Applied.