URL: https://github.com/freeipa/freeipa/pull/4303
Author: miskopo
 Title: #4303: Test for healthcheck being run on replica with stopped master
Action: opened

PR body:
"""
Test checks whether healthcheck completes successfully from replica even
when IPA services on master are stopped.

Automates: 693fcf36e087e34ebd8cd20fcdb959329c9eb221
Automates: 158bfadfef85dd66f9645b0b6bd4f1cb8a56b53e
Automates: 1fedf08a6de405b87897c4b7ed30f62cae88cd47
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/4303/head:pr4303
git checkout pr4303
From c409eeea7fa65bd6d2cc54e5c658ee99dd4d85dd Mon Sep 17 00:00:00 2001
From: Michal Polovka <mpolo...@redhat.com>
Date: Wed, 4 Mar 2020 12:22:16 +0100
Subject: [PATCH] Test for healthcheck being run on replica with stopped master

Test checks whether healthcheck completes successfully from replica even
when IPA services on master are stopped.

Automates: 693fcf36e087e34ebd8cd20fcdb959329c9eb221
Automates: 158bfadfef85dd66f9645b0b6bd4f1cb8a56b53e
Automates: 1fedf08a6de405b87897c4b7ed30f62cae88cd47
---
 .../test_integration/test_ipahealthcheck.py   | 24 +++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/ipatests/test_integration/test_ipahealthcheck.py b/ipatests/test_integration/test_ipahealthcheck.py
index 177561b41c..721f6cc565 100644
--- a/ipatests/test_integration/test_ipahealthcheck.py
+++ b/ipatests/test_integration/test_ipahealthcheck.py
@@ -7,12 +7,12 @@
 
 from __future__ import absolute_import
 
-from ipatests.test_integration.base import IntegrationTest
-from ipatests.pytest_ipa.integration import tasks
+import json
+
 from ipalib import api
 from ipapython.ipaldap import realm_to_serverid
-
-import json
+from ipatests.pytest_ipa.integration import tasks
+from ipatests.test_integration.base import IntegrationTest
 
 HEALTHCHECK_LOG = "/var/log/ipa/healthcheck/healthcheck.log"
 HEALTHCHECK_SYSTEMD_FILE = (
@@ -494,3 +494,19 @@ def test_ipa_certs_check_ipacertnsstrust(self):
                 check["kw"]["key"] in DEFAULT_PKI_KRA_CERTS
             )
         tasks.uninstall_master(self.master)
+
+
+class TestIpaHealthCheckOnReplica(TestIpaHealthCheck):
+
+    def __init__(self):
+        super(TestIpaHealthCheckOnReplica, self).__init__()
+
+    def test_run_with_stopped_master(self):
+        """
+        Test output of healthcheck where master IPA services are stopped.
+        """
+        self.master.run_command(["ipactl stop"], raiseonerr=True)
+        self.replicas[0].run_command(["ipa-healthcheck",
+                                      "--failures-only",
+                                      "--output-type human"],
+                                     raiseonerr=True)
_______________________________________________
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

Reply via email to