Add test case for cluster discovery with wrong password

This commit is contained in:
vdimir 2024-01-08 16:14:40 +00:00
parent 012713fc31
commit 6ab507e722
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 19 additions and 0 deletions

View File

@ -9,6 +9,13 @@
<password>password123</password>
</discovery>
</test_auto_cluster_with_pwd>
<test_auto_cluster_with_wrong_pwd>
<discovery>
<path>/clickhouse/discovery/test_auto_cluster_with_wrong_pwd</path>
<user>user1</user>
<password>wrongpass1234</password>
</discovery>
</test_auto_cluster_with_wrong_pwd>
</remote_servers>
</clickhouse>

View File

@ -42,3 +42,15 @@ def test_connect_with_password(start_cluster):
msg="Wrong nodes count in cluster",
query_params={"password": "passwordAbc"},
)
result = nodes["node0"].query(
"SELECT sum(number) FROM clusterAllReplicas('test_auto_cluster_with_pwd', numbers(3)) GROUP BY hostname()",
password="passwordAbc",
)
assert result == "3\n3\n", result
result = nodes["node0"].query_and_get_error(
"SELECT sum(number) FROM clusterAllReplicas('test_auto_cluster_with_wrong_pwd', numbers(3)) GROUP BY hostname()",
password="passwordAbc",
)
assert "Authentication failed" in result, result