This repository was archived by the owner on Oct 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 115
115
for SERVICE in ${SERVICES} ; do
116
116
HOST=$( printf " %s\n" " $SERVICE " | cut -d : -f 1)
117
117
PORT=$( printf " %s\n" " $SERVICE " | cut -d : -f 2)
118
- SUCCESS=1
118
+ FAILURE=0
119
119
120
120
if [ " $HOST " = " " ] || [ " $PORT " = " " ]; then
121
121
echoerr " Error: you need to provide a host and port to test."
@@ -124,14 +124,14 @@ for SERVICE in ${SERVICES}; do
124
124
125
125
wait_for
126
126
if [ $? -eq 1 ]; then
127
- SUCCESS=0
127
+ FAILURE=1
128
128
fi
129
129
done
130
130
131
- if [ $SUCCESS -eq 1 ]; then
131
+ if [ $FAILURE -eq 0 ] || [ $LOOSE -eq 1 ]; then
132
132
if [ $# -gt 0 ]; then
133
133
exec " $@ "
134
134
fi
135
- else
136
- exit 1
137
135
fi
136
+
137
+ exit $FAILURE
Original file line number Diff line number Diff line change 3
3
@test " google should be immediately found, no output other than our own" {
4
4
run ./wait-for -q google.com:80 -- echo ' success'
5
5
6
+ [ " $status " -eq 0 ]
6
7
[ " $output " = " success" ]
7
8
}
8
9
14
15
}
15
16
16
17
@test " google and bing should be immediately found" {
17
- run ./wait-for google.com:80 bing.com:80 -- echo ' success'
18
+ run ./wait-for -q google.com:80 bing.com:80 -- echo ' success'
18
19
19
- [ " $output " = " success" ]
20
+ [ " $status " -eq 0 ]
21
+ [ " $output " = " success" ]
20
22
}
21
23
22
24
@test " nonexistent server should start command if loose option is specified" {
You can’t perform that action at this time.
0 commit comments