From 4a2f4226b899504d86ea85c1636695514d7b5bd4 Mon Sep 17 00:00:00 2001 From: sebres Date: Wed, 26 Jun 2019 17:27:21 +0200 Subject: [PATCH] testIpToName: fixed for reverse IP of google dns (resolving another name now), more dynamic now --- fail2ban/tests/filtertestcase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fail2ban/tests/filtertestcase.py b/fail2ban/tests/filtertestcase.py index 62eb0f212..b8e0e04a0 100644 --- a/fail2ban/tests/filtertestcase.py +++ b/fail2ban/tests/filtertestcase.py @@ -1872,10 +1872,10 @@ def testTextToIp(self): def testIpToName(self): unittest.F2B.SkipIfNoNetwork() res = DNSUtils.ipToName('8.8.4.4') - self.assertEqual(res, 'google-public-dns-b.google.com') + self.assertTrue(res.endswith(('.google', '.google.com'))) # same as above, but with IPAddr: res = DNSUtils.ipToName(IPAddr('8.8.4.4')) - self.assertEqual(res, 'google-public-dns-b.google.com') + self.assertTrue(res.endswith(('.google', '.google.com'))) # invalid ip (TEST-NET-1 according to RFC 5737) res = DNSUtils.ipToName('192.0.2.0') self.assertEqual(res, None)