]> git.ipfire.org Git - thirdparty/systemd.git/commit
timer: add unit tests for DeferReactivation 34591/head
authorMatteo Croce <teknoraver@meta.com>
Fri, 4 Oct 2024 23:39:37 +0000 (01:39 +0200)
committerMatteo Croce <teknoraver@meta.com>
Fri, 11 Oct 2024 20:54:16 +0000 (22:54 +0200)
commit9784ed760eebbc12407c919d787e9bb1fa7fbc62
tree93e3dc025c9005b052ac84ca0550161034b3d1ee
parentcc0ab8c81031fae2b28e66f52972473875931278
timer: add unit tests for DeferReactivation

Create a unit test for systemd timer DeferReactivation config option.
The test works by creating a timer which fires every 5 seconds and
starts an unit which runs for 5 seconds.
With DeferReactivation=true, the timer must fire every 5+5 seconds,
instead of the 5 it fires normally.

As we need at least two timer runs to check if the delta is correct,
the test duration on success will be at least 20 seconds.
To be safe, the test script waits 35 seconds: this is enough to get
at least three runs but low enough to avoid clogging the CI.
test/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.service [new file with mode: 0644]
test/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.timer [new file with mode: 0644]
test/TEST-74-AUX-UTILS/meson.build
test/units/TEST-74-AUX-UTILS.defer_reactivation.sh [new file with mode: 0755]