ClickHouse/tests/queries/0_stateless/02377_quota_key.sh
Yakov Olkhovskiy 33b0b1828a test added
2022-08-04 01:41:13 -04:00

17 lines
694 B
Bash
Executable File

#!/usr/bin/env bash
# Tags: no-parallel
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
${CLICKHOUSE_CLIENT} -q "DROP USER IF EXISTS u_02377"
${CLICKHOUSE_CLIENT} -q "drop quota if exists q_02377"
${CLICKHOUSE_CLIENT} -q "CREATE USER u_02377 IDENTIFIED WITH plaintext_password BY 'password';"
${CLICKHOUSE_CLIENT} -q "CREATE QUOTA q_02377 KEYED BY client_key FOR INTERVAL 1 month MAX queries = 100 TO u_02377;"
${CLICKHOUSE_CLIENT} --user=u_02377 --password=password --quota_key=q_02377 --query="select 1"
${CLICKHOUSE_CLIENT} -q "DROP USER IF EXISTS u_02377"
${CLICKHOUSE_CLIENT} -q "drop quota if exists q_02377"