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.

51 lines
1.2 KiB
Python
Raw Normal View History

2021-05-21 13:29:43 +00:00
import time
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
2021-05-21 13:29:43 +00:00
# TODO ACL not implemented in Keeper.
node1 = cluster.add_instance(
"node1",
with_zookeeper=True,
main_configs=[
"configs/remote_servers.xml",
"configs/zookeeper_config_with_password.xml",
],
)
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):
node1.query("DROP TABLE IF EXISTS simple SYNC")
2021-06-16 12:31:19 +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;
""".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;
"""
)