2020-03-29 13:21:26 +00:00
|
|
|
import pytest
|
|
|
|
from helpers.cluster import ClickHouseCluster
|
|
|
|
|
|
|
|
cluster = ClickHouseCluster(__file__)
|
2022-03-22 16:39:58 +00:00
|
|
|
instance = cluster.add_instance("instance")
|
2020-03-29 13:21:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="module", autouse=True)
|
|
|
|
def setup_nodes():
|
|
|
|
try:
|
|
|
|
cluster.start()
|
|
|
|
yield cluster
|
|
|
|
|
|
|
|
finally:
|
|
|
|
cluster.shutdown()
|
|
|
|
|
|
|
|
|
|
|
|
def test_http_get_is_readonly():
|
2020-09-16 04:26:10 +00:00
|
|
|
assert "Cannot execute query in readonly mode" in instance.http_query_and_get_error(
|
2022-03-22 16:39:58 +00:00
|
|
|
"CREATE TABLE xxx (a Date) ENGINE = MergeTree(a, a, 256)"
|
|
|
|
)
|
|
|
|
assert (
|
|
|
|
"Cannot modify 'readonly' setting in readonly mode"
|
|
|
|
in instance.http_query_and_get_error(
|
|
|
|
"CREATE TABLE xxx (a Date) ENGINE = MergeTree(a, a, 256)",
|
|
|
|
params={"readonly": 0},
|
|
|
|
)
|
|
|
|
)
|