From 985f0e9d7c31350225ec9d0e3946ac28defc80a0 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Wed, 6 Oct 2021 17:09:13 -0700 Subject: [PATCH] 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. --- unit_tests/freshclam_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/unit_tests/freshclam_test.py b/unit_tests/freshclam_test.py index 8b8917755..8c367e5ee 100644 --- a/unit_tests/freshclam_test.py +++ b/unit_tests/freshclam_test.py @@ -183,6 +183,19 @@ class TC(testcase.TestCase): ] 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): self.step_name('Verify correct behavior when receiving 403 (forbidden) and daemonized')