test: move TEST-11-ISSUE-3166 setup to static files

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-03-28 11:46:47 +01:00
parent 8c6d58f65d
commit 3ac189d8aa
6 changed files with 30 additions and 43 deletions
+6
View File
@@ -0,0 +1,6 @@
[Unit]
Description=TEST-11-ISSUE-3166
[Service]
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -x
systemctl start fail-on-restart.service
active_state=$(systemctl show --value --property ActiveState fail-on-restart.service)
while [[ "$active_state" == "activating" || "$active_state" == "active" ]]; do
sleep 1
active_state=$(systemctl show --value --property ActiveState fail-on-restart.service)
done
systemctl is-failed fail-on-restart.service || exit 1
touch /testok