]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fixup! Refactor the existing Python TCP system tests
authorŠtěpán Balážik <stepan@isc.org>
Tue, 16 Jun 2026 16:40:27 +0000 (18:40 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Tue, 16 Jun 2026 16:40:27 +0000 (18:40 +0200)
bin/tests/system/tcp/tests_tcp.py

index 569be5288b6519888d91e5f6d3b94a5d63e3b12a..70c825e90949ed940dd990b0e7f58a54ac45574a 100644 (file)
@@ -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
         )