Blame SOURCES/0002-ipatests-error-message-check-in-uninstall-log-for-KR_rhbz#1932289.patch

60b89f
From 6b25cd3241a5609b4d903d5697b8947fab403c90 Mon Sep 17 00:00:00 2001
60b89f
From: Kaleemullah Siddiqui <ksiddiqu@redhat.com>
60b89f
Date: Wed, 17 Feb 2021 19:43:00 +0530
60b89f
Subject: [PATCH] ipatests: error message check in uninstall log for KRA
60b89f
60b89f
This test checks that there is no error message in uninstall
60b89f
log for KRA instance when IPA was installed with KRA.
60b89f
60b89f
related: https://pagure.io/freeipa/issue/8550
60b89f
60b89f
Signed-off-by: Kaleemullah Siddiqui <ksiddiqu@redhat.com>
60b89f
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
60b89f
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
60b89f
---
60b89f
 .../test_backup_and_restore.py                | 22 ++++++++++++++++---
60b89f
 1 file changed, 19 insertions(+), 3 deletions(-)
60b89f
60b89f
diff --git a/ipatests/test_integration/test_backup_and_restore.py b/ipatests/test_integration/test_backup_and_restore.py
60b89f
index f13dfb5cb..6890ef201 100644
60b89f
--- a/ipatests/test_integration/test_backup_and_restore.py
60b89f
+++ b/ipatests/test_integration/test_backup_and_restore.py
60b89f
@@ -451,9 +451,11 @@ class BaseBackupAndRestoreWithKRA(IntegrationTest):
60b89f
 
60b89f
             backup_path = tasks.get_backup_dir(self.master)
60b89f
 
60b89f
-            self.master.run_command(['ipa-server-install',
60b89f
-                                     '--uninstall',
60b89f
-                                     '-U'])
60b89f
+            # check that no error message in uninstall log for KRA instance
60b89f
+            cmd = self.master.run_command(['ipa-server-install',
60b89f
+                                           '--uninstall',
60b89f
+                                           '-U'])
60b89f
+            assert "failed to uninstall KRA" not in cmd.stderr_text
60b89f
 
60b89f
             if reinstall:
60b89f
                 tasks.install_master(self.master, setup_dns=True)
60b89f
@@ -482,6 +484,20 @@ class TestBackupReinstallRestoreWithKRA(BaseBackupAndRestoreWithKRA):
60b89f
         """backup, uninstall, reinstall, restore"""
60b89f
         self._full_backup_restore_with_vault(reinstall=True)
60b89f
 
60b89f
+    def test_no_error_message_with_uninstall_ipa_with_kra(self):
60b89f
+        """Test there is no error message in uninstall log for KRA instance
60b89f
+
60b89f
+        There was error message in uninstall log when IPA with KRA was
60b89f
+        uninstalled. This test check that there is no error message in
60b89f
+        uninstall log for kra instance.
60b89f
+
60b89f
+        related: https://pagure.io/freeipa/issue/8550
60b89f
+        """
60b89f
+        cmd = self.master.run_command(['ipa-server-install',
60b89f
+                                       '--uninstall',
60b89f
+                                       '-U'])
60b89f
+        assert "failed to uninstall KRA" not in cmd.stderr_text
60b89f
+
60b89f
 
60b89f
 class TestBackupAndRestoreWithReplica(IntegrationTest):
60b89f
     """Regression tests for issues 7234 and 7455
60b89f
-- 
60b89f
2.29.2
60b89f