ClickHouse/tests/integration/test_zookeeper_config/test_password.py

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

53 lines
1.2 KiB
Python
Raw Normal View History

2021-05-21 13:29:43 +00:00
import time
2024-09-27 10:19:39 +00:00
2021-05-21 13:29:43 +00:00
import pytest
2024-09-27 10:19:39 +00:00
2021-05-21 13:29:43 +00:00
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
2021-05-21 13:29:43 +00:00
# TODO ACL not implemented in Keeper.
2021-05-31 04:12:22 +00:00
node1 = cluster.add_instance(
"node1",
with_zookeeper=True,
2021-05-21 13:29:43 +00:00
main_configs=[
"configs/remote_servers.xml",
"configs/zookeeper_config_with_password.xml",
],
2021-05-21 13:29:43 +00:00
)
2021-05-31 04:12:22 +00:00
node2 = cluster.add_instance(
"node2", with_zookeeper=True, main_configs=["configs/remote_servers.xml"]
)
2021-05-21 13:29:43 +00:00
@pytest.fixture(scope="module", autouse=True)
def started_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
2021-05-21 13:29:43 +00:00
def test_identity(started_cluster):
2021-06-16 12:31:19 +00:00
node1.query("DROP TABLE IF EXISTS simple SYNC")
2021-05-21 13:29:43 +00:00
node1.query(
"""
2021-05-21 13:29:43 +00:00
CREATE TABLE simple (date Date, id UInt32)
2022-06-23 08:37:52 +00:00
ENGINE = ReplicatedMergeTree('/clickhouse/tables/0/simple', '{replica}') PARTITION BY toYYYYMM(date) ORDER BY id;
2021-05-21 13:29:43 +00:00
""".format(
replica=node1.name
)
)
2021-05-21 13:29:43 +00:00
with pytest.raises(Exception):
node2.query(
"""
2021-05-21 13:29:43 +00:00
CREATE TABLE simple (date Date, id UInt32)
2022-06-23 08:37:52 +00:00
ENGINE = ReplicatedMergeTree('/clickhouse/tables/0/simple', '1') PARTITION BY toYYYYMM(date) ORDER BY id;
"""
2021-05-21 13:29:43 +00:00
)