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 <alexandre.fiset@softathome.com>
This commit is contained in:
Alexandre Fiset 2025-10-07 00:07:21 +02:00 committed by Matthias Franck
parent 6711bb6875
commit 9ec0abe31e

View File

@ -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