mirror of https://github.com/fail2ban/fail2ban
tests: add missing constraint (causing incomplete comparison in below cycle if fewer lines as expected was found)
parent
a45b1c974c
commit
e587526ede
|
@ -188,6 +188,7 @@ def _assert_correct_last_attempt(utest, filter_, output, count=None):
|
||||||
utest.assertEqual(len(found), 1)
|
utest.assertEqual(len(found), 1)
|
||||||
_assert_equal_entries(utest, found[0], output, count)
|
_assert_equal_entries(utest, found[0], output, count)
|
||||||
else:
|
else:
|
||||||
|
utest.assertEqual(len(found), len(output))
|
||||||
# sort by string representation of ip (multiple failures with different ips):
|
# sort by string representation of ip (multiple failures with different ips):
|
||||||
found = sorted(found, key=lambda x: str(x))
|
found = sorted(found, key=lambda x: str(x))
|
||||||
output = sorted(output, key=lambda x: str(x))
|
output = sorted(output, key=lambda x: str(x))
|
||||||
|
|
Loading…
Reference in New Issue