mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-24 14:17:41 -05:00
ipatests: Ignore warnings on failed to read files on tarring
There are tons of useless warnings about missing files on collecting logs, such as: ``` tar: /var/log/ipaserver-kra-install.log: Warning: Cannot stat: No such file or directory tar: /var/log/ipaepn.log: Warning: Cannot stat: No such file or directory tar: /etc/NetworkManager/NetworkManager.conf: Warning: Cannot stat: No such file or directory tar: /var/log/ipabackup.log: Warning: Cannot stat: No such file or directory tar: /var/log/iparestore.log: Warning: Cannot stat: No such file or directory ... ``` Since `--ignore-failed-read` option is passed to tar the caller doesn't care about not readable(mostly missing) files and these warnings may be filtered out. This improves the readability of test logs. Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
1 parent
3889d8654a
commit
afef09ccba
3 files changed
+13
-4
No files matched your search
@@ -14,6 +14,7 @@ function collect_logs() {
|
||||
printf "Collecting logs\n"
|
||||
journalctl -b --no-pager > systemd_journal.log
|
||||
tar --ignore-failed-read -czf "$out_file" \
|
||||
--warning=no-failed-read \
|
||||
/var/log/dirsrv \
|
||||
"$HTTPD_LOGDIR" \
|
||||
/var/log/ipa* \
|
||||
|
||||
@@ -93,7 +93,7 @@ steps:
|
||||
printf "SECCOMP:\n"
|
||||
grep ' SECCOMP ' "$HOST_JOURNAL" && \
|
||||
emit_warning "There are reported SECCOMP syscalls. Please, check the logs."
|
||||
tar --ignore-failed-read -czf "$HOST_JOURNAL_PATH" "$HOST_JOURNAL"
|
||||
tar -czf "$HOST_JOURNAL_PATH" "$HOST_JOURNAL"
|
||||
condition: succeededOrFailed()
|
||||
displayName: Host's systemd journal
|
||||
|
||||
|
||||
@@ -218,9 +218,17 @@ def collect_logs(name, logs_dict, logfile_dir=None, beakerlib_plugin=None):
|
||||
tmpname = cmd.stdout_text.strip()
|
||||
# Tar up the logs on the remote server
|
||||
cmd = host.run_command(
|
||||
['tar', 'cJvf', tmpname, '--ignore-failed-read',
|
||||
'--dereference'] + logs,
|
||||
log_stdout=False, raiseonerr=False)
|
||||
[
|
||||
"tar",
|
||||
"cJvf",
|
||||
tmpname,
|
||||
"--ignore-failed-read",
|
||||
"--warning=no-failed-read",
|
||||
"--dereference",
|
||||
] + logs,
|
||||
log_stdout=False,
|
||||
raiseonerr=False,
|
||||
)
|
||||
if cmd.returncode:
|
||||
logger.warning('Could not collect all requested logs')
|
||||
# fetch tar file
|
||||
|
||||
Reference in new issue
Block a user