Add upstream patches to fix tests in mock, run testsi9ce
parent
cfc0b77c7d
commit
673cc6fe14
@ -0,0 +1,21 @@
|
|||||||
|
commit 1470e3c01d49841335e11ed7ca7898516d1b8be8
|
||||||
|
Author: Steven Hiscocks <steven@hiscocks.me.uk>
|
||||||
|
Date: Wed Mar 19 19:09:07 2014 +0000
|
||||||
|
|
||||||
|
BF: fail2ban.conf reader expected "int" type for `loglevel`
|
||||||
|
|
||||||
|
Closes #657
|
||||||
|
|
||||||
|
diff --git a/fail2ban/client/fail2banreader.py b/fail2ban/client/fail2banreader.py
|
||||||
|
index f17ff92..251c698 100644
|
||||||
|
--- a/fail2ban/client/fail2banreader.py
|
||||||
|
+++ b/fail2ban/client/fail2banreader.py
|
||||||
|
@@ -45,7 +45,7 @@ class Fail2banReader(ConfigReader):
|
||||||
|
return ConfigReader.getOptions(self, "Definition", opts)
|
||||||
|
|
||||||
|
def getOptions(self):
|
||||||
|
- opts = [["int", "loglevel", "INFO" ],
|
||||||
|
+ opts = [["string", "loglevel", "INFO" ],
|
||||||
|
["string", "logtarget", "STDERR"],
|
||||||
|
["string", "dbfile", "/var/lib/fail2ban/fail2ban.sqlite3"],
|
||||||
|
["int", "dbpurgeage", 86400]]
|
@ -0,0 +1,20 @@
|
|||||||
|
commit 175c5934620adb600fe4435732a3887855320669
|
||||||
|
Author: Steven Hiscocks <steven@hiscocks.me.uk>
|
||||||
|
Date: Wed Mar 19 19:30:48 2014 +0000
|
||||||
|
|
||||||
|
TST: Skip badips.py test is no network option set
|
||||||
|
|
||||||
|
diff --git a/fail2ban/tests/utils.py b/fail2ban/tests/utils.py
|
||||||
|
index 456a829..85c1d92 100644
|
||||||
|
--- a/fail2ban/tests/utils.py
|
||||||
|
+++ b/fail2ban/tests/utils.py
|
||||||
|
@@ -209,6 +209,9 @@ def gatherTests(regexps=None, no_network=False):
|
||||||
|
for file_ in os.listdir(
|
||||||
|
os.path.abspath(os.path.dirname(action_d.__file__))):
|
||||||
|
if file_.startswith("test_") and file_.endswith(".py"):
|
||||||
|
+ if no_network and file_ in ['test_badips.py']: #pragma: no cover
|
||||||
|
+ # Test required network
|
||||||
|
+ continue
|
||||||
|
tests.addTest(testloader.loadTestsFromName(
|
||||||
|
"%s.%s" % (action_d.__name__, os.path.splitext(file_)[0])))
|
||||||
|
|
@ -0,0 +1,23 @@
|
|||||||
|
commit 75325da09091f3ae800a2efbcde1a016617e5f1a
|
||||||
|
Author: Steven Hiscocks <steven@hiscocks.me.uk>
|
||||||
|
Date: Wed Mar 19 19:21:23 2014 +0000
|
||||||
|
|
||||||
|
TST: Skip SYSLOG log target test if '/dev/log' not present
|
||||||
|
|
||||||
|
diff --git a/fail2ban/tests/servertestcase.py b/fail2ban/tests/servertestcase.py
|
||||||
|
index 231aecd..c4163db 100644
|
||||||
|
--- a/fail2ban/tests/servertestcase.py
|
||||||
|
+++ b/fail2ban/tests/servertestcase.py
|
||||||
|
@@ -678,6 +678,12 @@ class TransmitterLogging(TransmitterBase):
|
||||||
|
|
||||||
|
self.setGetTest("logtarget", "STDOUT")
|
||||||
|
self.setGetTest("logtarget", "STDERR")
|
||||||
|
+
|
||||||
|
+ def testLogTargetSYSLOG(self):
|
||||||
|
+ if not os.path.exists("/dev/log") and sys.version_info >= (2, 7):
|
||||||
|
+ raise unittest.SkipTest("'/dev/log' not present")
|
||||||
|
+ elif not os.path.exists("/dev/log"):
|
||||||
|
+ return
|
||||||
|
self.setGetTest("logtarget", "SYSLOG")
|
||||||
|
|
||||||
|
def testLogLevel(self):
|
Loading…
Reference in new issue