From 7b93f111e1cd137a4d4935e276ae32b712d37008 Mon Sep 17 00:00:00 2001 From: Georges Racinet Date: Tue, 28 Mar 2017 19:29:45 +0200 Subject: [PATCH] test_smtp inconsistency for py3+IPv6 It appears that, under Python3, on an IPv6 enabled machine, the testing SMTP server on 'localhost' can turn out to listen on ::1 only, which makes those tests break if the SMTP client part uses 127.0.0.1 directly. Using 'localhost' there as well makes the tests pass. --- fail2ban/tests/action_d/test_smtp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fail2ban/tests/action_d/test_smtp.py b/fail2ban/tests/action_d/test_smtp.py index d262f73e..d0858b85 100644 --- a/fail2ban/tests/action_d/test_smtp.py +++ b/fail2ban/tests/action_d/test_smtp.py @@ -67,7 +67,7 @@ class SMTPActionTest(unittest.TestCase): port = self.smtpd.socket.getsockname()[1] self.action = customActionModule.Action( - self.jail, "test", host="127.0.0.1:%i" % port) + self.jail, "test", host="localhost:%i" % port) ## because of bug in loop (see loop in asyncserver.py) use it's loop instead of asyncore.loop: self._active = True