mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
This change makes the elasticsearch service used in integration tests be installed and started in a docker container. Fixes #7097 Fixes #7234
23 lines
479 B
Bash
23 lines
479 B
Bash
#!/bin/bash
|
|
|
|
##
|
|
# Add routines and/or variables that can be shared between the
|
|
# service containers.
|
|
##
|
|
|
|
PORT_WAIT_COUNT=20
|
|
|
|
# Check service responds on given port.
|
|
# Parameters:
|
|
# - the port number.
|
|
wait_for_port() {
|
|
count=$PORT_WAIT_COUNT
|
|
port=$1
|
|
while ! nc -z localhost $port && [[ $count -ne 0 ]]; do
|
|
count=$(( $count - 1 ))
|
|
[[ $count -eq 0 ]] && return 1
|
|
sleep 0.5
|
|
done
|
|
# just in case, one more time
|
|
nc -z localhost $port
|
|
}
|