Skip to content

Commit f986fcc

Browse files
committed
fix: Checks if netcat exists before running while loop with nc
The functional tests run an infinite loop as long as nc returns an error, which always is the case if nc is not doesn't exist. Signed-off-by: joshjms <joshjms1607@gmail.com>
1 parent a271b1c commit f986fcc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ function functional_pass {
225225
agent_pids="${agent_pids} $pid"
226226
done
227227

228+
if ! command -v nc >/dev/null; then
229+
echo "nc is not found"
230+
exit 255
231+
fi
232+
228233
for a in 1 2 3; do
229234
echo "Waiting for 'etcd-agent' on ${a}9027..."
230235
while ! nc -z localhost ${a}9027; do

0 commit comments

Comments
 (0)