3
3
load helpers
4
4
5
5
# Command to run in each of the tests.
6
- SLEEPLOOP=' trap "echo BYE;exit 0" INT;echo READY;while :;do echo RUNNING;sleep 0.1;done'
7
-
8
- function setup() {
9
- basic_setup
10
-
11
- TESTLOG=$PODMAN_TMPDIR /container-stdout
12
- }
13
-
6
+ SLEEPLOOP=' trap "echo BYE;exit 0" INT;echo READY;while :;do sleep 0.1;done'
14
7
15
8
# Main test code: wait for container to exist and be ready, send it a
16
9
# signal, wait for container to acknowledge and exit.
@@ -33,21 +26,8 @@ function _test_sigproxy() {
33
26
fi
34
27
done
35
28
36
- # Now that container exists, wait for it to declare itself RUNNING
37
- timeout=10
38
- while : ; do
39
- sleep 0.5
40
- if grep -q RUNNING $TESTLOG ; then
41
- break
42
- fi
43
- timeout=$(( timeout - 1 ))
44
- if [[ $timeout -eq 0 ]]; then
45
- run_podman ps -a
46
- echo " log from container:"
47
- cat $TESTLOG
48
- die " Timed out waiting for container $cname to start"
49
- fi
50
- done
29
+ # Now that container exists, wait for it to declare itself READY
30
+ wait_for_ready $cname
51
31
52
32
# Signal, and wait for container to exit
53
33
kill -INT $kidpid
@@ -72,7 +52,7 @@ function _test_sigproxy() {
72
52
73
53
@test " podman sigproxy test: run" {
74
54
# We're forced to use $PODMAN because run_podman cannot be backgrounded
75
- $PODMAN run -i --name c_run $IMAGE sh -c " $SLEEPLOOP " > $TESTLOG &
55
+ $PODMAN run -i --name c_run $IMAGE sh -c " $SLEEPLOOP " &
76
56
local kidpid=$!
77
57
78
58
_test_sigproxy c_run $kidpid
@@ -82,7 +62,7 @@ function _test_sigproxy() {
82
62
run_podman create --name c_start $IMAGE sh -c " $SLEEPLOOP "
83
63
84
64
# See above comments regarding $PODMAN and backgrounding
85
- $PODMAN start --attach c_start > $TESTLOG &
65
+ $PODMAN start --attach c_start &
86
66
local kidpid=$!
87
67
88
68
_test_sigproxy c_start $kidpid
@@ -92,7 +72,7 @@ function _test_sigproxy() {
92
72
run_podman run -d --name c_attach $IMAGE sh -c " $SLEEPLOOP "
93
73
94
74
# See above comments regarding $PODMAN and backgrounding
95
- $PODMAN attach c_attach > $TESTLOG &
75
+ $PODMAN attach c_attach &
96
76
local kidpid=$!
97
77
98
78
_test_sigproxy c_attach $kidpid
0 commit comments