2021-10-14 10:21:41 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
import pytest
|
|
|
|
from helpers.cluster import ClickHouseCluster
|
|
|
|
import random
|
|
|
|
import string
|
|
|
|
import os
|
|
|
|
import time
|
|
|
|
from multiprocessing.dummy import Pool
|
|
|
|
from helpers.test_tools import assert_eq_with_retry
|
|
|
|
from kazoo.client import KazooClient, KazooState
|
|
|
|
|
|
|
|
cluster = ClickHouseCluster(__file__)
|
2022-03-22 16:39:58 +00:00
|
|
|
node1 = cluster.add_instance(
|
|
|
|
"node1", main_configs=["configs/enable_keeper1.xml"], stay_alive=True
|
|
|
|
)
|
|
|
|
node2 = cluster.add_instance(
|
|
|
|
"node2", main_configs=["configs/enable_keeper2.xml"], stay_alive=True
|
|
|
|
)
|
|
|
|
|
2021-10-14 10:21:41 +00:00
|
|
|
|
|
|
|
def get_fake_zk(nodename, timeout=30.0):
|
2022-03-22 16:39:58 +00:00
|
|
|
_fake_zk_instance = KazooClient(
|
|
|
|
hosts=cluster.get_instance_ip(nodename) + ":9181", timeout=timeout
|
|
|
|
)
|
2021-10-14 10:21:41 +00:00
|
|
|
_fake_zk_instance.start()
|
|
|
|
return _fake_zk_instance
|
|
|
|
|
2022-03-22 16:39:58 +00:00
|
|
|
|
2021-10-14 10:21:41 +00:00
|
|
|
def test_smoke():
|
|
|
|
try:
|
|
|
|
cluster.start()
|
|
|
|
|
|
|
|
node1_zk = get_fake_zk("node1")
|
|
|
|
node1_zk.create("/test_alive", b"aaaa")
|
|
|
|
|
|
|
|
finally:
|
|
|
|
cluster.shutdown()
|