ClickHouse/tests/integration/test_config_decryption/test_wrong_settings.py
Robert Schulze aa25ce9e3d
Follow-up to "Implement support of encrypted elements in configuration file"
Cf. PR #50986

- rename XML attribute "encryption_codec" to "encrypted_by"
2023-07-26 13:27:13 +00:00

38 lines
961 B
Python

import pytest
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
def test_wrong_method():
start_clickhouse(
"configs/config_wrong_method.xml", "Unknown encryption method. Got WRONG"
)
def test_invalid_chars():
start_clickhouse(
"configs/config_invalid_chars.xml",
"Cannot read encrypted text, check for valid characters",
)
def test_no_encryption_key():
start_clickhouse(
"configs/config_no_encryption_key.xml",
"There is no key 0 in config for AES_128_GCM_SIV encryption codec",
)
def test_subnodes():
start_clickhouse("configs/config_subnodes.xml", "cannot contain nested elements")