Skip to content

Commit

Permalink
ipatests: Added testcase to check logrotate is added for healthcheck …
Browse files Browse the repository at this point in the history
…tool

Issue: freeipa/freeipa-healthcheck#35
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Mohammad Rizwan Yusuf <myusuf@redhat.com>
Reviewed-By: Anuja More <amore@redhat.com>
  • Loading branch information
menonsudhir authored and flo-renaud committed Mar 20, 2020
1 parent 2997a74 commit c77f421
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ipatests/test_integration/test_ipahealthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"auditSigningCert cert-pki-ca",
"Server-Cert cert-pki-ca",
]

DEFAULT_PKI_KRA_CERTS = [
"transportCert cert-pki-kra",
"storageCert cert-pki-kra",
Expand Down Expand Up @@ -402,6 +403,28 @@ def test_ipa_healthcheck_dna_plugin_returns_warning_pagure_issue_60(self):
for check in data:
assert check["result"] == "SUCCESS"

def test_ipa_healthcheck_log_rotate_file_exist_issue35(self):
"""
This test checks if log rotation has been added
for ipa-healthcheck tool so that logs are rotated
in /var/log/ipa/healthcheck folder.
The test also checks that the logrotate configuration
file is syntactically correct by calling logrotate --debug
This is a testcase for below pagure issue
https://github.com/freeipa/freeipa-healthcheck/issues/35
"""
msg = "error: {}:".format(HEALTHCHECK_LOG_ROTATE_CONF)
tasks.uninstall_packages(self.master, HEALTHCHECK_PKG)
assert not self.master.transport.file_exists(
HEALTHCHECK_LOG_ROTATE_CONF
)
tasks.install_packages(self.master, HEALTHCHECK_PKG)
assert self.master.transport.file_exists(HEALTHCHECK_LOG_ROTATE_CONF)
cmd = self.master.run_command(
['logrotate', '--debug', HEALTHCHECK_LOG_ROTATE_CONF]
)
assert msg not in cmd.stdout_text

def test_ipa_healthcheck_remove(self):
"""
This testcase checks the removal of of healthcheck tool
Expand Down

0 comments on commit c77f421

Please sign in to comment.