URL: https://github.com/freeipa/freeipa/pull/1485
Author: flo-renaud
 Title: #1485: test_integration: backup custodia conf and keys
Action: opened

PR body:
"""
Add an integration test for issue 7247 (ipa-backup does not backup
Custodia keys and files)
The test performs backup / uninstall / check custodia files were removed /
restore and check that the custodia conf and keys files are restored.

related ticket https://pagure.io/freeipa/issue/7247
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1485/head:pr1485
git checkout pr1485
From ef83ae42113b7c0cc7ee44eb75e386aae9de1ae0 Mon Sep 17 00:00:00 2001
From: Florence Blanc-Renaud <f...@redhat.com>
Date: Mon, 22 Jan 2018 18:25:47 +0100
Subject: [PATCH] test_integration: backup custodia conf and keys

Add an integration test for issue 7247 (ipa-backup does not backup
Custodia keys and files)
The test performs backup / uninstall / check custodia files were removed /
restore and check that the custodia conf and keys files are restored.

related ticket https://pagure.io/freeipa/issue/7247
---
 ipatests/test_integration/test_backup_and_restore.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ipatests/test_integration/test_backup_and_restore.py b/ipatests/test_integration/test_backup_and_restore.py
index 2e99376da0..13118fd773 100644
--- a/ipatests/test_integration/test_backup_and_restore.py
+++ b/ipatests/test_integration/test_backup_and_restore.py
@@ -24,6 +24,7 @@
 import re
 import contextlib
 
+from ipaplatform.paths import paths
 from ipapython.dn import DN
 from ipatests.test_integration.base import IntegrationTest
 from ipatests.pytest_plugins.integration import tasks
@@ -101,6 +102,13 @@ def check_kinit(host):
     return result
 
 
+def check_custodia_files(host):
+    """regression test for https://pagure.io/freeipa/issue/7247""";
+    assert host.transport.file_exists(paths.IPA_CUSTODIA_KEYS)
+    assert host.transport.file_exists(paths.IPA_CUSTODIA_CONF)
+    return True
+
+
 CHECKS = [
     (check_admin_in_ldap, assert_entries_equal),
     (check_admin_in_cli, assert_results_equal),
@@ -108,6 +116,7 @@ def check_kinit(host):
     (check_certs, assert_results_equal),
     (check_dns, assert_results_equal),
     (check_kinit, assert_results_equal),
+    (check_custodia_files, assert_deepequal)
 ]
 
 
@@ -155,6 +164,10 @@ def test_full_backup_and_restore(self):
             self.master.run_command(['ipa-server-install',
                                      '--uninstall',
                                      '-U'])
+            assert not self.master.transport.file_exists(
+                paths.IPA_CUSTODIA_KEYS)
+            assert not self.master.transport.file_exists(
+                paths.IPA_CUSTODIA_CONF)
 
             dirman_password = self.master.config.dirman_password
             self.master.run_command(['ipa-restore', backup_path],
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to