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

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