test: extend freshclam 403 test to test cool-down

Extends the existing freshclam 403 test to check if a repeated freshclam
403 response outputs the cool-down message instead of the original 403
response message.
pull/334/head
Micah Snyder 4 years ago committed by Micah Snyder
parent 87c765b04e
commit 985f0e9d7c
  1. 13
      unit_tests/freshclam_test.py

@ -183,6 +183,19 @@ class TC(testcase.TestCase):
] ]
self.verify_output(output.out, expected=expected_results) self.verify_output(output.out, expected=expected_results)
command = '{valgrind} {valgrind_args} {freshclam} --config-file={freshclam_config} --update-db=daily'.format(
valgrind=TC.valgrind, valgrind_args=TC.valgrind_args, freshclam=TC.freshclam, freshclam_config=TC.freshclam_config
)
output = self.execute_command(command)
assert output.ec == 0 # "fine" (on cooldown, refusing to try again for now)
expected_results = [
'FreshClam previously received error code 429 or 403',
'You are still on cool-down until after',
]
self.verify_output(output.out, expected=expected_results)
def test_freshclam_03_http_403_daemonized(self): def test_freshclam_03_http_403_daemonized(self):
self.step_name('Verify correct behavior when receiving 403 (forbidden) and daemonized') self.step_name('Verify correct behavior when receiving 403 (forbidden) and daemonized')

Loading…
Cancel
Save