diff options
author | qrort <qrort@yandex-team.com> | 2023-04-27 14:48:15 +0300 |
---|---|---|
committer | qrort <qrort@yandex-team.com> | 2023-04-27 14:48:15 +0300 |
commit | 681e5dcf61f891c964ad601cb9645adba951dd64 (patch) | |
tree | a7b206f382b76485871f76c98e42c2431a393772 | |
parent | f5b51eeaedd79fd606dea2d586486613cb9f49b5 (diff) | |
download | ydb-681e5dcf61f891c964ad601cb9645adba951dd64.tar.gz |
ydb pg tests with local_pgwire
-rw-r--r-- | ydb/tests/functional/postgresql/test_postgres.py | 35 | ||||
-rw-r--r-- | ydb/tests/library/harness/resources/default_yaml.yml | 4 |
2 files changed, 34 insertions, 5 deletions
diff --git a/ydb/tests/functional/postgresql/test_postgres.py b/ydb/tests/functional/postgresql/test_postgres.py index 86f1ca5dffe..494fbee5ed2 100644 --- a/ydb/tests/functional/postgresql/test_postgres.py +++ b/ydb/tests/functional/postgresql/test_postgres.py @@ -9,7 +9,6 @@ from yatest.common import execute import os import pytest -import time import re @@ -73,30 +72,56 @@ class BasePostgresTest(object): @classmethod def setup_class(cls): cls.cluster = kikimr_cluster_factory(KikimrConfigGenerator( - additional_log_configs={'KQP_YQL': LogLevels.DEBUG, 'KQP_COMPILE_ACTOR': LogLevels.DEBUG, 'KQP_COMPILE_REQUEST': LogLevels.DEBUG} + additional_log_configs={ + 'LOCAL_PGWIRE': LogLevels.DEBUG, + 'KQP_YQL': LogLevels.DEBUG, + 'KQP_COMPILE_ACTOR': LogLevels.DEBUG, + 'KQP_COMPILE_REQUEST': LogLevels.DEBUG + } )) cls.cluster.start() + + @classmethod + def teardown_class(cls): + cls.cluster.stop() + + +class TestPgwireSidecar(object): + @classmethod + def setup_class(cls): + cls.cluster = kikimr_cluster_factory() + cls.cluster.start() cls.endpoint = '%s:%s' % (cls.cluster.nodes[1].host, cls.cluster.nodes[1].port) - time.sleep(2) cls.pgwire, _, _, _ = execute_binary( 'pgwire', [pgwire_binary_path(), '--endpoint={}'.format(cls.endpoint), '--stderr'], wait=False ) - time.sleep(2) @classmethod def teardown_class(cls): cls.pgwire.terminate() cls.cluster.stop() + @pytest.mark.parametrize(['sql', 'out'], get_tests(), ids=get_ids()) + def test_pgwire_sidecar(self, sql, out): + _, _, psql_stderr, psql_stdout = execute_binary( + 'psql', + [psql_binary_path(), 'postgresql://root:1234@localhost:5432/Root', '-w', '-a', '-f', sql], + wait=True, + join_stderr=True + ) + + with open(psql_stdout, 'rb') as stdout_file: + diff_sql(stdout_file.read(), sql, out) + class TestPostgresSuite(BasePostgresTest): @pytest.mark.parametrize(['sql', 'out'], get_tests(), ids=get_ids()) def test_postgres_suite(self, sql, out): _, _, psql_stderr, psql_stdout = execute_binary( 'psql', - [psql_binary_path(), 'postgresql://root:@localhost:5432/Root', '-a', '-f', sql], + [psql_binary_path(), 'host=localhost port=5432 dbname=Root user=root password=1234', '-w', '-a', '-f', sql], wait=True, join_stderr=True ) diff --git a/ydb/tests/library/harness/resources/default_yaml.yml b/ydb/tests/library/harness/resources/default_yaml.yml index 1f183985bfb..76c651040dd 100644 --- a/ydb/tests/library/harness/resources/default_yaml.yml +++ b/ydb/tests/library/harness/resources/default_yaml.yml @@ -77,6 +77,10 @@ domains_config: - property: - type: ROT encryption_mode: 1 + security_config: + default_users: + - name: "root" + password: "1234" static_erasure: "{ydb_static_erasure}" system_tablets: default_node: {ydb_defaut_tablet_node_ids} |