From 23192baa5deef64d566fddec13e422abf6bdd6e2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 4 Apr 2018 14:13:39 -0700 Subject: [PATCH] Use better pattern for checking if there are coredumps Signed-off-by: Adam Williamson --- lib/installedtest.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/installedtest.pm b/lib/installedtest.pm index 7f7e3cb5..26de22db 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -50,8 +50,8 @@ sub post_fail_hook { } # upload any core dump files caught by coredumpctl - unless (script_run "tar czvf /var/tmp/coredumps.tar.gz /var/lib/systemd/coredump/") { - upload_logs "/var/tmp/coredumps.tar.gz"; + unless (script_run 'test -n "$(ls -A /var/lib/systemd/coredump)" && cd /var/lib/systemd/coredump && tar czvf coredump.tar.gz *') { + upload_logs "/var/lib/systemd/coredump/coredump.tar.gz"; } # Upload /var/log