mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #35936 from DevTeamBK/MARIANA-62
Move credentials for integration tests into a separate file (The ticket name in IBM's JIRA is MARIANA-62)
This commit is contained in:
commit
bad2e9dc06
@ -48,6 +48,8 @@ import docker
|
||||
from .client import Client
|
||||
from .hdfs_api import HDFSApi
|
||||
|
||||
from .config_cluster import *
|
||||
|
||||
HELPERS_DIR = p.dirname(__file__)
|
||||
CLICKHOUSE_ROOT_DIR = p.join(p.dirname(__file__), "../../..")
|
||||
LOCAL_DOCKER_COMPOSE_DIR = p.join(
|
||||
@ -1664,8 +1666,8 @@ class ClickHouseCluster:
|
||||
while time.time() - start < timeout:
|
||||
try:
|
||||
conn = pymysql.connect(
|
||||
user="root",
|
||||
password="clickhouse",
|
||||
user=mysql_user,
|
||||
password=mysql_pass,
|
||||
host=self.mysql_ip,
|
||||
port=self.mysql_port,
|
||||
)
|
||||
@ -1686,8 +1688,8 @@ class ClickHouseCluster:
|
||||
while time.time() - start < timeout:
|
||||
try:
|
||||
conn = pymysql.connect(
|
||||
user="root",
|
||||
password="clickhouse",
|
||||
user=mysql8_user,
|
||||
password=mysql8_pass,
|
||||
host=self.mysql8_ip,
|
||||
port=self.mysql8_port,
|
||||
)
|
||||
@ -1711,8 +1713,8 @@ class ClickHouseCluster:
|
||||
try:
|
||||
for ip in [self.mysql2_ip, self.mysql3_ip, self.mysql4_ip]:
|
||||
conn = pymysql.connect(
|
||||
user="root",
|
||||
password="clickhouse",
|
||||
user=mysql_user,
|
||||
password=mysql_pass,
|
||||
host=ip,
|
||||
port=self.mysql_port,
|
||||
)
|
||||
@ -1735,9 +1737,9 @@ class ClickHouseCluster:
|
||||
self.postgres_conn = psycopg2.connect(
|
||||
host=self.postgres_ip,
|
||||
port=self.postgres_port,
|
||||
database="postgres",
|
||||
user="postgres",
|
||||
password="mysecretpassword",
|
||||
database=pg_db,
|
||||
user=pg_user,
|
||||
password=pg_pass,
|
||||
)
|
||||
self.postgres_conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
|
||||
self.postgres_conn.autocommit = True
|
||||
@ -1759,9 +1761,9 @@ class ClickHouseCluster:
|
||||
self.postgres2_conn = psycopg2.connect(
|
||||
host=self.postgres2_ip,
|
||||
port=self.postgres_port,
|
||||
database="postgres",
|
||||
user="postgres",
|
||||
password="mysecretpassword",
|
||||
database=pg_db,
|
||||
user=pg_user,
|
||||
password=pg_pass,
|
||||
)
|
||||
self.postgres2_conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
|
||||
self.postgres2_conn.autocommit = True
|
||||
@ -1775,9 +1777,9 @@ class ClickHouseCluster:
|
||||
self.postgres3_conn = psycopg2.connect(
|
||||
host=self.postgres3_ip,
|
||||
port=self.postgres_port,
|
||||
database="postgres",
|
||||
user="postgres",
|
||||
password="mysecretpassword",
|
||||
database=pg_db,
|
||||
user=pg_user,
|
||||
password=pg_pass,
|
||||
)
|
||||
self.postgres3_conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
|
||||
self.postgres3_conn.autocommit = True
|
||||
@ -1791,9 +1793,9 @@ class ClickHouseCluster:
|
||||
self.postgres4_conn = psycopg2.connect(
|
||||
host=self.postgres4_ip,
|
||||
port=self.postgres_port,
|
||||
database="postgres",
|
||||
user="postgres",
|
||||
password="mysecretpassword",
|
||||
database=pg_db,
|
||||
user=pg_user,
|
||||
password=pg_pass,
|
||||
)
|
||||
self.postgres4_conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
|
||||
self.postgres4_conn.autocommit = True
|
||||
@ -1945,7 +1947,7 @@ class ClickHouseCluster:
|
||||
|
||||
def wait_mongo_to_start(self, timeout=30, secure=False):
|
||||
connection_str = "mongodb://{user}:{password}@{host}:{port}".format(
|
||||
host="localhost", port=self.mongo_port, user="root", password="clickhouse"
|
||||
host="localhost", port=self.mongo_port, user=mongo_user, password=mongo_pass
|
||||
)
|
||||
if secure:
|
||||
connection_str += "/?tls=true&tlsAllowInvalidCertificates=true"
|
||||
@ -1969,8 +1971,8 @@ class ClickHouseCluster:
|
||||
)
|
||||
minio_client = Minio(
|
||||
f"{self.minio_ip}:{self.minio_port}",
|
||||
access_key="minio",
|
||||
secret_key="minio123",
|
||||
access_key=minio_access_key,
|
||||
secret_key=minio_secret_key,
|
||||
secure=secure,
|
||||
http_client=urllib3.PoolManager(cert_reqs="CERT_NONE"),
|
||||
) # disable SSL check as we test ClickHouse and not Python library
|
||||
@ -3488,16 +3490,16 @@ class ClickHouseInstance:
|
||||
"MySQL": {
|
||||
"DSN": "mysql_odbc",
|
||||
"Driver": "/usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so",
|
||||
"Database": "clickhouse",
|
||||
"Uid": "root",
|
||||
"Pwd": "clickhouse",
|
||||
"Database": odbc_mysql_db,
|
||||
"Uid": odbc_mysql_uid,
|
||||
"Pwd": odbc_mysql_pass,
|
||||
"Server": self.cluster.mysql_host,
|
||||
},
|
||||
"PostgreSQL": {
|
||||
"DSN": "postgresql_odbc",
|
||||
"Database": "postgres",
|
||||
"UserName": "postgres",
|
||||
"Password": "mysecretpassword",
|
||||
"Database": odbc_psql_db,
|
||||
"UserName": odbc_psql_user,
|
||||
"Password": odbc_psql_pass,
|
||||
"Port": str(self.cluster.postgres_port),
|
||||
"Servername": self.cluster.postgres_host,
|
||||
"Protocol": "9.3",
|
||||
|
31
tests/integration/helpers/config_cluster.py
Normal file
31
tests/integration/helpers/config_cluster.py
Normal file
@ -0,0 +1,31 @@
|
||||
# MYSQL CREDENTIALS
|
||||
mysql_user = "root"
|
||||
mysql_pass = "clickhouse"
|
||||
|
||||
|
||||
# MYSQL8 CREDENTIALS
|
||||
mysql8_user = "root"
|
||||
mysql8_pass = "clickhouse"
|
||||
|
||||
# POSTGRES CREDENTIALS
|
||||
pg_user = "postgres"
|
||||
pg_pass = "mysecretpassword"
|
||||
pg_db = "postgres"
|
||||
|
||||
|
||||
# MINIO CREDENTIALS
|
||||
minio_access_key = "minio"
|
||||
minio_secret_key = "minio123"
|
||||
|
||||
# MONGODB CREDENTIALS
|
||||
mongo_user = "root"
|
||||
mongo_pass = "clickhouse"
|
||||
|
||||
# ODBC CREDENTIALS
|
||||
odbc_mysql_uid = "root"
|
||||
odbc_mysql_pass = "clickhouse"
|
||||
odbc_mysql_db = "clickhouse"
|
||||
|
||||
odbc_psql_db = "postgres"
|
||||
odbc_psql_user = "postgres"
|
||||
odbc_psql_pass = "mysecretpassword"
|
Loading…
Reference in New Issue
Block a user