From: Štěpán Balážik Date: Tue, 16 Jun 2026 16:40:27 +0000 (+0200) Subject: fixup! Refactor the existing Python TCP system tests X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a26f8b292f15c8a82aee706c34b6d312147ec15b;p=thirdparty%2Fbind9.git fixup! Refactor the existing Python TCP system tests --- diff --git a/bin/tests/system/tcp/tests_tcp.py b/bin/tests/system/tcp/tests_tcp.py index 569be5288b6..70c825e9094 100644 --- a/bin/tests/system/tcp/tests_tcp.py +++ b/bin/tests/system/tcp/tests_tcp.py @@ -282,8 +282,8 @@ async def send_long_tcp_stream( await asyncio.wait_for(run(), timeout=3 * TIMEOUT) -def test_tcp_garbage(named_port: int) -> None: - with create_socket("10.53.0.7", named_port) as sock: +def test_tcp_garbage(ns7: NamedInstance, named_port: int) -> None: + with create_socket(ns7.ip, named_port) as sock: msg = isctest.query.create( "a.example.", "A", dnssec=False, use_edns=-1, ad=False ) @@ -301,8 +301,8 @@ def test_tcp_garbage(named_port: int) -> None: raise EOFError from e -def test_tcp_garbage_response(named_port: int) -> None: - with create_socket("10.53.0.7", named_port) as sock: +def test_tcp_garbage_response(ns7: NamedInstance, named_port: int) -> None: + with create_socket(ns7.ip, named_port) as sock: msg = isctest.query.create( "a.example.", "A", dnssec=False, use_edns=-1, ad=False ) @@ -321,8 +321,8 @@ def test_tcp_garbage_response(named_port: int) -> None: # Regression test for CVE-2022-0396 -def test_close_wait(named_port: int) -> None: - with create_socket("10.53.0.7", named_port) as sock: +def test_close_wait(ns7: NamedInstance, named_port: int) -> None: + with create_socket(ns7.ip, named_port) as sock: msg = isctest.query.create( "a.example.", "A", dnssec=False, use_edns=-1, ad=False ) @@ -347,7 +347,7 @@ def test_close_wait(named_port: int) -> None: # ns7/named.dropedns and close the socket, making room for the next # request. If it gets stuck in CLOSE_WAIT state, there is no connection # available for the query below and it will time out. - with create_socket("10.53.0.7", named_port) as sock: + with create_socket(ns7.ip, named_port) as sock: msg = isctest.query.create( "a.example.", "A", dnssec=False, use_edns=-1, ad=False ) @@ -355,8 +355,8 @@ def test_close_wait(named_port: int) -> None: # GL #4273 -def test_tcp_big(named_port: int) -> None: - with create_socket("10.53.0.7", named_port) as sock: +def test_tcp_big(ns7: NamedInstance, named_port: int) -> None: + with create_socket(ns7.ip, named_port) as sock: msg = isctest.query.create( dns.name.root, "URI", dnssec=False, use_edns=-1, ad=False, message_id=0 )