From 929d5d609709636f474031860d457758065810f9 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 14 Sep 2023 12:18:03 +0200 Subject: [PATCH] Add stateless test for clickhouse keeper-client --no-confirmation (resubmit) Reverts: #54616 Resubmits: #54547 This reverts commit d23daca082fba97298995683114f2b246ac328d9, reversing changes made to e111d4abd328d44d2c86dc5271f2fe9638f8b3e5. Signed-off-by: Azat Khuzhin --- ...ickhouse_keeper_client_no_confirmation.reference | 1 + ...2882_clickhouse_keeper_client_no_confirmation.sh | 13 +++++++++++++ tests/queries/shell_config.sh | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.reference create mode 100755 tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.sh diff --git a/tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.reference b/tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.reference new file mode 100644 index 00000000000..f93821e36f2 --- /dev/null +++ b/tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.reference @@ -0,0 +1 @@ +Can't get data for node '/test-keeper-client-default': node doesn't exist diff --git a/tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.sh b/tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.sh new file mode 100755 index 00000000000..421e1972839 --- /dev/null +++ b/tests/queries/0_stateless/02882_clickhouse_keeper_client_no_confirmation.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CUR_DIR"/../shell_config.sh + +path="/test-keeper-client-$CLICKHOUSE_DATABASE" + +$CLICKHOUSE_KEEPER_CLIENT -q "rm $path" >& /dev/null + +$CLICKHOUSE_KEEPER_CLIENT -q "create $path '' 0" +$CLICKHOUSE_KEEPER_CLIENT -q "rmr $path" +$CLICKHOUSE_KEEPER_CLIENT -q "get $path" 2>&1 diff --git a/tests/queries/shell_config.sh b/tests/queries/shell_config.sh index 12bc0002191..4f28956b91c 100644 --- a/tests/queries/shell_config.sh +++ b/tests/queries/shell_config.sh @@ -79,6 +79,11 @@ export CLICKHOUSE_PORT_POSTGRESQL=${CLICKHOUSE_PORT_POSTGRESQL:="9005"} export CLICKHOUSE_PORT_KEEPER=${CLICKHOUSE_PORT_KEEPER:=$(${CLICKHOUSE_EXTRACT_CONFIG} --try --key=keeper_server.tcp_port 2>/dev/null)} 2>/dev/null export CLICKHOUSE_PORT_KEEPER=${CLICKHOUSE_PORT_KEEPER:="9181"} +# keeper-client +[ -x "${CLICKHOUSE_BINARY}-keeper-client" ] && CLICKHOUSE_KEEPER_CLIENT=${CLICKHOUSE_KEEPER_CLIENT:="${CLICKHOUSE_BINARY}-keeper-client"} +[ -x "${CLICKHOUSE_BINARY}" ] && CLICKHOUSE_KEEPER_CLIENT=${CLICKHOUSE_KEEPER_CLIENT:="${CLICKHOUSE_BINARY} keeper-client"} +export CLICKHOUSE_KEEPER_CLIENT=${CLICKHOUSE_KEEPER_CLIENT:="${CLICKHOUSE_BINARY}-keeper-client --port $CLICKHOUSE_PORT_KEEPER"} + export CLICKHOUSE_CLIENT_SECURE=${CLICKHOUSE_CLIENT_SECURE:=$(echo "${CLICKHOUSE_CLIENT}" | sed 's/--secure //' | sed 's/'"--port=${CLICKHOUSE_PORT_TCP}"'//g; s/$/'"--secure --accept-invalid-certificate --port=${CLICKHOUSE_PORT_TCP_SECURE}"'/g')} # Add database and log comment to url params