From a947695ab034821fb8b70cdc8b66898e5c7ebb45 Mon Sep 17 00:00:00 2001 From: Felipe Barreto Date: Mon, 2 Apr 2018 10:44:02 -0300 Subject: [PATCH] Fix TestSubCAkeyReplication providing the right path to pki log The pki debug log has its name in this format: debug..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 --- ipatests/test_integration/test_replica_promotion.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipatests/test_integration/test_replica_promotion.py b/ipatests/test_integration/test_replica_promotion.py index 4a3182818..a1b56c0cd 100644 --- a/ipatests/test_integration/test_replica_promotion.py +++ b/ipatests/test_integration/test_replica_promotion.py @@ -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