From c5ba76aab8c8604fe3a3c2f84e21a962aebd5c50 Mon Sep 17 00:00:00 2001 From: sebres Date: Wed, 25 Mar 2015 01:10:53 +0100 Subject: [PATCH] fix test for invalid IP (use TEST-NET-1 according to RFC 5737): since fef031b3cd41c99a4843d5d5b52217b7694eff72 failed, because on some platforms like vm:debian 10.0.0.0 returns 'localhost' (intern network). --- fail2ban/tests/filtertestcase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fail2ban/tests/filtertestcase.py b/fail2ban/tests/filtertestcase.py index 8fa13dfa..c7c11f61 100644 --- a/fail2ban/tests/filtertestcase.py +++ b/fail2ban/tests/filtertestcase.py @@ -1023,7 +1023,8 @@ class DNSUtilsTests(unittest.TestCase): def testIpToName(self): res = DNSUtils.ipToName('66.249.66.1') 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) def testAddr2bin(self):