ClickHouse/tests/queries/0_stateless/00505_secure.sh

39 lines
1.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2018-06-18 21:13:11 +00:00
# set -x
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
# Not default server config needed
2020-07-31 23:55:20 +00:00
if [ -n "$CLICKHOUSE_CONFIG_CLIENT" ]; then
2018-06-18 21:13:11 +00:00
USE_CONFIG="--config-file $CLICKHOUSE_CONFIG_CLIENT"
fi
CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:="$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure --port=$CLICKHOUSE_PORT_TCP_SECURE"}
if [[ $CLICKHOUSE_CLIENT != *"--port"* ]]; then
# Auto port detect. Cant test with re-defined via command line ports
2020-08-01 23:43:31 +00:00
$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure -q "SELECT 1";
else
echo 1
fi
$CLICKHOUSE_CLIENT_SECURE -q "SELECT 2;"
2020-02-22 01:35:28 +00:00
#disable test
#$CLICKHOUSE_CURL -sS --insecure ${CLICKHOUSE_URL_HTTPS}?query=SELECT%203
echo 3
$CLICKHOUSE_CLIENT_SECURE -q "SELECT 4;"
# TODO: can test only on unchanged port. Possible solutions: generate config or pass shard port via command line
if [[ "$CLICKHOUSE_PORT_TCP_SECURE" = "$CLICKHOUSE_PORT_TCP_SECURE" ]]; then
2020-08-01 00:52:41 +00:00
cat "$CURDIR"/00505_distributed_secure.data | $CLICKHOUSE_CLIENT_SECURE -n -m
else
2020-08-01 00:52:41 +00:00
tail -n 13 "$CURDIR"/00505_secure.reference
fi