]>
Commit | Line | Data |
---|---|---|
a327431b DB |
1 | #!/bin/bash |
2 | set -v -x | |
3 | ||
4 | rm -f /test.log | |
5 | ||
6 | TL=/test.log.XXXXXXXX | |
7 | ||
8 | function 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 | ||
29 | wait_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 | ||
35 | wait_for success_start | |
36 | wait_for success_runtime | |
37 | wait_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 | ||
43 | wait_for fail_start startfail | |
44 | wait_for fail_stop stopfail | |
45 | wait_for fail_runtime runtimefail | |
46 | ||
47 | if [[ -f "${TL}" ]] | |
48 | then | |
49 | # no mv | |
50 | cp "${TL}" /test.log | |
51 | exit 1 | |
52 | else | |
53 | touch /testok | |
54 | exit 0 | |
55 | fi |