Skip to content

Commit

Permalink
ipatests: fix expected output for ipahealthcheck.meta.services
Browse files Browse the repository at this point in the history
ipa-healthcheck commit 31be12b introduced a change in the output
message when pki-tomcatd is not running.
With versions <= 0.12, the service name is displayed as
pki_tomcatd (with an underscore), but with 0.13+ it is
pki-tomcatd (with a dash).

Fixes: https://pagure.io/freeipa/issue/9460

Signed-off-by: Florence Blanc-Renaud <[email protected]>
Reviewed-By: Rob Crittenden <[email protected]>
  • Loading branch information
flo-renaud authored and rcritten committed Nov 13, 2023
1 parent caccd6c commit 07e5637
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ipatests/test_integration/test_ipahealthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ def test_source_ipahealthcheck_meta_services_check(self, restart_service):
assert data[0]["result"] == "SUCCESS"
assert data[0]["kw"]["status"] is True

version = tasks.get_healthcheck_version(self.master)
# With healthcheck newer versions, the error msg for PKI tomcat
# contains the string pki-tomcatd instead of pki_tomcatd
always_replace = parse_version(version) >= parse_version("0.13")

for service in svc_list:
restart_service(self.master, service)
returncode, data = run_healthcheck(
Expand All @@ -466,7 +471,7 @@ def test_source_ipahealthcheck_meta_services_check(self, restart_service):
for check in data:
if check["check"] != service:
continue
if service != 'pki_tomcatd':
if service != 'pki_tomcatd' or always_replace:
service = service.replace('_', '-')
assert check["result"] == "ERROR"
assert check["kw"]["msg"] == "%s: not running" % service
Expand Down

0 comments on commit 07e5637

Please sign in to comment.