The nightly test test_ipahealthcheck.py::TestIpaHealthCheck::test_source_ipahealthcheck_meta_services_check is failing when it is run with ipa-healthcheck 0.14. Example of test run in PR #3024 with the following logs and report:
test_ipahealthcheck.py::TestIpaHealthCheck::test_source_ipahealthcheck_meta_services_check
self = <ipatests.test_integration.test_ipahealthcheck.TestIpaHealthCheck object at 0x7fa4807a47d0> restart_service = <function restart_service.<locals>._stop_service at 0x7fa4806e9800> def test_source_ipahealthcheck_meta_services_check(self, restart_service): """ Testcase checks behaviour of check configured services in ipahealthcheck.meta.services when service is stopped and started respectively """ svc_list = ('certmonger', 'gssproxy', 'httpd', 'ipa_custodia', 'ipa_dnskeysyncd', 'kadmin', 'krb5kdc', 'named', 'pki_tomcatd', 'sssd', 'dirsrv') for service in svc_list: returncode, data = run_healthcheck( self.master, "ipahealthcheck.meta.services", service, ) assert returncode == 0 assert data[0]["check"] == service assert data[0]["result"] == "SUCCESS" assert data[0]["kw"]["status"] is True for service in svc_list: restart_service(self.master, service) returncode, data = run_healthcheck( self.master, "ipahealthcheck.meta.services", service, ) assert returncode == 1 service_found = False for check in data: if check["check"] != service: continue if service != 'pki_tomcatd': service = service.replace('_', '-') assert check["result"] == "ERROR" > assert check["kw"]["msg"] == "%s: not running" % service E AssertionError: assert 'pki-tomcatd: not running' == 'pki_tomcatd: not running' E - pki_tomcatd: not running E ? ^ E + pki-tomcatd: not running E ? ^
The test is stopping pki-tomcatd then executes ipa-healthcheck and ensure that the command reports pki-tomcatd service is down. It expects the service name to be pki_tomcatd (with an underscore) but ipa-healthcheck 0.14 shows the service name as pki-tomcatd (with a dash).
pki_tomcatd
pki-tomcatd
The test needs to be adapted to be compatible with all healthcheck versions. Example of output:
[root@server]$ rpm -qa freeipa-healthcheck freeipa-healthcheck-0.12-2.fc38.noarch [root@server]$ ipa-healthcheck --source ipahealthcheck.meta.services --check pki_tomcatd [ { "source": "ipahealthcheck.meta.services", "check": "pki_tomcatd", "result": "ERROR", "uuid": "0f4987e6-f969-4b35-9272-f6acd776d169", "when": "20230929081739Z", "duration": "0.000386", "kw": { "status": false, "msg": "pki_tomcatd: not running" } } ] [root@server]$ dnf update -y freeipa-healthcheck --enablerepo updates-testing ... Complete! [root@server]$ rpm -qa freeipa-healthcheck freeipa-healthcheck-0.14-1.fc38.noarch [root@server]$ ipa-healthcheck --source ipahealthcheck.meta.services --check pki_tomcatd [ { "source": "ipahealthcheck.meta.services", "check": "pki_tomcatd", "result": "ERROR", "uuid": "98dd561d-9125-4ba1-b55e-cdc7630b2940", "when": "20230929081806Z", "duration": "0.000379", "kw": { "status": false, "msg": "pki-tomcatd: not running" } } ]
Metadata Update from @frenaud: - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/7022
master:
ipa-4-11:
ipa-4-10:
Metadata Update from @frenaud: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.