diff --git a/test/resources/systemd.resource b/test/resources/systemd.resource index 1ab890b014..6b25ca71c2 100644 --- a/test/resources/systemd.resource +++ b/test/resources/systemd.resource @@ -85,3 +85,21 @@ Systemctl Daemon Reload ... sudo=True return_stdout=True return_stderr=True return_rc=True Log Many ${stdout} ${stderr} Should Be Equal As Integers 0 ${rc} + +Disable Journal Rate Limiting + [Documentation] Disable journald rate limiting by writing a drop-in that + ... sets RateLimitBurst=0, then restarting the journal service. + ${stdout} ${stderr} ${rc}= Execute Command + ... printf '[Journal]\nRateLimitBurst=0\n' > /etc/systemd/journald.conf.d/disable-ratelimit.conf && systemctl restart systemd-journald + ... sudo=True return_stdout=True return_stderr=True return_rc=True + Log Many ${stdout} ${stderr} + Should Be Equal As Integers 0 ${rc} + +Enable Journal Rate Limiting + [Documentation] Re-enable default journald rate limiting by removing the + ... drop-in created by Disable Journal Rate Limiting. + ${stdout} ${stderr} ${rc}= Execute Command + ... rm -f /etc/systemd/journald.conf.d/disable-ratelimit.conf && systemctl restart systemd-journald + ... sudo=True return_stdout=True return_stderr=True return_rc=True + Log Many ${stdout} ${stderr} + Should Be Equal As Integers 0 ${rc} diff --git a/test/suites/configuration2/logging.robot b/test/suites/configuration2/logging.robot index 7a404d98a1..963ef4a17b 100644 --- a/test/suites/configuration2/logging.robot +++ b/test/suites/configuration2/logging.robot @@ -4,6 +4,7 @@ Documentation Tests for case-insensitive log level parsing Resource ../../resources/common.resource Resource ../../resources/microshift-config.resource Resource ../../resources/microshift-process.resource +Resource ../../resources/systemd.resource Library ../../resources/journalctl.py Suite Setup Setup @@ -29,10 +30,12 @@ Setup Check Required Env Variables Login MicroShift Host Setup Kubeconfig + Disable Journal Rate Limiting Teardown [Documentation] Test suite teardown Remove Drop In MicroShift Config 10-loglevel + Enable Journal Rate Limiting Restart MicroShift Logout MicroShift Host Remove Kubeconfig