ClickHouse/tests/queries/0_stateless/02377_quota_key.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
694 B
Bash
Raw Normal View History

2022-08-04 05:41:13 +00:00
#!/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"