2017-09-05 18:53:28 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-10-12 19:54:56 +00:00
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-12-28 11:46:53 +00:00
|
|
|
# shellcheck source=../shell_config.sh
|
2020-08-01 00:51:12 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
2017-09-23 23:32:26 +00:00
|
|
|
|
2024-08-06 20:50:31 +00:00
|
|
|
# the sed command here replaces the real number of left requests with a question mark, because it can vary and we don't really have control over it
|
|
|
|
( ${CLICKHOUSE_CURL} -s --head "${CLICKHOUSE_URL}&query=SELECT%201" | sed -r 's/(keep-alive: timeout=10, max=)[0-9]+/\1?/I';
|
|
|
|
${CLICKHOUSE_CURL} -s --head "${CLICKHOUSE_URL}&query=select+*+from+system.numbers+limit+1000000" ) | sed -r 's/(keep-alive: timeout=10, max=)[0-9]+/\1?/I' | grep -v "Date:" | grep -v "X-ClickHouse-Server-Display-Name:" | grep -v "X-ClickHouse-Query-Id:" | grep -v "X-ClickHouse-Format:" | grep -v "X-ClickHouse-Timezone:"
|
2017-10-03 18:31:32 +00:00
|
|
|
|
2020-08-01 01:20:22 +00:00
|
|
|
if [[ $(${CLICKHOUSE_CURL} -sS -X POST -I "${CLICKHOUSE_URL}&query=SELECT+1" | grep -c '411 Length Required') -ne 1 ]]; then
|
2017-09-25 19:45:15 +00:00
|
|
|
echo FAIL
|
|
|
|
fi
|