]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Adapt to Python scripts to black 23.1.0
authorMichal Nowak <mnowak@isc.org>
Fri, 17 Feb 2023 12:16:13 +0000 (13:16 +0100)
committerMichal Nowak <mnowak@isc.org>
Fri, 17 Feb 2023 14:31:52 +0000 (15:31 +0100)
bin/tests/system/chain/ans4/ans.py
bin/tests/system/cookie/ans9/ans.py
bin/tests/system/dnssec/ans10/ans.py
bin/tests/system/forward/ans11/ans.py
bin/tests/system/inline/tests_signed_zone_files.py
bin/tests/system/shutdown/tests_shutdown.py
bin/tests/system/statschannel/generic.py
bin/tests/system/statschannel/generic_dnspython.py
bin/tests/system/statschannel/tests_json.py
bin/tests/system/statschannel/tests_xml.py
bin/tests/system/tcp/tests_tcp.py

index 4d17705ef135e394767ba31b75eb6cdaea484e27..839067faa5e685504f92d19213748b235447013d 100755 (executable)
@@ -265,7 +265,7 @@ def create_response(msg):
         if wantsigs:
             r.answer.append(sigs[-1])
     else:
-        for (i, sig) in rrs:
+        for i, sig in rrs:
             if sig and not wantsigs:
                 continue
             elif sig:
index 70cdf00dc0ebef075a08997654ba4a2b13ab3dc1..5813475eceee2d7367bf198c3b5fbc88661a4a69 100644 (file)
@@ -35,6 +35,7 @@ from dns.rdataclass import *
 from dns.rdatatype import *
 from dns.tsig import *
 
+
 # Log query to file
 def logquery(type, qname):
     with open("qlog", "a") as f:
@@ -54,6 +55,7 @@ except:
 
 dopass2 = False
 
+
 ############################################################################
 #
 # This server will serve valid and spoofed answers. A spoofed answer will
index c2f60e68e536f96bbb7eea5a446a2985b05f3003..dbe49e5e5ab4c43d56dc46fa61de39b268fae107 100644 (file)
@@ -25,6 +25,7 @@ from dns.rdataclass import *
 from dns.rcode import *
 from dns.name import *
 
+
 # Log query to file
 def logquery(type, qname):
     with open("qlog", "a") as f:
index 95993813f8d2af999dc18cc9be92037a74c1d1d3..00b5895f76974d854c7ba4e71b6d0c3d4e8c8970 100644 (file)
@@ -26,6 +26,7 @@ from dns.rdataclass import *
 from dns.rcode import *
 from dns.name import *
 
+
 # Log query to file
 def logquery(type, qname):
     with open("qlog", "a") as f:
index 06806eeb7dc87946832a101be6488e1e684e2cf1..596b756933ee342069e392abc536fff6d266b785 100755 (executable)
@@ -35,7 +35,6 @@ class RawFormatHeader(dict):
 
 
 def test_unsigned_serial_number():
