1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00
systemd/test/units
Frantisek Sumsal 5384e84c46 test: wait until the unit leaves the 'inactive' state as well
In many CI runs I noticed a race where we check the "active" state a bit
too early where the unit is still in the "inactive" state, causing the
`is-failed` check to fail. Mitigate this by waiting even if the unit is
in the inactive state and introduce a "safe net" which checks whether
the unit is not restarting indefinitely or more than it should (as
described in the original issue #3166).

Example:
```
[    5.757784] testsuite-11.sh[216]: + systemctl --no-block start fail-on-restart.service
[    5.853657] testsuite-11.sh[222]: ++ systemctl show --value --property ActiveState fail-on-restart.service
[    5.946044] testsuite-11.sh[216]: + active_state=inactive
[    5.946044] testsuite-11.sh[216]: + [[ inactive == \a\c\t\i\v\a\t\i\n\g ]]
[    5.946044] testsuite-11.sh[216]: + [[ inactive == \a\c\t\i\v\e ]]
[    5.946044] testsuite-11.sh[216]: + systemctl is-failed fail-on-restart.service
[    5.946816] systemd[1]: fail-on-restart.service: Passing 0 fds to service
[    5.946913] systemd[1]: fail-on-restart.service: About to execute false
[    5.947011] systemd[1]: fail-on-restart.service: Forked false as 228
[    5.947093] systemd[1]: fail-on-restart.service: Changed dead -> start
[    5.947172] systemd[1]: Starting Fail on restart...
[    5.947272] systemd[228]: fail-on-restart.service: Executing: false
[    5.960553] testsuite-11.sh[227]: activating
[    5.965188] testsuite-11.sh[216]: + exit 1
[    6.011838] systemd[1]: Received SIGCHLD from PID 228 (4).
[    6.012510] systemd[1]: fail-on-restart.service: Main process exited, code=exited, status=1/FAILURE
[    6.012638] systemd[1]: fail-on-restart.service: Failed with result 'exit-code'.
[    6.012834] systemd[1]: fail-on-restart.service: Service will restart (restart setting)
[    6.012963] systemd[1]: fail-on-restart.service: Changed running -> failed
[    6.013081] systemd[1]: fail-on-restart.service: Unit entered failed state.
```
2021-06-18 13:46:29 +09:00
..
loopy.service.d
unit-.service.d
unit-with-.service.d
unit-with-multiple-.service.d
unit-with-multiple-dashes.service.d
a-conj.service
a.service
autorelabel.service test/TEST-06: make autorelabel.service a static file too 2020-03-28 11:46:47 +01:00
b.service
basic.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
c.service
d.service
daughter.service
dml-discard-empty.service
dml-discard-set-ml.service
dml-discard.slice
dml-override-empty.service
dml-override.slice
dml-passthrough-empty.service
dml-passthrough-set-dml.service
dml-passthrough-set-ml.service
dml-passthrough.slice
dml.slice
e.service
end.service test: move TEST-01-BASIC setup to static files 2020-03-28 11:46:47 +01:00
f.service
g.service
grandchild.service
h.service
hello-after-sleep.target
hello.service
i.service
loopy2.service
loopy3.service
loopy4.service
loopy.service
nomem.slice
nomemleaf.service
parent-deep.slice
parent.slice
sched_idle_bad.service
sched_idle_ok.service
sched_rr_bad.service
sched_rr_change.service
sched_rr_ok.service
shutdown.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
sleep.service
sockets.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
son.service
sysinit.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
testsuite-01.service test: explicitly pull resolved/networkd in TEST-01-BASIC 2021-04-30 22:21:29 +02:00
testsuite-02.service test: switch TEST-02-CRYPTSETUP and TEST-24-UNITTESTS 2020-09-24 17:02:20 +02:00
testsuite-02.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-03.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-03.sh test: tidy up arithmetic expressions 2021-04-13 12:08:01 +02:00
testsuite-04.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-04.sh test: add a testcase for issue #19895 2021-06-15 23:18:06 +01:00
testsuite-05.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-05.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-06.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-06.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-07.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-07.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-08.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-09.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-10.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-11.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-11.sh test: wait until the unit leaves the 'inactive' state as well 2021-06-18 13:46:29 +09:00
testsuite-12.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-12.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-13.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-13.sh test: use arrays to make things a bit cleaner 2021-04-13 13:20:22 +02:00
testsuite-14.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-14.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-15.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-15.sh TEST-15: add test for template aliases 2021-05-04 17:59:34 +02:00
testsuite-16.service tests: replace the few remaining Type=simple with Type=exec 2020-10-22 11:05:17 +02:00
testsuite-16.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-17.01.sh test: generate debugging logs for udev tests 2021-04-30 19:42:09 +09:00
testsuite-17.02.sh test: generate debugging logs for udev tests 2021-04-30 19:42:09 +09:00
testsuite-17.03.sh test: generate debugging logs for udev tests 2021-04-30 19:42:09 +09:00
testsuite-17.04.sh test: generate debugging logs for udev tests 2021-04-30 19:42:09 +09:00
testsuite-17.05.sh TEST-*: use spacing before redirection operator, but not after 2021-04-08 20:21:50 +02:00
testsuite-17.06.sh test: add a simple test for udev watch 2021-04-30 19:42:09 +09:00
testsuite-17.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-17.sh test: run udev tests after currently queued events are finished 2021-04-30 19:42:09 +09:00
testsuite-18.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-18.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-19.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-19.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-20.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-20.sh test: replace the obsolete `` syntax with $() 2021-04-13 12:08:01 +02:00
testsuite-22.01.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-22.02.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-22.03.sh test: use an explicit no-op for file truncation 2021-04-13 12:08:01 +02:00
testsuite-22.04.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-22.05.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-22.06.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-22.07.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-22.08.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-22.09.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-22.10.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-22.11.sh TEST-22-TMPFILES: add reproducer for bug with X 2021-04-08 11:01:29 +02:00
testsuite-22.12.sh tmpfiles: extend "Age" to accept an "age-by" argument 2021-06-08 18:24:58 +02:00
testsuite-22.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-22.sh test: use an explicit no-op for file truncation 2021-04-13 12:08:01 +02:00
testsuite-23.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-23.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-24.service test: switch TEST-02-CRYPTSETUP and TEST-24-UNITTESTS 2020-09-24 17:02:20 +02:00
testsuite-25.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-25.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-26.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-26.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-27.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-27.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-28.service test/TEST-28: avoid race in handling of /testok 2020-03-28 11:51:29 +01:00
testsuite-29.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-29.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-30.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-30.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-31.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-31.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-32.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-32.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-33.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-33.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-34.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-34.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-36.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-36.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-37.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-37.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-38-sleep.service test: add test for cgroup v2 freezer support 2020-04-30 19:02:55 +02:00
testsuite-38.service test: add test for cgroup v2 freezer support 2020-04-30 19:02:55 +02:00
testsuite-38.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-39.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-39.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-40.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-40.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-41.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-41.sh test: tidy up arithmetic expressions 2021-04-13 12:08:01 +02:00
testsuite-42.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-42.sh test: add a test case for #19920 2021-06-15 03:06:09 +09:00
testsuite-43.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-43.sh test: bunch of assorted tweaks to make shellcheck happy 2021-04-13 19:14:35 +02:00
testsuite-44.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-44.sh test: use systemd-run --wait in TEST-44-LOG-NAMESPACE 2021-04-15 08:16:19 +02:00
testsuite-46.service units: make systemd-homed.service installable 2020-03-31 14:55:14 +02:00
testsuite-46.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-47-repro.service test: move TEST-47-* to static files 2020-03-28 11:50:53 +01:00
testsuite-47-repro.sh TEST-*: use spacing before redirection operator, but not after 2021-04-08 20:21:50 +02:00
testsuite-47.service test: make sure to reset state before starting integration tests 2020-03-28 11:51:27 +01:00
testsuite-47.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-48.service core: reload cache if it's dirty when starting a UNIT_NOT_FOUND unit 2020-05-30 16:50:05 +02:00
testsuite-48.sh tests: use "H" as the hostname 2021-05-05 11:04:59 +02:00
testsuite-49-namespaced.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-49-non-namespaced.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-49.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-49.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-50.service dissect: support single-filesystem verity images with external verity hash 2020-06-09 12:19:21 +01:00
testsuite-50.sh Merge pull request #19391 from poettering/dissect-grow 2021-05-07 15:04:55 +02:00
testsuite-51-repro-1.service core: don't consider SERVICE_SKIP_CONDITION for abnormal or failure restarts 2020-06-10 17:12:55 +02:00
testsuite-51-repro-2.service core: don't consider SERVICE_SKIP_CONDITION for abnormal or failure restarts 2020-06-10 17:12:55 +02:00
testsuite-51.service core: don't consider SERVICE_SKIP_CONDITION for abnormal or failure restarts 2020-06-10 17:12:55 +02:00
testsuite-51.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-52.service test: reorganize the TEST-52 a bit 2021-04-26 19:24:47 +02:00
testsuite-52.sh test: reorganize the TEST-52 a bit 2021-04-26 19:24:47 +02:00
testsuite-53.service timer: Adjust calendar timers based on monotonic timer instead of realtime 2020-07-15 09:23:09 +02:00
testsuite-53.sh test: use an explicit no-op for file truncation 2021-04-13 12:08:01 +02:00
testsuite-54.service test: add test suite for new credentials logic 2020-08-25 19:46:36 +02:00
testsuite-54.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-55-slowgrowth.sh test: configure swap for TEST-55-OOMD 2021-04-23 14:36:14 +02:00
testsuite-55-testbloat.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-55-testchill.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-55-testmunch.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-55-workload.slice test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-55.service test: merge udev tests 2021-03-05 18:36:04 +09:00
testsuite-55.sh test: use quotes where necessary 2021-04-13 12:08:01 +02:00
testsuite-56.service Introduce ExitType 2021-03-31 10:26:07 +02:00
testsuite-56.sh test: use set -eux and set -o pipefail everywhere 2021-04-13 12:08:01 +02:00
testsuite-57-binds-to.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-bound-by.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-fail.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-prop-stop-one.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-prop-stop-two.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-short-lived.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-short-lived.sh test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-success.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57-uphold.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57.service test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-57.sh test: add test for OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= 2021-05-25 16:06:30 +02:00
testsuite-58.service TEST-58: execute the right test 2021-04-23 15:11:38 +02:00
testsuite-58.sh test: fix partition check in TEST-58-REPART 2021-05-07 21:17:22 +02:00
testsuite-59.service test: add a test to cover restarting services in reloading state 2021-04-22 09:33:37 +01:00
testsuite-59.sh test: add a test to cover restarting services in reloading state 2021-04-22 09:33:37 +01:00
testsuite-60.service test: add extended test for triggering mount rate limit 2021-06-09 12:04:56 -07:00
testsuite-60.sh test: add extended test for triggering mount rate limit 2021-06-09 12:04:56 -07:00
testsuite.target
timers.target license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
unit-with-multiple-dashes.service
unstoppable.service