From: Otto Moerbeek Date: Wed, 14 Jun 2023 08:08:52 +0000 (+0200) Subject: Fix deprecation warnings and dnstap exception on (expected) broken pipe X-Git-Tag: rec-5.0.0-alpha1~118^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4d2d1167f0c01290fa55029fb556c70857b4dcd;p=thirdparty%2Fpdns.git Fix deprecation warnings and dnstap exception on (expected) broken pipe --- diff --git a/regression-tests.recursor-dnssec/test_Lua.py b/regression-tests.recursor-dnssec/test_Lua.py index 222c9181c1..dad74051f5 100644 --- a/regression-tests.recursor-dnssec/test_Lua.py +++ b/regression-tests.recursor-dnssec/test_Lua.py @@ -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""" diff --git a/regression-tests.recursor-dnssec/test_Notify.py b/regression-tests.recursor-dnssec/test_Notify.py index 689f346b72..622ad37ec6 100644 --- a/regression-tests.recursor-dnssec/test_Notify.py +++ b/regression-tests.recursor-dnssec/test_Notify.py @@ -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) diff --git a/regression-tests.recursor-dnssec/test_RecDnstap.py b/regression-tests.recursor-dnssec/test_RecDnstap.py index 2cde8ee086..8bd2845c45 100644 --- a/regression-tests.recursor-dnssec/test_RecDnstap.py +++ b/regression-tests.recursor-dnssec/test_RecDnstap.py @@ -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)