]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: several cleanups for DeferReactivation=
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Jul 2025 00:51:55 +0000 (09:51 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 30 Jul 2025 14:37:18 +0000 (15:37 +0100)
commit922885e0a5b729a3faaba35676b37013f323d309
tree812793911b14c9fcdf6e303813d0e273abea6891
parente7feab79bcdf346cb85b8bff2369d1c8d9b27f0d
test: several cleanups for DeferReactivation=

- move to TEST-07-PID1, as it is a timer setting,
- rename the timer and service, to emphasize they are for testing
  DeferReactivation=,
- use timeout command to wait for the timer being triggered several times,
- stop the timer when not necessary,
- accept 9 seconds as delta, as there are fluctuations.

Fixes the following failure:
```
TEST-74-AUX-UTILS.sh[422]: + last=
TEST-74-AUX-UTILS.sh[422]: + read -r time
TEST-74-AUX-UTILS.sh[422]: + '[' -n '' ']'
TEST-74-AUX-UTILS.sh[422]: + last=1753779616
TEST-74-AUX-UTILS.sh[422]: + read -r time
TEST-74-AUX-UTILS.sh[422]: + '[' -n 1753779616 ']'
TEST-74-AUX-UTILS.sh[422]: + delta=9
TEST-74-AUX-UTILS.sh[422]: + '[' 9 -lt 10 ']'
TEST-74-AUX-UTILS.sh[422]: + echo 'Timer fired too early: 9 < 10'
```

Fixes #38403.
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/defer-reactivation.service [new file with mode: 0644]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/defer-reactivation.timer [new file with mode: 0644]
test/integration-tests/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.service [deleted file]
test/integration-tests/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.timer [deleted file]
test/meson.build
test/units/TEST-07-PID1.DeferReactivation.sh [new file with mode: 0755]
test/units/TEST-74-AUX-UTILS.defer_reactivation.sh [deleted file]