From 9ec0abe31e8698d8246716d2cc8adfe771325e30 Mon Sep 17 00:00:00 2001 From: Alexandre Fiset Date: Tue, 7 Oct 2025 00:07:21 +0200 Subject: [PATCH] time: 070-time.t: add test for POSIX validation Problem: ======== No POSIX check was done for the Time.LocalTimeZone Solution: ========= Add a check for a random POSIX compatible timezone and a check for non valid POSIX timezone References: PPW-511 Signed-off-by: Alexandre Fiset --- .../acceleration-plan-components/070-time.t | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t b/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t index ed65c60571..6b991ae761 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/070-time.t @@ -141,3 +141,35 @@ Check that CPE provides again NTP to the LAN clients: $ ntpdate -q 192.168.1.1 2>&1 | grep adjust .* adjust time server .* (re) + +Check default timezone: + + $ (R "date +%Z") + GMT + +Check LocalTimeZone correctly filter wrong TZ: + + $ (R "ba-cli Time.LocalTimeZone=\"AKST9AKDT\"") | sed 's|[>,]||g' + Time.LocalTimeZone=AKST9AKDT + Time. + Time.LocalTimeZone="AKST9AKDT" + + $ (R "date +%Z") + AKDT + + $ (R "ba-cli Time.LocalTimeZone=\"NOTAVALIDETZ\"") | sed 's|[>,]||g' + Time.LocalTimeZone=NOTAVALIDETZ + ERROR: set Time.LocalTimeZone failed (10 - invalid value) + + $ (R "date +%Z") + AKDT + +Set back default timezone: + + $ (R "ba-cli Time.LocalTimeZone=\"GMT0\"") | sed 's|[>,]||g' + Time.LocalTimeZone=GMT0 + Time. + Time.LocalTimeZone="GMT0" + + $ (R "date +%Z") + GMT \ No newline at end of file