mirror of
https://github.com/systemd/systemd
synced 2024-10-14 20:17:52 +00:00
test/TEST-16: simplify how variables are set
The amount of lines doesn't change much, but I think it's much more straightforward this way.
This commit is contained in:
parent
2b5981b40a
commit
e5b0aaaf56
|
@ -4,23 +4,15 @@ set -e
|
|||
set -o pipefail
|
||||
|
||||
# sleep interval (seconds)
|
||||
sleep_interval=1
|
||||
: ${sleep_interval:=1}
|
||||
# extend_timeout_interval second(s)
|
||||
extend_timeout_interval=1
|
||||
: ${extend_timeout_interval:=1}
|
||||
# number of sleep_intervals before READY=1
|
||||
start_intervals=10
|
||||
: ${start_intervals:=10}
|
||||
# number of sleep_intervals before exiting
|
||||
stop_intervals=10
|
||||
: ${stop_intervals:=10}
|
||||
# run intervals, number of sleep_intervals to run
|
||||
run_intervals=7
|
||||
# service name
|
||||
SERVICE=unknown
|
||||
|
||||
while [ $# -gt 0 ];
|
||||
do
|
||||
eval ${1%=*}=${1#*=}
|
||||
shift
|
||||
done
|
||||
: ${run_intervals:=7}
|
||||
|
||||
# We convert to usec
|
||||
extend_timeout_interval=$(( $extend_timeout_interval * 1000000 ))
|
||||
|
|
|
@ -8,4 +8,5 @@ Type=notify
|
|||
TimeoutStartSec=4
|
||||
TimeoutStopSec=4
|
||||
RuntimeMaxSec=10
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh SERVICE=fail_runtime extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=2 stop_intervals=0
|
||||
Environment=SERVICE=fail_runtime extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=2 stop_intervals=0
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh
|
||||
|
|
|
@ -9,4 +9,5 @@ Type=notify
|
|||
TimeoutStartSec=10
|
||||
TimeoutStopSec=4
|
||||
RuntimeMaxSec=4
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh SERVICE=fail_start extend_timeout_interval=5 sleep_interval=7 start_intervals=2 run_intervals=0 stop_intervals=0
|
||||
Environment=SERVICE=fail_start extend_timeout_interval=5 sleep_interval=7 start_intervals=2 run_intervals=0 stop_intervals=0
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh
|
||||
|
|
|
@ -8,7 +8,8 @@ Type=notify
|
|||
TimeoutStartSec=4
|
||||
TimeoutStopSec=10
|
||||
RuntimeMaxSec=4
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh SERVICE=fail_stop extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=0 stop_intervals=2
|
||||
Environment=SERVICE=fail_stop extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=0 stop_intervals=2
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh
|
||||
# Due to 6041a7ee2c1bbff6301082f192fc1b0882400d42 SIGTERM isn't sent as the service shuts down with STOPPING=1
|
||||
# This file makes the test assess.sh quicker by notifing it that this test has finished.
|
||||
ExecStopPost=/bin/bash -c '[[ $SERVICE_RESULT == timeout && $EXIT_CODE == killed ]] && touch /fail_runtime.terminated'
|
||||
|
|
|
@ -10,4 +10,5 @@ Type=notify
|
|||
TimeoutStartSec=4
|
||||
TimeoutStopSec=4
|
||||
RuntimeMaxSec=4
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh SERVICE=success_all extend_timeout_interval=4 sleep_interval=2 start_intervals=3 run_intervals=3 stop_intervals=3
|
||||
Environment=SERVICE=success_all extend_timeout_interval=4 sleep_interval=2 start_intervals=3 run_intervals=3 stop_intervals=3
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh
|
||||
|
|
|
@ -9,4 +9,5 @@ Type=notify
|
|||
TimeoutStartSec=4
|
||||
TimeoutStopSec=4
|
||||
RuntimeMaxSec=8
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh SERVICE=success_runtime extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=1 stop_intervals=0
|
||||
Environment=SERVICE=success_runtime extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=1 stop_intervals=0
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh
|
||||
|
|
|
@ -8,4 +8,5 @@ Type=notify
|
|||
TimeoutStartSec=8
|
||||
TimeoutStopSec=4
|
||||
RuntimeMaxSec=4
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh SERVICE=success_start extend_timeout_interval=4 sleep_interval=6 start_intervals=1 run_intervals=0 stop_intervals=0
|
||||
Environment=SERVICE=success_start extend_timeout_interval=4 sleep_interval=6 start_intervals=1 run_intervals=0 stop_intervals=0
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh
|
||||
|
|
|
@ -8,4 +8,5 @@ Type=notify
|
|||
TimeoutStartSec=4
|
||||
TimeoutStopSec=8
|
||||
RuntimeMaxSec=4
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh SERVICE=success_stop extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=0 stop_intervals=1
|
||||
Environment=SERVICE=success_stop extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=0 stop_intervals=1
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh
|
||||
|
|
Loading…
Reference in a new issue