mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-24 22:27:41 -05:00
ipatests: check that pkispawn log is not empty
Since commits: https://github.com/dogtagpki/pki/commit/0102d836f4eac0fcea0adddb4c98d5ea05e4e8f6 https://github.com/dogtagpki/pki/commit/de217557a642d799b1c4c390efa55493707c738e pkispawn will not honor the pki_log_level configuration item. All 10.9 Dogtag versions have these commits. This affects FreeIPA in that it makes debugging Dogtag installation issues next to impossible. Adding --debug to the pkispawn CLI is required to revert to the previous behavior. Therefore check that the log is not empty and contains DEBUG+INFO lines. Fixes: https://pagure.io/freeipa/issue/8503 Signed-off-by: François Cami <fcami@redhat.com> Reviewed-By: Thomas Woerner <twoerner@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
1 parent
26ae95f4b4
commit
c31bf3d430
1 file changed
+23
@@ -1295,3 +1295,26 @@ class TestIPACommand(IntegrationTest):
|
||||
)
|
||||
assert result.returncode == 1
|
||||
assert msg in result.stderr_text
|
||||
|
||||
def test_pkispawn_log_is_present(self):
|
||||
"""
|
||||
This testcase checks if pkispawn logged properly.
|
||||
It is a candidate from being moved out of test_commands.
|
||||
"""
|
||||
result = self.master.run_command(
|
||||
["ls", "/var/log/pki/"]
|
||||
)
|
||||
pkispawnlogfile = None
|
||||
for file in result.stdout_text.splitlines():
|
||||
if file.startswith("pki-ca-spawn"):
|
||||
pkispawnlogfile = file
|
||||
break
|
||||
assert pkispawnlogfile is not None
|
||||
pkispawnlogfile = os.path.sep.join(("/var/log/pki", pkispawnlogfile))
|
||||
pkispawnlog = self.master.get_file_contents(
|
||||
pkispawnlogfile, encoding='utf-8'
|
||||
)
|
||||
# Totally arbitrary. pkispawn debug logs tend to be > 10KiB.
|
||||
assert len(pkispawnlog) > 1024
|
||||
assert "DEBUG" in pkispawnlog
|
||||
assert "INFO" in pkispawnlog
|
||||
Reference in new issue
Block a user