ClickHouse/tests/integration/test_config_decryption/test_wrong_settings.py

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

39 lines
962 B
Python
Raw Normal View History

2023-06-09 15:18:46 +00:00
import pytest
2024-09-27 10:19:39 +00:00
2023-06-09 15:18:46 +00:00
from helpers.cluster import ClickHouseCluster
def start_clickhouse(config, err_msg):
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance("node", main_configs=[config])
caught_exception = ""
try:
cluster.start()
except Exception as e:
caught_exception = str(e)
assert err_msg in caught_exception
2023-06-09 15:18:46 +00:00
def test_wrong_method():
2023-07-18 15:45:43 +00:00
start_clickhouse(
"configs/config_wrong_method.xml", "Unknown encryption method. Got WRONG"
2023-07-18 15:45:43 +00:00
)
2023-06-09 15:18:46 +00:00
def test_invalid_chars():
start_clickhouse(
"configs/config_invalid_chars.xml",
"Cannot read encrypted text, check for valid characters",
)
2023-07-21 13:03:25 +00:00
def test_no_encryption_key():
2023-06-09 15:18:46 +00:00
start_clickhouse(
2023-07-21 13:31:42 +00:00
"configs/config_no_encryption_key.xml",
"There is no key 0 in config for AES_128_GCM_SIV encryption codec",
2023-06-09 15:18:46 +00:00
)
def test_subnodes():
2023-07-21 13:29:40 +00:00
start_clickhouse("configs/config_subnodes.xml", "cannot contain nested elements")