From f697df20797b279b93d0589ee7a45f9c7f23e86c Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 20 Mar 2019 23:04:49 +0300 Subject: [PATCH] Tests: fix call .sh from .sh (#4732) --- dbms/programs/server/users.d/readonly.xml | 21 +++++++++++ dbms/tests/clickhouse-test | 2 +- dbms/tests/clickhouse-test-server | 5 ++- .../tests/queries/0_stateless/00505_secure.sh | 6 ++-- ...lized_view_and_too_many_parts_zookeeper.sh | 3 ++ .../0_stateless/00634_logging_shard.sh | 4 +-- ...4_performance_introspection_and_logging.sh | 4 +-- .../00653_verification_monotonic_data_load.sh | 4 +-- .../0_stateless/00689_catboost_pool_files.sh | 36 ++++++++++--------- ...o_set_two_configuration_files_in_client.sh | 5 ++- dbms/tests/queries/shell_config.sh | 14 +++++--- dbms/tests/users.d/readonly.xml | 1 + docker/test/stateless/Dockerfile | 1 + docker/test/stateless/readonly.xml | 21 +++++++++++ 14 files changed, 92 insertions(+), 35 deletions(-) create mode 100644 dbms/programs/server/users.d/readonly.xml create mode 120000 dbms/tests/users.d/readonly.xml create mode 100644 docker/test/stateless/readonly.xml diff --git a/dbms/programs/server/users.d/readonly.xml b/dbms/programs/server/users.d/readonly.xml new file mode 100644 index 00000000000..64fbaf77464 --- /dev/null +++ b/dbms/programs/server/users.d/readonly.xml @@ -0,0 +1,21 @@ + + + + + + 1 + + + + + + + + ::1 + 127.0.0.1 + + readonly + default + + + diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 8956a687766..b17f408f959 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -125,7 +125,7 @@ def main(args): # Keep same default values as in queries/shell_config.sh os.environ.setdefault("CLICKHOUSE_BINARY", args.binary) - os.environ.setdefault("CLICKHOUSE_CLIENT", args.client) + #os.environ.setdefault("CLICKHOUSE_CLIENT", args.client) os.environ.setdefault("CLICKHOUSE_CONFIG", args.configserver) if args.configclient: os.environ.setdefault("CLICKHOUSE_CONFIG_CLIENT", args.configclient) diff --git a/dbms/tests/clickhouse-test-server b/dbms/tests/clickhouse-test-server index ae9cc721407..b324a270473 100755 --- a/dbms/tests/clickhouse-test-server +++ b/dbms/tests/clickhouse-test-server @@ -31,6 +31,8 @@ export CLICKHOUSE_CONFIG_CLIENT=${CLICKHOUSE_CONFIG_CLIENT:=${CONFIG_CLIENT_DIR} export CLICKHOUSE_CONFIG=${CLICKHOUSE_CONFIG:=${CONFIG_SERVER_DIR}server-test.xml} CLICKHOUSE_CONFIG_USERS=${CONFIG_SERVER_DIR}users.xml [ ! -f "$CLICKHOUSE_CONFIG_USERS" ] && CLICKHOUSE_CONFIG_USERS=$CUR_DIR/../programs/server/users.xml +CLICKHOUSE_CONFIG_USERS_D=${CONFIG_SERVER_DIR}users.d +[ ! -d "$CLICKHOUSE_CONFIG_USERS_D" ] && CLICKHOUSE_CONFIG_USERS_D=$CUR_DIR/../programs/server/users.d [ -x "$CUR_DIR/clickhouse-test" ] && TEST_DIR=${TEST_DIR=$CUR_DIR/} [ -d "$CUR_DIR/queries" ] && QUERIES_DIR=${QUERIES_DIR=$CUR_DIR/queries} [ ! -d "$QUERIES_DIR" ] && [ -d "/usr/local/share/clickhouse-test/queries" ] && QUERIES_DIR=${QUERIES_DIR=/usr/local/share/clickhouse-test/queries} @@ -54,6 +56,7 @@ if [ "$DATA_DIR_PATTERN" != "$DATA_DIR" ]; then cat $CLICKHOUSE_CONFIG | sed -e s!$DATA_DIR_PATTERN!$DATA_DIR! > $DATA_DIR/etc/server-config.xml export CLICKHOUSE_CONFIG=$DATA_DIR/etc/server-config.xml cp $CLICKHOUSE_CONFIG_USERS $DATA_DIR/etc + cp -r -L $CLICKHOUSE_CONFIG_USERS_D $DATA_DIR/etc fi CLICKHOUSE_EXTRACT_CONFIG=${CLICKHOUSE_EXTRACT_CONFIG:="${CLICKHOUSE_EXTRACT} --config=$CLICKHOUSE_CONFIG"} @@ -140,7 +143,7 @@ else fi ( [ "$TEST_RUN" ] && $CLICKHOUSE_TEST ) || ${TEST_TRUE:=false} ( [ "$TEST_PERF" ] && $CLICKHOUSE_PERFORMANCE_TEST $* ) || true - ( [ "$TEST_DICT" ] && mkdir -p $DATA_DIR/etc/dictionaries/ && cd $CUR_DIR/external_dictionaries && python generate_and_test.py --port=$CLICKHOUSE_PORT_TCP --client=$CLICKHOUSE_CLIENT --source=$CUR_DIR/external_dictionaries/source.tsv --reference=$CUR_DIR/external_dictionaries/reference --generated=$DATA_DIR/etc/dictionaries/ --no_mysql --no_mongo ) || true + #( [ "$TEST_DICT" ] && mkdir -p $DATA_DIR/etc/dictionaries/ && cd $CUR_DIR/external_dictionaries && python generate_and_test.py --port=$CLICKHOUSE_PORT_TCP --client=$CLICKHOUSE_CLIENT --source=$CUR_DIR/external_dictionaries/source.tsv --reference=$CUR_DIR/external_dictionaries/reference --generated=$DATA_DIR/etc/dictionaries/ --no_mysql --no_mongo ) || true $CLICKHOUSE_CLIENT_QUERY "SELECT event, value FROM system.events; SELECT metric, value FROM system.metrics; SELECT metric, value FROM system.asynchronous_metrics;" $CLICKHOUSE_CLIENT_QUERY "SELECT 'Still alive'" fi diff --git a/dbms/tests/queries/0_stateless/00505_secure.sh b/dbms/tests/queries/0_stateless/00505_secure.sh index 8c7f10c07b5..7a7f50f8c5f 100755 --- a/dbms/tests/queries/0_stateless/00505_secure.sh +++ b/dbms/tests/queries/0_stateless/00505_secure.sh @@ -19,13 +19,11 @@ if [ -z $tcp_port_secure ]; then cat $CURDIR/00505_secure.reference else + CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:="$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure --port=$CLICKHOUSE_PORT_TCP_SECURE"} if [[ $CLICKHOUSE_CLIENT != *"--port"* ]]; then - CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:="$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure --port=$CLICKHOUSE_PORT_TCP_SECURE"} - - # Auto port detect. Cant test with re-definedvia command line ports + # Auto port detect. Cant test with re-defined via command line ports $CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure -q "SELECT 1"; else - CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:="$CLICKHOUSE_CLIENT_BINARY $USE_CONFIG --secure --port=$CLICKHOUSE_PORT_TCP_SECURE"} echo 1 fi diff --git a/dbms/tests/queries/0_stateless/00633_materialized_view_and_too_many_parts_zookeeper.sh b/dbms/tests/queries/0_stateless/00633_materialized_view_and_too_many_parts_zookeeper.sh index dce4f576840..e4df41ccad8 100755 --- a/dbms/tests/queries/0_stateless/00633_materialized_view_and_too_many_parts_zookeeper.sh +++ b/dbms/tests/queries/0_stateless/00633_materialized_view_and_too_many_parts_zookeeper.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash set -e +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + ${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test.root" ${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test.a" ${CLICKHOUSE_CLIENT} --query "DROP TABLE IF EXISTS test.b" diff --git a/dbms/tests/queries/0_stateless/00634_logging_shard.sh b/dbms/tests/queries/0_stateless/00634_logging_shard.sh index 0736354312b..3ea0df81bab 100755 --- a/dbms/tests/queries/0_stateless/00634_logging_shard.sh +++ b/dbms/tests/queries/0_stateless/00634_logging_shard.sh @@ -7,8 +7,8 @@ export CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL="trace" CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) . $CURDIR/../shell_config.sh -cur_name=${BASH_SOURCE[0]} -server_logs_file=$cur_name"_server.logs" +cur_name=$(basename "${BASH_SOURCE[0]}") +server_logs_file="${CLICKHOUSE_TMP}/${cur_name}_server.logs" server_logs="--server_logs_file=$server_logs_file" rm -f "$server_logs_file" diff --git a/dbms/tests/queries/0_stateless/00634_performance_introspection_and_logging.sh b/dbms/tests/queries/0_stateless/00634_performance_introspection_and_logging.sh index 704dbfb93f9..56a0514e90d 100755 --- a/dbms/tests/queries/0_stateless/00634_performance_introspection_and_logging.sh +++ b/dbms/tests/queries/0_stateless/00634_performance_introspection_and_logging.sh @@ -7,8 +7,8 @@ export CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL="trace" CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) . $CURDIR/../shell_config.sh -cur_name=${BASH_SOURCE[0]} -server_logs_file=$cur_name"_server.logs" +cur_name=$(basename "${BASH_SOURCE[0]}") +server_logs_file=${CLICKHOUSE_TMP}/$cur_name"_server.logs" server_logs="--server_logs_file=$server_logs_file" rm -f "$server_logs_file" diff --git a/dbms/tests/queries/0_stateless/00653_verification_monotonic_data_load.sh b/dbms/tests/queries/0_stateless/00653_verification_monotonic_data_load.sh index db533844fe4..0479abffe6b 100755 --- a/dbms/tests/queries/0_stateless/00653_verification_monotonic_data_load.sh +++ b/dbms/tests/queries/0_stateless/00653_verification_monotonic_data_load.sh @@ -38,7 +38,7 @@ ${CLICKHOUSE_CLIENT} --query="INSERT INTO test.unsigned_integer_test_table VALUE ${CLICKHOUSE_CLIENT} --query="INSERT INTO test.enum_test_table VALUES ('hello'), ('world'), ('world'), ('yandex'), ('clickhouse'), ('clickhouse');" ${CLICKHOUSE_CLIENT} --query="INSERT INTO test.date_test_table VALUES (1), (2), (2), (256), (257), (257);" -export CLICKHOUSE_CLIENT=`echo ${CLICKHOUSE_CLIENT} | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=debug/g'` +CLICKHOUSE_CLIENT=`echo ${CLICKHOUSE_CLIENT} | sed 's/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/--send_logs_level=debug/g'` ${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test.string_test_table WHERE toUInt64(val) == 0;" 2>&1 |grep -q "3 marks to read from 1 ranges" && echo "no monotonic int case: String -> UInt64" ${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test.fixed_string_test_table WHERE toUInt64(val) == 0;" 2>&1 |grep -q "3 marks to read from 1 ranges" && echo "no monotonic int case: FixedString -> UInt64" @@ -73,7 +73,7 @@ ${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test.date_test_table WHERE toU ${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test.date_test_table WHERE toInt8(val) == 1;" 2>&1 |grep -q "5 marks to read from" && echo "monotonic int case: Date -> Int8" ${CLICKHOUSE_CLIENT} --query="SELECT count() FROM test.date_test_table WHERE toUInt8(val) == 1;" 2>&1 |grep -q "5 marks to read from" && echo "monotonic int case: Date -> UInt8" -export CLICKHOUSE_CLIENT=`echo ${CLICKHOUSE_CLIENT} |sed 's/debug/'"${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/g'` +CLICKHOUSE_CLIENT=`echo ${CLICKHOUSE_CLIENT} | sed 's/--send_logs_level=debug/'"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"'/g'` ${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS test.string_test_table;" ${CLICKHOUSE_CLIENT} --query="DROP TABLE IF EXISTS test.fixed_string_test_table;" diff --git a/dbms/tests/queries/0_stateless/00689_catboost_pool_files.sh b/dbms/tests/queries/0_stateless/00689_catboost_pool_files.sh index c366949d695..ec5161574f7 100755 --- a/dbms/tests/queries/0_stateless/00689_catboost_pool_files.sh +++ b/dbms/tests/queries/0_stateless/00689_catboost_pool_files.sh @@ -1,5 +1,7 @@ -SCRIPT_PATH="`dirname \"$0\"`" -SCRIPT_PATH="`( cd \"$SCRIPT_PATH\" && pwd )`" +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh ${CLICKHOUSE_CLIENT} --query="drop table if exists test.catboost_pool_desc;" ${CLICKHOUSE_CLIENT} --query="drop table if exists test.catboost_pool_vals;" @@ -9,22 +11,22 @@ ${CLICKHOUSE_CLIENT} --query="create table test.catboost_pool_vals (str String) ${CLICKHOUSE_CLIENT} --query="insert into test.catboost_pool_vals select 'Hello';" ${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', 'data/test/catboost_pool_vals/data.TSV');" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('data/test/catboost_pool_desc/data.TSV', '../../../../../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('${SCRIPT_PATH}/00689_file.txt', '${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../${SCRIPT_PATH}/00689_file.txt', '../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../${SCRIPT_PATH}/00689_file.txt', '../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../${SCRIPT_PATH}/00689_file.txt', '../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../../${SCRIPT_PATH}/00689_file.txt', '../../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../../../${SCRIPT_PATH}/00689_file.txt', '../../../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" -${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../../../../${SCRIPT_PATH}/00689_file.txt', '../../../../../../${SCRIPT_PATH}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('${CURDIR}/00689_file.txt', '${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../${CURDIR}/00689_file.txt', '../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../${CURDIR}/00689_file.txt', '../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../${CURDIR}/00689_file.txt', '../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../../${CURDIR}/00689_file.txt', '../../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../../../${CURDIR}/00689_file.txt', '../../../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" +${CLICKHOUSE_CLIENT} --query="select * from catBoostPool('../../../../../../${CURDIR}/00689_file.txt', '../../../../../../${CURDIR}/00689_file.txt');" 2>&1 | grep -o "Data" ${CLICKHOUSE_CLIENT} --query="drop table if exists test.catboost_pool_desc;" ${CLICKHOUSE_CLIENT} --query="drop table if exists test.catboost_pool_vals;" diff --git a/dbms/tests/queries/0_stateless/00834_dont_allow_to_set_two_configuration_files_in_client.sh b/dbms/tests/queries/0_stateless/00834_dont_allow_to_set_two_configuration_files_in_client.sh index 93ec3c00fe1..e75cd69ab52 100755 --- a/dbms/tests/queries/0_stateless/00834_dont_allow_to_set_two_configuration_files_in_client.sh +++ b/dbms/tests/queries/0_stateless/00834_dont_allow_to_set_two_configuration_files_in_client.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash -OUTPUT=`$CLICKHOUSE_CLIENT -c 1 -C 2 2>&1` +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +OUTPUT=`$CLICKHOUSE_CLIENT_BINARY -c 1 -C 2 2>&1` #test will fail if clickouse-client exit code is 0 if [ $? -eq 0 ]; then diff --git a/dbms/tests/queries/shell_config.sh b/dbms/tests/queries/shell_config.sh index 6a2e0e536f6..f086143db65 100644 --- a/dbms/tests/queries/shell_config.sh +++ b/dbms/tests/queries/shell_config.sh @@ -1,11 +1,15 @@ +export CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL:="warning"} +[ -n "$CLICKHOUSE_CONFIG_CLIENT" ] && CLICKHOUSE_CLIENT_OPT0+=" --config-file=${CLICKHOUSE_CONFIG_CLIENT} " +[ -n "${CLICKHOUSE_HOST}" ] && CLICKHOUSE_CLIENT_OPT0+=" --host=${CLICKHOUSE_HOST} " +[ -n "${CLICKHOUSE_PORT_TCP}" ] && CLICKHOUSE_CLIENT_OPT0+=" --port=${CLICKHOUSE_PORT_TCP} " +[ -n "${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}" ] && CLICKHOUSE_CLIENT_OPT0+=" --send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL} " + export CLICKHOUSE_BINARY=${CLICKHOUSE_BINARY:="clickhouse"} -[ -x "$CLICKHOUSE_BINARY-client" ] && CLICKHOUSE_CLIENT_BINARY=${CLICKHOUSE_CLIENT_BINARY:=$CLICKHOUSE_BINARY-client} && CLICKHOUSE_CLIENT=${CLICKHOUSE_CLIENT:="$CLICKHOUSE_CLIENT_BINARY"} -[ -x "$CLICKHOUSE_BINARY" ] && CLICKHOUSE_CLIENT_BINARY=${CLICKHOUSE_CLIENT_BINARY:=$CLICKHOUSE_BINARY client} && CLICKHOUSE_CLIENT=${CLICKHOUSE_CLIENT:="$CLICKHOUSE_CLIENT_BINARY"} +[ -x "$CLICKHOUSE_BINARY-client" ] && CLICKHOUSE_CLIENT_BINARY=${CLICKHOUSE_CLIENT_BINARY:=$CLICKHOUSE_BINARY-client} +[ -x "$CLICKHOUSE_BINARY" ] && CLICKHOUSE_CLIENT_BINARY=${CLICKHOUSE_CLIENT_BINARY:=$CLICKHOUSE_BINARY client} export CLICKHOUSE_CLIENT_BINARY=${CLICKHOUSE_CLIENT_BINARY:=$CLICKHOUSE_BINARY-client} -export CLICKHOUSE_CLIENT=${CLICKHOUSE_CLIENT:="$CLICKHOUSE_CLIENT_BINARY"} -export CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL:="warning"} -export CLICKHOUSE_CLIENT="${CLICKHOUSE_CLIENT} --send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL} ${CLICKHOUSE_CLIENT_OPT}" +export CLICKHOUSE_CLIENT=${CLICKHOUSE_CLIENT:="$CLICKHOUSE_CLIENT_BINARY ${CLICKHOUSE_CLIENT_OPT0} ${CLICKHOUSE_CLIENT_OPT}"} [ -x "${CLICKHOUSE_BINARY}-local" ] && CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY}-local"} [ -x "${CLICKHOUSE_BINARY}" ] && CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY} local"} export CLICKHOUSE_LOCAL=${CLICKHOUSE_LOCAL:="${CLICKHOUSE_BINARY}-local"} diff --git a/dbms/tests/users.d/readonly.xml b/dbms/tests/users.d/readonly.xml new file mode 120000 index 00000000000..023bb5bf9f5 --- /dev/null +++ b/dbms/tests/users.d/readonly.xml @@ -0,0 +1 @@ +../../programs/server/users.d/readonly.xml \ No newline at end of file diff --git a/docker/test/stateless/Dockerfile b/docker/test/stateless/Dockerfile index dcd7a0bcad0..eb32b93d43c 100644 --- a/docker/test/stateless/Dockerfile +++ b/docker/test/stateless/Dockerfile @@ -32,6 +32,7 @@ COPY zookeeper.xml /etc/clickhouse-server/config.d/zookeeper.xml COPY listen.xml /etc/clickhouse-server/config.d/listen.xml COPY part_log.xml /etc/clickhouse-server/config.d/part_log.xml COPY log_queries.xml /etc/clickhouse-server/users.d/log_queries.xml +COPY readonly.xml /etc/clickhouse-server/users.d/readonly.xml CMD dpkg -i package_folder/clickhouse-common-static_*.deb; \ dpkg -i package_folder/clickhouse-common-static-dbg_*.deb; \ diff --git a/docker/test/stateless/readonly.xml b/docker/test/stateless/readonly.xml new file mode 100644 index 00000000000..64fbaf77464 --- /dev/null +++ b/docker/test/stateless/readonly.xml @@ -0,0 +1,21 @@ + + + + + + 1 + + + + + + + + ::1 + 127.0.0.1 + + readonly + default + + +