]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/TEST-16-EXTEND-TIMEOUT/assess.sh
core: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown...
[thirdparty/systemd.git] / test / TEST-16-EXTEND-TIMEOUT / assess.sh
CommitLineData
a327431b
DB
1#!/bin/bash
2set -v -x
3
4rm -f /test.log
5
6TL=/test.log.XXXXXXXX
7
8function wait_for()
9{
10 service=${1}
11 result=${2:-success}
12 time=${3:-45}
13
14 while [[ ! -f /${service}.terminated && ! -f /${service}.success && $time -gt 0 ]]
15 do
16 sleep 1
17 time=$(( $time - 1 ))
18 done
19
20 if [[ ! -f /${service}.${result} ]]
21 then
22 journalctl -u testsuite-${service/_/-}.service >> "${TL}"
23 fi
24}
25
26# This checks all stages, start, runtime and stop, can be extended by
27# EXTEND_TIMEOUT_USEC
28
29wait_for success_all
30
31# These check that EXTEND_TIMEOUT_USEC that occurs at greater than the
32# extend timeout interval but less then the stage limit (TimeoutStartSec,
33# RuntimeMaxSec, TimeoutStopSec) still succeed.
34
35wait_for success_start
36wait_for success_runtime
37wait_for success_stop
38
39# These ensure that EXTEND_TIMEOUT_USEC will still timeout in the
40# approprate stage, after the stage limit, when the EXTEND_TIMEOUT_USEC
41# message isn't sent within the extend timeout interval.
42
43wait_for fail_start startfail
44wait_for fail_stop stopfail
45wait_for fail_runtime runtimefail
46
47if [[ -f "${TL}" ]]
48then
49 # no mv
50 cp "${TL}" /test.log
51 exit 1
52else
53 touch /testok
54 exit 0
55fi