mirror of https://github.com/fail2ban/fail2ban
fix test for invalid IP (use TEST-NET-1 according to RFC 5737):
since fef031b3cd
failed, because on some platforms like vm:debian 10.0.0.0 returns 'localhost' (intern network).
pull/1002/head
parent
d28880fdca
commit
c5ba76aab8
|
@ -1023,7 +1023,8 @@ class DNSUtilsTests(unittest.TestCase):
|
||||||
def testIpToName(self):
|
def testIpToName(self):
|
||||||
res = DNSUtils.ipToName('66.249.66.1')
|
res = DNSUtils.ipToName('66.249.66.1')
|
||||||
self.assertEqual(res, 'crawl-66-249-66-1.googlebot.com')
|
self.assertEqual(res, 'crawl-66-249-66-1.googlebot.com')
|
||||||
res = DNSUtils.ipToName('10.0.0.0')
|
# invalid ip (TEST-NET-1 according to RFC 5737)
|
||||||
|
res = DNSUtils.ipToName('192.0.2.0')
|
||||||
self.assertEqual(res, None)
|
self.assertEqual(res, None)
|
||||||
|
|
||||||
def testAddr2bin(self):
|
def testAddr2bin(self):
|
||||||
|
|
Loading…
Reference in New Issue