ipatests: healthcheck: Update IPAHostKeytab assumptions

As of 0.9 freeipa-healthcheck requires running `dirsrv` service
for `IPAHostKeytab` check. So, previous assumption about the
triggering the GSSAPI error no longer works. For example, this can
be achieved by deletion of host's keytab.

Fixes: https://pagure.io/freeipa/issue/8889
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Levin 2021-06-21 18:38:50 +03:00 committed by Rob Crittenden
parent 0c2530efe5
commit 3597ab9bac

View File

@ -492,44 +492,29 @@ class TestIpaHealthCheck(IntegrationTest):
assert data[0]["kw"]["ipa_version"] in result.stdout_text assert data[0]["kw"]["ipa_version"] in result.stdout_text
assert data[0]["kw"]["ipa_api_version"] in result.stdout_text assert data[0]["kw"]["ipa_api_version"] in result.stdout_text
def test_source_ipahealthcheck_ipa_host_check_ipahostkeytab( def test_source_ipahealthcheck_ipa_host_check_ipahostkeytab(self):
self, restart_service
):
""" """
Testcase checks behaviour of check IPAHostKeytab in source Testcase checks behaviour of check IPAHostKeytab in source
ipahealthcheck.ipa.host when dirsrv service is stopped and ipahealthcheck.ipa.host when GSSAPI credentials cannot be obtained
running on IPA master from host's keytab.
""" """
msgs = ( msg = (
(
"Failed to obtain host TGT: Major (851968): "
"Unspecified GSS failure. "
"Minor code may provide more information, "
"Minor (2529638972): Generic error (see e-text)"
),
(
"Failed to obtain host TGT: Major (458752): " "Failed to obtain host TGT: Major (458752): "
"No credentials were supplied, or the credentials " "No credentials were "
"were unavailable or inaccessible, " "supplied, or the credentials were unavailable or inaccessible, "
"Minor (2529638972): Generic error (see e-text)" "Minor (2529639107): No credentials cache found"
),
) )
restart_service(self.master, "dirsrv")
dirsrv_ipactl_status = 'Directory Service: STOPPED' with tasks.FileBackup(self.master, paths.KRB5_KEYTAB):
result = self.master.run_command( self.master.run_command(["rm", "-f", paths.KRB5_KEYTAB])
["ipactl", "status"],
raiseonerr=False)
returncode, data = run_healthcheck( returncode, data = run_healthcheck(
self.master, self.master,
"ipahealthcheck.ipa.host", source="ipahealthcheck.ipa.host",
"IPAHostKeytab", check="IPAHostKeytab",
) )
assert returncode == 1 assert returncode == 1
if dirsrv_ipactl_status in result.stdout_text:
assert data[0]["result"] == "ERROR" assert data[0]["result"] == "ERROR"
assert data[0]["kw"]["msg"] in msgs assert data[0]["kw"]["msg"] == msg
else:
assert data[0]["result"] == "SUCCESS"
def test_source_ipahealthcheck_topology_IPATopologyDomainCheck(self): def test_source_ipahealthcheck_topology_IPATopologyDomainCheck(self):
""" """