]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix deprecation warnings and dnstap exception on (expected) broken pipe
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 14 Jun 2023 08:08:52 +0000 (10:08 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 14 Jun 2023 08:21:26 +0000 (10:21 +0200)
regression-tests.recursor-dnssec/test_Lua.py
regression-tests.recursor-dnssec/test_Notify.py
regression-tests.recursor-dnssec/test_RecDnstap.py

index 222c9181c1621db4bb6b1b179f89895aa150818f..dad74051f5d687abc1ccdbefa5e2be0fc2bab903 100644 (file)
@@ -1006,7 +1006,7 @@ end
         """ postresolve_ffi: test that we can do a DROP for a name and type combo"""
         query = dns.message.make_query('example', 'TXT')
         res = self.sendUDPQuery(query)
-        self.assertEquals(res, None)
+        self.assertEqual(res, None)
 
     def testNXDOMAIN(self):
         """ postresolve_ffi: test that we can return a NXDOMAIN for a name and type combo"""
index 689f346b72285eb06b479c2b9d2c199ceaee94d9..622ad37ec6c2e469caa0e8040f65b7ccfa6fdf8b 100644 (file)
@@ -103,9 +103,9 @@ f 3600 IN CNAME f            ; CNAME loop: dirty trick to get a ServFail in an a
             sender = getattr(self, method)
             res = sender(notify)
             self.assertRcodeEqual(res, dns.rcode.NOERROR)
-            self.assertEquals(res.opcode(), 4)
+            self.assertEqual(res.opcode(), 4)
             print(res)
-            self.assertEquals(res.question[0].to_text(), 'example. IN SOA')
+            self.assertEqual(res.question[0].to_text(), 'example. IN SOA')
 
         self.checkRecordCacheMetrics(3, 1)
 
index 2cde8ee08674355b313d311cc53759d3f24f8f81..8bd2845c45f32e7572abbac03edf796e705ea70c 100644 (file)
@@ -186,7 +186,7 @@ class TestRecursorDNSTap(RecursorTest):
                 fstrm_handle_bidir_connection(conn, lambda data: \
                 param.queue.put(data, True, timeout=2.0))
             except socket.error as e:
-                if e.errno == 9:
+                if e.errno == errno.EBADF or e.errno == errno.EPIPE:
                     break
                 sys.stderr.write("Unexpected socket error %s\n" % str(e))
                 sys.exit(1)