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

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