diff --git a/test/units/testsuite-11.sh b/test/units/testsuite-11.sh index 97ab8be757..d05f609877 100755 --- a/test/units/testsuite-11.sh +++ b/test/units/testsuite-11.sh @@ -4,9 +4,10 @@ set -o pipefail systemctl --no-block 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 +while [[ "$active_state" == "activating" || "$active_state" =~ ^(in)?active$ ]]; do + sleep .5 active_state=$(systemctl show --value --property ActiveState fail-on-restart.service) done systemctl is-failed fail-on-restart.service || exit 1 +[[ "$(systemctl show --value --property NRestarts fail-on-restart.service)" -le 3 ]] || exit 1 touch /testok