mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Check current user from env in test_user_zero_database_access
This commit is contained in:
parent
43ac214dc5
commit
9e81bd395a
@ -72,13 +72,15 @@ def test_user_zero_database_access(start_cluster):
|
||||
assert False, "user with full access rights can't drop database test2"
|
||||
|
||||
try:
|
||||
node.exec_in_container(
|
||||
["bash", "-c", "export CLICKHOUSE_USER=env_user_not_with_password && /usr/bin/clickhouse client --query 'SELECT 1'"], user='root')
|
||||
name = node.exec_in_container(
|
||||
["bash", "-c", "export CLICKHOUSE_USER=env_user_not_with_password && /usr/bin/clickhouse client --query 'SELECT currentUser()'"], user='root')
|
||||
assert name.strip() == "env_user_not_with_password"
|
||||
except Exception as ex:
|
||||
assert False, "set env CLICKHOUSE_USER can not connect server"
|
||||
|
||||
try:
|
||||
node.exec_in_container(
|
||||
["bash", "-c", "export CLICKHOUSE_USER=env_user_with_password && export CLICKHOUSE_PASSWORD=clickhouse && /usr/bin/clickhouse client --query 'SELECT 1'"], user='root')
|
||||
name = node.exec_in_container(
|
||||
["bash", "-c", "export CLICKHOUSE_USER=env_user_with_password && export CLICKHOUSE_PASSWORD=clickhouse && /usr/bin/clickhouse client --query 'SELECT currentUser()'"], user='root')
|
||||
assert name.strip() == "env_user_with_password"
|
||||
except Exception as ex:
|
||||
assert False, "set env CLICKHOUSE_USER CLICKHOUSE_PASSWORD can not connect server"
|
||||
|
Loading…
Reference in New Issue
Block a user