From 9e81bd395a566e7f4764d7efe7b47b93cffba605 Mon Sep 17 00:00:00 2001 From: Vladimir C Date: Wed, 2 Mar 2022 13:49:12 +0100 Subject: [PATCH] Check current user from env in test_user_zero_database_access --- .../test_user_zero_database_access.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_user_zero_database_access/test_user_zero_database_access.py b/tests/integration/test_user_zero_database_access/test_user_zero_database_access.py index 78f40e1ee33..d77e8383df7 100644 --- a/tests/integration/test_user_zero_database_access/test_user_zero_database_access.py +++ b/tests/integration/test_user_zero_database_access/test_user_zero_database_access.py @@ -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"