test: check the next elapse timer timestamp after deserialization

When deserializing a serialized timer unit with RandomizedDelaySec= set,
systemd should use the last inactive exit timestamp instead of current
realtime to calculate the new next elapse, so the timer unit actually
runs in the given calendar window.

Provides coverage for:
  - https://github.com/systemd/systemd/issues/18678
  - https://github.com/systemd/systemd/pull/27752
This commit is contained in:
Frantisek Sumsal
2025-09-25 12:55:04 +02:00
parent 5730a400fd
commit f4c3c107d9
2 changed files with 106 additions and 0 deletions
+9
View File
@@ -57,6 +57,15 @@ assert_le() {(
fi
)}
assert_ge() {(
set +ex
if [[ "${1:?}" -lt "${2:?}" ]]; then
echo "FAIL: '$1' < '$2'" >&2
exit 1
fi
)}
assert_in() {(
set +ex