diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index 051c140836..236330e16a 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -2073,9 +2073,9 @@ class NeonProxy(PgProtocol): self, proxy_port: int, http_port: int, + mgmt_port: int, neon_binpath: Path, auth_endpoint=None, - mgmt_port=None, ): super().__init__(dsn=auth_endpoint, port=proxy_port) self.host = "127.0.0.1" @@ -2099,6 +2099,7 @@ class NeonProxy(PgProtocol): str(self.neon_binpath / "proxy"), *["--http", f"{self.host}:{self.http_port}"], *["--proxy", f"{self.host}:{self.proxy_port}"], + *["--mgmt", f"{self.host}:{self.mgmt_port}"], *["--auth-backend", "postgres"], *["--auth-endpoint", self.auth_endpoint], ] @@ -2175,11 +2176,13 @@ def static_proxy( auth_endpoint = f"postgres://proxy:password@{host}:{port}/{dbname}" proxy_port = port_distributor.get_port() + mgmt_port = port_distributor.get_port() http_port = port_distributor.get_port() with NeonProxy( proxy_port=proxy_port, http_port=http_port, + mgmt_port=mgmt_port, neon_binpath=neon_binpath, auth_endpoint=auth_endpoint, ) as proxy: diff --git a/test_runner/regress/test_proxy.py b/test_runner/regress/test_proxy.py index b4647ebbe9..b8cfb21a5b 100644 --- a/test_runner/regress/test_proxy.py +++ b/test_runner/regress/test_proxy.py @@ -8,11 +8,11 @@ from fixtures.log_helper import log from fixtures.neon_fixtures import PSQL, NeonProxy, VanillaPostgres -def test_proxy_select_1(static_proxy): +def test_proxy_select_1(static_proxy: NeonProxy): static_proxy.safe_psql("select 1", options="project=generic-project-name") -def test_password_hack(static_proxy): +def test_password_hack(static_proxy: NeonProxy): user = "borat" password = "password" static_proxy.safe_psql( @@ -24,7 +24,7 @@ def test_password_hack(static_proxy): static_proxy.safe_psql("select 1", sslsni=0, user=user, password=magic) # Must also check that invalid magic won't be accepted. - with pytest.raises(psycopg2.errors.OperationalError): + with pytest.raises(psycopg2.OperationalError): magic = "broken" static_proxy.safe_psql("select 1", sslsni=0, user=user, password=magic) @@ -135,7 +135,7 @@ async def test_psql_session_id(vanilla_pg: VanillaPostgres, link_proxy: NeonProx # Pass extra options to the server. -def test_proxy_options(static_proxy): +def test_proxy_options(static_proxy: NeonProxy): with static_proxy.connect(options="project=irrelevant -cproxytest.option=value") as conn: with conn.cursor() as cur: cur.execute("SHOW proxytest.option")