-
     """
     Check whether all signed zone files in the "ns8" subdirectory contain the
     serial number of the unsigned version of the zone in the raw-format header.
index e8fc69e1703c61f740f3e30595d24deaed53312e..46c2d509b183fd08842fa435b1c470c2f1317d44 100755 (executable)
@@ -70,7 +70,6 @@ def do_work(named_proc, resolver, rndc_cmd, kill_method, n_workers, n_queries):
     # We're going to execute queries in parallel by means of a thread pool.
     # dnspython functions block, so we need to circunvent that.
     with ThreadPoolExecutor(n_workers + 1) as executor:
-
         # Helper dict, where keys=Future objects and values are tags used
         # to process results later.
         futures = {}
index 6688ff6db0a89d28690bda1346a94e438ab65daf..5ff09e257049b2745ae4f12e1c8ab2cedb3034e7 100644 (file)
@@ -58,7 +58,6 @@ def check_manykeys(name, zone=None):
 
 
 def zone_mtime(zonedir, name):
-
     try:
         si = os.stat(os.path.join(zonedir, "{}.db".format(name)))
     except FileNotFoundError:
@@ -70,7 +69,6 @@ def zone_mtime(zonedir, name):
 
 
 def test_zone_timers_primary(fetch_zones, load_timers, **kwargs):
-
     statsip = kwargs["statsip"]
     statsport = kwargs["statsport"]
     zonedir = kwargs["zonedir"]
@@ -84,7 +82,6 @@ def test_zone_timers_primary(fetch_zones, load_timers, **kwargs):
 
 
 def test_zone_timers_secondary(fetch_zones, load_timers, **kwargs):
-
     statsip = kwargs["statsip"]
     statsport = kwargs["statsport"]
     zonedir = kwargs["zonedir"]
@@ -98,7 +95,6 @@ def test_zone_timers_secondary(fetch_zones, load_timers, **kwargs):
 
 
 def test_zone_with_many_keys(fetch_zones, load_zone, **kwargs):
-
     statsip = kwargs["statsip"]
     statsport = kwargs["statsport"]
 
index 37e6e89f14bf212947e97890af96c260d53b6b9d..34a0398108ae49971dd2e811d24437e1fcb637de 100644 (file)
@@ -28,7 +28,6 @@ def create_msg(qname, qtype):
 
 
 def udp_query(ip, port, msg):
-
     ans = dns.query.udp(msg, ip, TIMEOUT, port=port)
     assert ans.rcode() == dns.rcode.NOERROR
 
@@ -36,7 +35,6 @@ def udp_query(ip, port, msg):
 
 
 def tcp_query(ip, port, msg):
-
     ans = dns.query.tcp(msg, ip, TIMEOUT, port=port)
     assert ans.rcode() == dns.rcode.NOERROR
 
@@ -90,7 +88,6 @@ def check_traffic(data, expected):
 
 
 def test_traffic(fetch_traffic, **kwargs):
-
     statsip = kwargs["statsip"]
     statsport = kwargs["statsport"]
     port = kwargs["port"]
index 312c6830a6bd6176b4e9a4b0fd09b47d84e7f46a..c4599258ea4365a56ff2ede78286ad280172c4ec 100755 (executable)
@@ -24,7 +24,6 @@ requests = pytest.importorskip("requests")
 
 # JSON helper functions
 def fetch_zones_json(statsip, statsport):
-
     r = requests.get(
         "http://{}:{}/json/v1/zones".format(statsip, statsport), timeout=600
     )
@@ -35,7 +34,6 @@ def fetch_zones_json(statsip, statsport):
 
 
 def fetch_traffic_json(statsip, statsport):
-
     r = requests.get(
         "http://{}:{}/json/v1/traffic".format(statsip, statsport), timeout=600
     )
@@ -47,7 +45,6 @@ def fetch_traffic_json(statsip, statsport):
 
 
 def load_timers_json(zone, primary=True):
-
     name = zone["name"]
 
     # Check if the primary zone timer exists
index 5b187b0f49f8888417d6aab9f59676ba711a46fb..7f0b37e846368bedf6959eb9807824010f8b23b8 100755 (executable)
@@ -25,7 +25,6 @@ requests = pytest.importorskip("requests")
 
 # XML helper functions
 def fetch_zones_xml(statsip, statsport):
-
     r = requests.get(
         "http://{}:{}/xml/v3/zones".format(statsip, statsport), timeout=600
     )
@@ -75,7 +74,6 @@ def fetch_traffic_xml(statsip, statsport):
 
 
 def load_timers_xml(zone, primary=True):
-
     name = zone.attrib["name"]
 
     loaded_el = zone.find("loaded")
index 38343d2cf488ecc2681393b156bc7735ca803501..532b47b958bdb7e62298e13c536b174605e843fb 100644 (file)
@@ -44,7 +44,6 @@ def create_socket(host, port):
 
 def test_tcp_garbage(named_port):
     with create_socket("10.53.0.7", named_port) as sock:
-
         msg = create_msg("a.example.", "A")
         (sbytes, stime) = dns.query.send_tcp(sock, msg, timeout())
         (response, rtime) = dns.query.receive_tcp(sock, timeout())
@@ -67,7 +66,6 @@ def test_tcp_garbage(named_port):
 
 def test_tcp_garbage_response(named_port):
     with create_socket("10.53.0.7", named_port) as sock:
-
         msg = create_msg("a.example.", "A")
         (sbytes, stime) = dns.query.send_tcp(sock, msg, timeout())
         (response, rtime) = dns.query.receive_tcp(sock, timeout())
@@ -91,7 +89,6 @@ def test_tcp_garbage_response(named_port):
 # Regression test for CVE-2022-0396
 def test_close_wait(named_port):
     with create_socket("10.53.0.7", named_port) as sock:
-
         msg = create_msg("a.example.", "A")
         (sbytes, stime) = dns.query.send_tcp(sock, msg, timeout())
         (response, rtime) = dns.query.receive_tcp(sock, timeout())
@@ -114,7 +111,6 @@ def test_close_wait(named_port):
     # 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:
-
         msg = create_msg("a.example.", "A")
         (sbytes, stime) = dns.query.send_tcp(sock, msg, timeout())
         (response, rtime) = dns.query.receive_tcp(sock, timeout())