This commit is contained in:
Yatsishin Ilya 2021-04-27 12:07:04 +03:00
parent 4347f6ae43
commit edabf8f5c3
4 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -e
mkdir -p /etc/docker/
cat > /etc/docker/daemon.json << EOF cat > /etc/docker/daemon.json << EOF
{ {
"ipv6": true, "ipv6": true,

View File

@ -30,6 +30,12 @@ def prepare_single_pair_with_setting(first_node, second_node, group):
for node in (first_node, second_node): for node in (first_node, second_node):
node.query("CREATE DATABASE IF NOT EXISTS test") node.query("CREATE DATABASE IF NOT EXISTS test")
first_node.query("DROP TABLE IF EXISTS table_by_default")
second_node.query("DROP TABLE IF EXISTS table_by_default")
first_node.query("DROP TABLE IF EXISTS table_with_fixed_granularity")
second_node.query("DROP TABLE IF EXISTS table_with_fixed_granularity")
# Two tables with adaptive granularity # Two tables with adaptive granularity
first_node.query( first_node.query(
''' '''

View File

@ -37,8 +37,9 @@ def query(node, query):
def setup_nodes(): def setup_nodes():
try: try:
cluster.start() cluster.start()
query(server, "CREATE TABLE test_table (x Int32) ENGINE = MergeTree() ORDER BY tuple()") query(server, "DROP TABLE IF EXISTS test_allowed_client_hosts")
query(server, "INSERT INTO test_table VALUES (5)") query(server, "CREATE TABLE test_allowed_client_hosts (x Int32) ENGINE = MergeTree() ORDER BY tuple()")
query(server, "INSERT INTO test_allowed_client_hosts VALUES (5)")
yield cluster yield cluster
@ -57,8 +58,8 @@ def test_allowed_host():
# expected_to_fail.extend([clientC3, clientD2]) # expected_to_fail.extend([clientC3, clientD2])
for client_node in expected_to_pass: for client_node in expected_to_pass:
assert query_from_one_node_to_another(client_node, server, "SELECT * FROM test_table") == "5\n" assert query_from_one_node_to_another(client_node, server, "SELECT * FROM test_allowed_client_hosts") == "5\n"
for client_node in expected_to_fail: for client_node in expected_to_fail:
with pytest.raises(Exception, match=r'default: Authentication failed'): with pytest.raises(Exception, match=r'default: Authentication failed'):
query_from_one_node_to_another(client_node, server, "SELECT * FROM test_table") query_from_one_node_to_another(client_node, server, "SELECT * FROM test_allowed_client_hosts")