diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-11-24 14:08:51 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-24 14:08:51 +0100 |
commit | 698470609cf47201101ac0e0cc541f68fb7ee8ba (patch) | |
tree | 7e877a03a18d8777d00b57135744ee4b47f2fbd1 | |
parent | cfb56a72ce21783931662260aaa9914a217b297f (diff) | |
download | systemd-698470609cf47201101ac0e0cc541f68fb7ee8ba.tar.gz |
test: handle gracefully if decompressor tools are not installed (#7455)
Fixes: #7441
-rw-r--r-- | src/journal/test-compress.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c index 1b9b186be3..ea1ffcc4af 100644 --- a/src/journal/test-compress.c +++ b/src/journal/test-compress.c @@ -27,6 +27,7 @@ #include "fd-util.h" #include "fileio.h" #include "macro.h" +#include "path-util.h" #include "random-util.h" #include "util.h" @@ -157,9 +158,15 @@ static void test_compress_stream(int compression, char pattern[] = "/tmp/systemd-test.compressed.XXXXXX", pattern2[] = "/tmp/systemd-test.compressed.XXXXXX"; int r; - _cleanup_free_ char *cmd = NULL, *cmd2; + _cleanup_free_ char *cmd = NULL, *cmd2 = NULL; struct stat st = {}; + r = find_binary(cat, NULL); + if (r < 0) { + log_error_errno(r, "Skipping %s, could not find %s binary: %m", __func__, cat); + return; + } + log_debug("/* testing %s compression */", object_compressed_to_string(compression)); |