Skip to content

Instantly share code, notes, and snippets.

@sitedyno
Created March 24, 2013 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sitedyno/5233759 to your computer and use it in GitHub Desktop.
Save sitedyno/5233759 to your computer and use it in GitHub Desktop.
fail2ban/systemd unit tests & timezones
root@cb-l ~/fail2ban/src/fail2ban [systemd-journald*]
$ timedatectl set-timezone Europe/London
root@cb-l ~/fail2ban/src/fail2ban [systemd-journald*]
$ python2 ./fail2ban-testcases
Fail2ban 0.8.8 test suite. Python 2.7.3 (default, Dec 22 2012, 21:27:36) [GCC 4.7.2]. Please wait...
I: Skipping pyinotify backend testing. Got exception 'No module named pyinotify'
...........E.............................
======================================================================
ERROR: testIgnoreIPNOK (testcases.filtertestcase.IgnoreIP)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/fail2ban/src/fail2ban/testcases/filtertestcase.py", line 182, in testIgnoreIPNOK
self.assertFalse(self.filter.inIgnoreIPList(ip))
File "/root/fail2ban/src/fail2ban/server/filter.py", line 279, in inIgnoreIPList
ips = DNSUtils.dnsToIp(i)
File "/root/fail2ban/src/fail2ban/server/filter.py", line 611, in dnsToIp
return socket.gethostbyname_ex(dns)[2]
error: [Errno 11] Resource temporarily unavailable
----------------------------------------------------------------------
Ran 41 tests in 56.517s
FAILED (errors=1)
Please wait...
..
----------------------------------------------------------------------
Ran 2 tests in 5.112s
OK
root@cb-l ~/fail2ban/src/fail2ban [systemd-journald*]
$ timedatectl set-timezone US/Eastern
root@cb-l ~/fail2ban/src/fail2ban [systemd-journald*]
$ python2 ./fail2ban-testcases
Fail2ban 0.8.8 test suite. Python 2.7.3 (default, Dec 22 2012, 21:27:36) [GCC 4.7.2]. Please wait...
I: Skipping pyinotify backend testing. Got exception 'No module named pyinotify'
...........E.............................
======================================================================
ERROR: testIgnoreIPNOK (testcases.filtertestcase.IgnoreIP)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/fail2ban/src/fail2ban/testcases/filtertestcase.py", line 182, in testIgnoreIPNOK
self.assertFalse(self.filter.inIgnoreIPList(ip))
File "/root/fail2ban/src/fail2ban/server/filter.py", line 279, in inIgnoreIPList
ips = DNSUtils.dnsToIp(i)
File "/root/fail2ban/src/fail2ban/server/filter.py", line 611, in dnsToIp
return socket.gethostbyname_ex(dns)[2]
error: [Errno 11] Resource temporarily unavailable
----------------------------------------------------------------------
Ran 41 tests in 57.365s
FAILED (errors=1)
Please wait...
FF
======================================================================
FAIL: MonitorJournalFailures<class 'server.filtersystemd.FilterSystemd'>(monitorjournalfailures-a040d117-b5cd-494b-9569-f5caa787cd18)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/fail2ban/src/fail2ban/testcases/filtertestcase.py", line 620, in test_delJournalMatch
self.assert_correct_ban("193.168.0.128", 3)
File "/root/fail2ban/src/fail2ban/testcases/filtertestcase.py", line 575, in assert_correct_ban
self.assertTrue(self.isFilled(10)) # give Filter a chance to react
AssertionError: False is not true
======================================================================
FAIL: MonitorJournalFailures<class 'server.filtersystemd.FilterSystemd'>(monitorjournalfailures-5d900669-94e6-4bbb-8ade-ebe68599abb7)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/fail2ban/src/fail2ban/testcases/filtertestcase.py", line 598, in test_grow_file
self.assertTrue(self.isFilled(6))
AssertionError: False is not true
----------------------------------------------------------------------
Ran 2 tests in 16.810s
FAILED (failures=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment