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

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