ipatests: ensure that backup/restore restores pkcs 11 modules config file

In the test_backup_and_restore, add a new test:
- before backup, save the content of /etc/pkcs11/modules/softhsm2.module
- after restore, ensure the file is present with the same content.

Related: https://pagure.io/freeipa/issue/8073
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Florence Blanc-Renaud
2019-09-19 15:25:41 +02:00
committed by Alexander Bokovoy
parent ebec637ab4
commit 71c09ad549

View File

@@ -115,6 +115,17 @@ def check_custodia_files(host):
return True
def check_pkcs11_modules(host):
"""regression test for https://pagure.io/freeipa/issue/8073"""
# Return a dictionary with key = filename, value = file content
# containing all the PKCS11 modules modified by the installer
result = dict()
for filename in platformtasks.get_pkcs11_modules():
assert host.transport.file_exists(filename)
result[filename] = host.get_file_contents(filename)
return result
CHECKS = [
(check_admin_in_ldap, assert_entries_equal),
(check_admin_in_cli, assert_results_equal),
@@ -122,7 +133,8 @@ CHECKS = [
(check_certs, assert_results_equal),
(check_dns, assert_results_equal),
(check_kinit, assert_results_equal),
(check_custodia_files, assert_deepequal)
(check_custodia_files, assert_deepequal),
(check_pkcs11_modules, assert_deepequal)
]