tests: Create a method that cleans all ipa certs

Upon uninstallation IPA does not remove certs from the system, see
https://fedorahosted.org/freeipa/ticket/4639 for details. This causes
installation failures in several tests. The workaround is to manually remove
certs from all certificate databases used by IPA after each server
uninstallation

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Oleg Fayans authored and David Kupka committed 2016-09-22 15:20:42 +02:00
1 parent 38ad864342
commit c0e16aa3b9
1 file changed
+11
+11
View File
@@ -54,6 +54,17 @@ def get_replica_prepare_stdin(cert_passwords=()):
return '\n'.join(lines + [''])
def ipa_certs_cleanup(host):
host.run_command(['certutil', '-d', paths.NSS_DB_DIR, '-D',
'-n', 'External CA cert'],
raiseonerr=False)
# A workaround for https://fedorahosted.org/freeipa/ticket/4639
result = host.run_command(['certutil', '-L', '-d',
paths.HTTPD_ALIAS_DIR])
for rawcert in result.stdout_text.split('\n')[4: -1]:
cert = rawcert.split(' ')[0]
host.run_command(['certutil', '-D', '-d', paths.HTTPD_ALIAS_DIR,
'-n', cert])
class CALessBase(IntegrationTest):
@classmethod
def install(cls, mh):