7a9cbd
Adapted version of d1c860e59b52. to make it apply without commits
7a9cbd
7a9cbd
34b4d9bce5 - ipatests: Test ipa user login with wrong password
7a9cbd
ab36d79adc - ipatests: Test for ipa-nis-manage CLI tool.
7a9cbd
7a9cbd
From d1c860e59b5237178066ed963cc2fa50d99cd690 Mon Sep 17 00:00:00 2001
7a9cbd
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
7a9cbd
Date: Wed, 16 Sep 2020 17:07:21 +0200
7a9cbd
Subject: [PATCH] ipatests: check that pkispawn log is not empty
7a9cbd
MIME-Version: 1.0
7a9cbd
Content-Type: text/plain; charset=UTF-8
7a9cbd
Content-Transfer-Encoding: 8bit
7a9cbd
7a9cbd
Since commits:
7a9cbd
https://github.com/dogtagpki/pki/commit/0102d836f4eac0fcea0adddb4c98d5ea05e4e8f6
7a9cbd
https://github.com/dogtagpki/pki/commit/de217557a642d799b1c4c390efa55493707c738e
7a9cbd
pkispawn will not honor the pki_log_level configuration item.
7a9cbd
All 10.9 Dogtag versions have these commits.
7a9cbd
This affects FreeIPA in that it makes debugging Dogtag installation issues next
7a9cbd
to impossible.
7a9cbd
Adding --debug to the pkispawn CLI is required to revert to the previous
7a9cbd
behavior.
7a9cbd
Therefore check that the log is not empty and contains DEBUG+INFO lines.
7a9cbd
7a9cbd
Fixes: https://pagure.io/freeipa/issue/8503
7a9cbd
Signed-off-by: François Cami <fcami@redhat.com>
7a9cbd
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
7a9cbd
Reviewed-By: Christian Heimes <cheimes@redhat.com>
7a9cbd
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
7a9cbd
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
7a9cbd
Reviewed-By: Christian Heimes <cheimes@redhat.com>
7a9cbd
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
7a9cbd
---
7a9cbd
 ipatests/test_integration/test_commands.py | 23 ++++++++++++++++++++++
7a9cbd
 1 file changed, 23 insertions(+)
7a9cbd
7a9cbd
diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
7a9cbd
index fa6abd81e..3a12bcde2 100644
7a9cbd
--- a/ipatests/test_integration/test_commands.py
7a9cbd
+++ b/ipatests/test_integration/test_commands.py
7a9cbd
@@ -1295,3 +1295,26 @@ class TestIPACommand(IntegrationTest):
7a9cbd
             assert msg2 not in result.stderr_text
7a9cbd
         finally:
7a9cbd
             bashrc_backup.restore()
7a9cbd
+
7a9cbd
+    def test_pkispawn_log_is_present(self):
7a9cbd
+        """
7a9cbd
+        This testcase checks if pkispawn logged properly.
7a9cbd
+        It is a candidate from being moved out of test_commands.
7a9cbd
+        """
7a9cbd
+        result = self.master.run_command(
7a9cbd
+            ["ls", "/var/log/pki/"]
7a9cbd
+        )
7a9cbd
+        pkispawnlogfile = None
7a9cbd
+        for file in result.stdout_text.splitlines():
7a9cbd
+            if file.startswith("pki-ca-spawn"):
7a9cbd
+                pkispawnlogfile = file
7a9cbd
+                break
7a9cbd
+        assert pkispawnlogfile is not None
7a9cbd
+        pkispawnlogfile = os.path.sep.join(("/var/log/pki", pkispawnlogfile))
7a9cbd
+        pkispawnlog = self.master.get_file_contents(
7a9cbd
+            pkispawnlogfile, encoding='utf-8'
7a9cbd
+        )
7a9cbd
+        # Totally arbitrary. pkispawn debug logs tend to be > 10KiB.
7a9cbd
+        assert len(pkispawnlog) > 1024
7a9cbd
+        assert "DEBUG" in pkispawnlog
7a9cbd
+        assert "INFO" in pkispawnlog
7a9cbd
-- 
7a9cbd
2.26.2
7a9cbd
7a9cbd
From 97c6d2d2c2359b8ff5585afa0d2e5f5599cd5048 Mon Sep 17 00:00:00 2001
7a9cbd
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
7a9cbd
Date: Thu, 17 Sep 2020 07:31:59 +0200
7a9cbd
Subject: [PATCH] dogtaginstance.py: add --debug to pkispawn
7a9cbd
MIME-Version: 1.0
7a9cbd
Content-Type: text/plain; charset=UTF-8
7a9cbd
Content-Transfer-Encoding: 8bit
7a9cbd
7a9cbd
Since commits:
7a9cbd
https://github.com/dogtagpki/pki/commit/0102d836f4eac0fcea0adddb4c98d5ea05e4e8f6
7a9cbd
https://github.com/dogtagpki/pki/commit/de217557a642d799b1c4c390efa55493707c738e
7a9cbd
pkispawn will not honor the pki_log_level configuration item.
7a9cbd
All 10.9 Dogtag versions have these commits.
7a9cbd
This affects FreeIPA in that it makes debugging Dogtag installation issues next
7a9cbd
to impossible.
7a9cbd
Adding --debug to the pkispawn CLI is required to revert to the previous
7a9cbd
behavior.
7a9cbd
7a9cbd
Fixes: https://pagure.io/freeipa/issue/8503
7a9cbd
Signed-off-by: François Cami <fcami@redhat.com>
7a9cbd
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
7a9cbd
Reviewed-By: Christian Heimes <cheimes@redhat.com>
7a9cbd
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
7a9cbd
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
7a9cbd
Reviewed-By: Christian Heimes <cheimes@redhat.com>
7a9cbd
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
7a9cbd
---
7a9cbd
 ipaserver/install/dogtaginstance.py | 3 ++-
7a9cbd
 1 file changed, 2 insertions(+), 1 deletion(-)
7a9cbd
7a9cbd
diff --git a/ipaserver/install/dogtaginstance.py b/ipaserver/install/dogtaginstance.py
7a9cbd
index 524262ad7..03fdd7c0b 100644
7a9cbd
--- a/ipaserver/install/dogtaginstance.py
7a9cbd
+++ b/ipaserver/install/dogtaginstance.py
7a9cbd
@@ -183,7 +183,8 @@ class DogtagInstance(service.Service):
7a9cbd
         subsystem = self.subsystem
7a9cbd
         args = [paths.PKISPAWN,
7a9cbd
                 "-s", subsystem,
7a9cbd
-                "-f", cfg_file]
7a9cbd
+                "-f", cfg_file,
7a9cbd
+                "--debug"]
7a9cbd
 
7a9cbd
         with open(cfg_file) as f:
7a9cbd
             logger.debug(
7a9cbd
-- 
7a9cbd
2.26.2
7a9cbd