ipatests: Healthcheck should ignore pki errors when CA is not configured

Test if ipa-healthcheck complains about pki.server.healthcheck errors
when CA is not configured on the replica.

Related: https://github.com/freeipa/freeipa-healthcheck/issues/201

Signed-off-by: Michal Polovka <mpolovka@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Michal Polovka committed 2022-06-16 10:47:37 +02:00
1 parent ca95acc7f8
commit b2bbf81659
1 file changed
+39
@@ -507,6 +507,45 @@ class TestIpaHealthCheck(IntegrationTest):
assert additional_msg in check["kw"]["msg"] or \
additional_msg == check["kw"]["error"]
def test_ipahealthcheck_ca_not_configured(self):
"""
Test if the healthcheck ignores pki-tomcat errors
when CA is not configured on the machine
Related: https://github.com/freeipa/freeipa-healthcheck/issues/201
"""
# uninstall replica installed by class' install method
tasks.uninstall_replica(self.master, self.replicas[0])
# install it again without CA
tasks.install_replica(self.master,
self.replicas[0],
setup_ca=False,
setup_dns=True,
extra_args=['--no-dnssec-validation']
)
# Init a user on replica to assign a DNA range
tasks.kinit_admin(self.replicas[0])
tasks.user_add(
self.replicas[0], 'ipauser1', first='Test', last='User',
)
returncode, data = run_healthcheck(self.replicas[0],
failures_only=True)
assert returncode == 0
assert len(data) == 0
# restore the replica original configuration
tasks.user_del(self.replicas[0], 'ipauser1')
tasks.uninstall_replica(self.master, self.replicas[0])
tasks.install_replica(
self.master,
self.replicas[0],
setup_dns=True,
extra_args=['--no-dnssec-validation']
)
def test_source_ipahealthcheck_meta_core_metacheck(self):
"""
Testcase checks behaviour of check MetaCheck in source