URL: https://github.com/freeipa/freeipa/pull/4500 Author: rcritten Title: #4500: [Backport][ipa-4-8] Perform baseline healthcheck Action: opened
PR body: """ This PR was opened automatically because PR #4323 was pushed to master and backport to ipa-4-8 is required. """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/4500/head:pr4500 git checkout pr4500
From 62c366f5f673f721f363acabfbd8051726107a3e Mon Sep 17 00:00:00 2001 From: Rob Crittenden <rcrit...@redhat.com> Date: Sat, 7 Mar 2020 11:59:47 -0500 Subject: [PATCH] Perform baseline healthcheck Run healthcheck on a default installation and ensure that there are no failures. This test ensures that a fresh IPA installation will pass healthcheck. https://bugzilla.redhat.com/show_bug.cgi?id=1774032 --- .../test_integration/test_ipahealthcheck.py | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/ipatests/test_integration/test_ipahealthcheck.py b/ipatests/test_integration/test_ipahealthcheck.py index 84c02dfd34..327d27413b 100644 --- a/ipatests/test_integration/test_ipahealthcheck.py +++ b/ipatests/test_integration/test_ipahealthcheck.py @@ -7,13 +7,14 @@ from __future__ import absolute_import -import json - from ipalib import api from ipapython.ipaldap import realm_to_serverid from ipatests.pytest_ipa.integration import tasks from ipatests.test_integration.base import IntegrationTest +import json +import pytest + HEALTHCHECK_LOG = "/var/log/ipa/healthcheck/healthcheck.log" HEALTHCHECK_SYSTEMD_FILE = ( "/etc/systemd/system/multi-user.target.wants/ipa-healthcheck.timer" @@ -109,7 +110,8 @@ ] -def run_healthcheck(host, source=None, check=None, output_type="json"): +def run_healthcheck(host, source=None, check=None, output_type="json", + failures_only=False): """ Run ipa-healthcheck on the remote host and return the result @@ -132,6 +134,9 @@ def run_healthcheck(host, source=None, check=None, output_type="json"): cmd.append("--output-type") cmd.append(output_type) + if failures_only: + cmd.append("--failures-only") + result = host.run_command(cmd, raiseonerr=False) if result.stdout_text: @@ -371,13 +376,19 @@ def test_source_ipahealthcheck_topology_IPATopologyDomainCheck(self): check["kw"]["suffix"] == "ca" ) - def test_source_ipa_roles_check_crlmanager(self): + @pytest.fixture + def disable_crlgen(self): + """Fixture to disable crlgen then enable it once test is done""" + self.master.run_command(["ipa-crlgen-manage", "disable"]) + yield + self.master.run_command(["ipa-crlgen-manage", "enable"]) + + def test_source_ipa_roles_check_crlmanager(self, disable_crlgen): """ This testcase checks the status of healthcheck tool reflects correct information when crlgen is disabled using ipa-crl-manage disable """ - self.master.run_command(["ipa-crlgen-manage", "disable"]) returncode, data = run_healthcheck( self.master, "ipahealthcheck.ipa.roles", @@ -389,6 +400,19 @@ def test_source_ipa_roles_check_crlmanager(self): assert check["kw"]["key"] == "crl_manager" assert check["kw"]["crlgen_enabled"] is False + def test_ipa_healthcheck_no_errors(self): + """ + Ensure that on a default installation with KRA and DNS + installed ipa-healthcheck runs with no errors. + """ + cmd = tasks.install_kra(self.master) + assert cmd.returncode == 0 + returncode, _unused = run_healthcheck( + self.master, + failures_only=True + ) + assert returncode == 0 + def test_ipa_healthcheck_dna_plugin_returns_warning_pagure_issue_60(self): """ This testcase checks that the status for IPADNARangeCheck on replica
_______________________________________________ FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org