Changed multi-line test to provided example

pull/108/head
Steven Hiscocks 12 years ago
parent 055aeeb227
commit 00ab425492

@ -1,12 +1,24 @@
Aug 14 11:59:58 [sshd] Invalid user toto
from 212.41.96.185
Aug 14 11:59:58 [sshd] Invalid user toto
from 212.41.96.185
Aug 14 11:59:58 [sshd] Invalid user duck
from 212.41.96.185
Aug 14 11:59:58 [sshd] Invalid user toto
from 212.41.96.185
Aug 14 11:59:58 [sshd] Invalid user duck...
Aug 14 11:59:58 [sshd] from 212.41.96.185
Aug 14 11:59:58 [sshd] Invalid user duck...
Aug 14 11:59:58 [sshd] from 212.41.96.185
Aug 14 11:58:58 yyyy rsyncd[23864]: connect from example.com (192.0.43.10)
Aug 14 11:59:58 yyyy rsyncd[23864]: rsync on xxx/ from example.com (192.0.43.10)
Aug 14 11:59:58 yyyy rsyncd[23864]: building file list
Aug 14 11:59:58 yyyy rsyncd[28101]: connect from irrelevant (192.0.43.11)
Aug 14 11:59:58 yyyy rsyncd[28101]: rsync on xxx/ from irrelevant (192.0.43.11)
Aug 14 11:59:58 yyyy rsyncd[28101]: building file list
Aug 14 11:59:58 yyyy rsyncd[28101]: sent 294382 bytes received 781 bytes total size 29221543998
Aug 14 11:59:58 yyyy rsyncd[18067]: sent 2833586339 bytes received 65115 bytes total size 29221543998
Aug 14 11:59:58 yyyy smartd[2635]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 116 to 115
Aug 14 11:59:58 yyyy rsyncd[1762]: connect from irrelevant (192.0.43.11)
Aug 14 11:59:58 yyyy rsyncd[1762]: rsync on xxx/ from irrelevant (192.0.43.11)
Aug 14 11:59:58 yyyy rsyncd[1762]: building file list
Aug 14 11:59:58 yyyy rsyncd[1762]: sent 294382 bytes received 781 bytes total size 29221543998
Aug 14 11:59:58 yyyy smartd[2635]: Device: /dev/sda [SAT], starting scheduled Short Self-Test.
Aug 14 11:59:58 yyyy smartd[2635]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 115 to 116
Aug 14 11:59:58 yyyy smartd[2635]: Device: /dev/sdb [SAT], starting scheduled Short Self-Test.
Aug 14 11:59:58 yyyy smartd[2635]: Device: /dev/sda [SAT], previous self-test completed without error
Aug 14 11:59:58 yyyy smartd[2635]: Device: /dev/sdb [SAT], previous self-test completed without error
Aug 14 11:59:58 yyyy rsyncd[7788]: connect from irrelevant (192.0.43.11)
Aug 14 11:59:58 yyyy rsyncd[7788]: rsync on xxx/ from irrelevant (192.0.43.11)
Aug 14 11:59:58 yyyy rsyncd[7788]: building file list
Aug 14 11:59:58 yyyy rsyncd[7788]: sent 294382 bytes received 781 bytes total size 29221543998
Aug 14 11:59:58 yyyy rsyncd[21919]: sent 2836906453 bytes received 6768 bytes total size 29221543998
Aug 14 11:59:58 yyyy rsyncd[23864]: rsync error: timeout in data send/receive (code 30) at io.c(137) [sender=3.0.9]

@ -606,12 +606,11 @@ class GetFailures(unittest.TestCase):
self.assertRaises(FailManagerEmpty, self.filter.failManager.toBan)
def testGetFailuresMultiLine(self):
output = ("212.41.96.185", 3, 1124013598.0)
output = ("192.0.43.10", 1, 1124013598.0)
self.filter.addLogPath(GetFailures.FILENAME_MULTILINE)
self.filter.addFailRegex("Invalid user .+\n.* from <HOST>$")
self.filter.addIgnoreRegex("user duck")
self.filter.setMaxLines(2)
self.filter.addFailRegex("rsyncd\[(?P<pid>\d+)\]: connect from .+ \(<HOST>\)\n(?:.*\n)*?.+ rsyncd\[(?P=pid)\]: rsync error")
self.filter.setMaxLines(100)
self.filter.setMaxRetry(1)
self.filter.getFailures(GetFailures.FILENAME_MULTILINE)

Loading…
Cancel
Save