BF: look for system.journal also under system-state-logs (i.e. /var/log)

as it happens on Debian systems
pull/2025/head
Yaroslav Halchenko 2018-01-21 21:05:32 -05:00 committed by sebres
parent 2f0bc491e2
commit 49be8de902
1 changed files with 16 additions and 5 deletions

View File

@ -1173,11 +1173,22 @@ def get_monitor_failures_journal_testcase(Filter_): # pragma: systemd no cover
super(MonitorJournalFailures, self).tearDown()
def _getRuntimeJournal(self):
# retrieve current system journal path
tmp = Utils.executeCmd('find "$(systemd-path system-runtime-logs)" -name system.journal',
timeout=10, shell=True, output=True);
self.assertTrue(tmp)
return str(tmp[1].decode('utf-8')).split('\n')[0]
"""Retrieve current system journal path
If none found, None will be returned
"""
# Depending on the system, it could be found under /run or /var/log (e.g. Debian)
# which are pointed by different systemd-path variables. We will
# check one at at time until the first hit
for systemd_var in 'system-runtime-logs', 'system-state-logs':
tmp = Utils.executeCmd(
'find "$(systemd-path %s)" -name system.journal' % systemd_var,
timeout=10, shell=True, output=True
)
self.assertTrue(tmp)
out = str(tmp[1].decode('utf-8')).split('\n')[0]
if out:
return out
def testJournalFilesArg(self):
# retrieve current system journal path