test: handle gracefully if decompressor tools are not installed (#7455)
Fixes: #7441
This commit is contained in:
parent
cfb56a72ce
commit
698470609c
|
@ -27,6 +27,7 @@
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
|
#include "path-util.h"
|
||||||
#include "random-util.h"
|
#include "random-util.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
@ -157,9 +158,15 @@ static void test_compress_stream(int compression,
|
||||||
char pattern[] = "/tmp/systemd-test.compressed.XXXXXX",
|
char pattern[] = "/tmp/systemd-test.compressed.XXXXXX",
|
||||||
pattern2[] = "/tmp/systemd-test.compressed.XXXXXX";
|
pattern2[] = "/tmp/systemd-test.compressed.XXXXXX";
|
||||||
int r;
|
int r;
|
||||||
_cleanup_free_ char *cmd = NULL, *cmd2;
|
_cleanup_free_ char *cmd = NULL, *cmd2 = NULL;
|
||||||
struct stat st = {};
|
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 */",
|
log_debug("/* testing %s compression */",
|
||||||
object_compressed_to_string(compression));
|
object_compressed_to_string(compression));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue