Should help to catch bugs like https://fedorahosted.org/freeipa/ticket/5296

--
Martin^3 Babinsky
From e515bc3aff47ac83807f2ae0b625e0ef8291b7c9 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Mon, 21 Sep 2015 09:58:38 +0200
Subject: [PATCH] CI test for full IPA restore into a running IPA server

Tests the following scenario:

1.) install IPA master
2.) perform backup
3.) uninstall IPA master
4.) install IPA master again
5.) restore backup from 2.)

https://fedorahosted.org/freeipa/ticket/5296
---
 ipatests/test_integration/test_backup_and_restore.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/ipatests/test_integration/test_backup_and_restore.py b/ipatests/test_integration/test_backup_and_restore.py
index 93f5d131c7de2b40d9be9434a372477d5924c1b9..df74fd954d0aa8ba93ca507fa41054ca11faa0e0 100644
--- a/ipatests/test_integration/test_backup_and_restore.py
+++ b/ipatests/test_integration/test_backup_and_restore.py
@@ -153,6 +153,25 @@ class TestBackupAndRestore(IntegrationTest):
             self.master.run_command(['ipa-restore', backup_path],
                                     stdin_text=dirman_password + '\nyes')
 
+    def test_backup_and_restore_with_installed_ipa(self):
+        with restore_checker(self.master):
+            backup_path = backup(self.master)
+            self.log.info('Backup path for %s is %s', self.master, backup_path)
+
+            self.log.info('Uninstalling master')
+            self.master.run_command(['ipa-server-install',
+                                     '--uninstall',
+                                     '-U'])
+
+            self.log.info('Reinstalling IPA master')
+            tasks.install_master(self.master)
+
+            self.log.info('Backing up previous install')
+            dirman_password = self.master.config.dirman_password
+            self.master.run_command(['ipa-restore', backup_path],
+                                    stdin_text=dirman_password + '\nyes')
+            tasks.kinit_admin(self.master)
+
     def test_full_backup_and_restore_with_removed_users(self):
         """regression test for https://fedorahosted.org/freeipa/ticket/3866""";
         with restore_checker(self.master):
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to