Fix TestSubCAkeyReplication providing the right path to pki log

The pki debug log has its name in this format: debug.<date>.log. This commit
changes the code to use this format, fixing the test.

Unfortunately, it's not possible to use some kind of regex (like debug.*.log)
to get the file, because python multihost gets the path and tries to open
(using the "open" python function) the file with that.

https://pagure.io/freeipa/issue/7095

Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Felipe Barreto 2018-04-02 10:44:02 -03:00 committed by Florence Blanc-Renaud
parent 6b145bf3e6
commit a947695ab0

View File

@ -609,7 +609,10 @@ class TestSubCAkeyReplication(IntegrationTest):
tasks.run_certutil(replica, ['-L', '-n', cert_nick],
paths.PKI_TOMCAT_ALIAS_DIR)
pki_debug_log = replica.get_file_contents(self.PKI_DEBUG_PATH,
pki_log_filename = ("{path}.{date}.log"
.format(path=self.PKI_DEBUG_PATH,
date=time.strftime("%Y-%m-%d")))
pki_debug_log = replica.get_file_contents(pki_log_filename,
encoding='utf-8')
# check for cert/key import error message
assert self.ERR_MESS not in pki_debug_log