]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Follow common naming and coding conventions 12071/head
authorMichał Kępień <michal@isc.org>
Thu, 21 May 2026 09:52:56 +0000 (11:52 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 21 May 2026 10:02:20 +0000 (12:02 +0200)
Make the handlers defined in bin/tests/system/resend_loop/ans3/ans.py
follow canonical naming conventions used in other system tests.  Keep
all server initialization code in the main() function.

(cherry picked from commit c5a30a722098f23c1fd3a7cd53de4d5164941dcd)

bin/tests/system/resend_loop/ans3/ans.py

index ad23c82939afeb1e59d9fe34863b2fdd6402c75f..2423fe1314c4bc6af4b30dc8dfbbf30bdabc5ed1 100644 (file)
@@ -37,14 +37,14 @@ def rrset(
     return dns.rrset.from_text(qname, ttl, dns.rdataclass.IN, rtype, rdata)
 
 
-class RootNSHandler(QnameQtypeHandler, StaticResponseHandler):
+class RootNsHandler(QnameQtypeHandler, StaticResponseHandler):
     qnames = ["."]
     qtypes = [dns.rdatatype.NS]
     answer = [rrset(".", dns.rdatatype.NS, "a.root-servers.nil.")]
     additional = [rrset("a.root-servers.nil.", dns.rdatatype.A, "10.53.0.3")]
 
 
-class CookieHandler(DomainHandler):
+class ExampleCookieHandler(DomainHandler):
     domains = ["example."]
 
     def _get_cookie(self, qctx: QueryContext) -> dns.edns.CookieOption | None:
@@ -71,17 +71,13 @@ class CookieHandler(DomainHandler):
             yield DnsResponseSend(qctx.response)
 
 
-def resend_server() -> AsyncDnsServer:
+def main() -> None:
     server = AsyncDnsServer(default_aa=True, default_rcode=dns.rcode.NOERROR)
     server.install_response_handlers(
-        RootNSHandler(),
-        CookieHandler(),
+        RootNsHandler(),
+        ExampleCookieHandler(),
     )
-    return server
-
-
-def main() -> None:
-    resend_server().run()
+    server.run()
 
 
 if __name__ == "__main__":