From 77f88042e6a86f9ed37ac516fd10ebfcb3ff8f4c Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 13 Oct 2025 17:35:02 +0200 Subject: [PATCH] test: format the min/max timestamps in "systemd" style Before: Next elapse timestamp should be Sun Oct 12 00:10:00 UTC 2025 <= Sun 2025-10-12 05:43:04 UTC <= Sun Oct 12 22:10:00 UTC After: Next elapse timestamp should be Tue 2025-10-14 00:10:00 CEST <= Tue 2025-10-14 19:39:11 CEST <= Tue 2025-10-14 22:10:00 CEST (cherry picked from commit 62ca845ac776d5877fe46dab52692053df6c8efa) --- test/units/TEST-53-TIMER.RandomizedDelaySec-reload.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/units/TEST-53-TIMER.RandomizedDelaySec-reload.sh b/test/units/TEST-53-TIMER.RandomizedDelaySec-reload.sh index 08f4f469d64..eede7ae7c59 100755 --- a/test/units/TEST-53-TIMER.RandomizedDelaySec-reload.sh +++ b/test/units/TEST-53-TIMER.RandomizedDelaySec-reload.sh @@ -15,11 +15,11 @@ set -o pipefail . "$(dirname "$0")"/util.sh UNIT_NAME="timer-RandomizedDelaySec-$RANDOM" -TARGET_TS="$(date --date="tomorrow 00:10")" +TARGET_TS="$(date --date="tomorrow 00:10" "+%a %Y-%m-%d %H:%M:%S %Z")" TARGET_TS_S="$(date --date="$TARGET_TS" "+%s")" # Maximum possible next elapse timestamp: $TARGET_TS (OnCalendar=) + 22 hours (RandomizedDelaySec=) MAX_NEXT_ELAPSE_REALTIME_S="$((TARGET_TS_S + 22 * 60 * 60))" -MAX_NEXT_ELAPSE_REALTIME="$(date --date="@$MAX_NEXT_ELAPSE_REALTIME_S")" +MAX_NEXT_ELAPSE_REALTIME="$(date --date="@$MAX_NEXT_ELAPSE_REALTIME_S" "+%a %Y-%m-%d %H:%M:%S %Z")" # Let's make sure to return the date & time back to the original state once we're done with our time # shenigans. One way to do this would be to use hwclock, but the RTC in VMs can be unreliable or slow to -- 2.47.3