summaryrefslogtreecommitdiff
path: root/src/journal/test-compress.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-15 13:37:11 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-15 13:37:11 +0200
commitcb181af9b6a8248f6924219db5ce1240dcbff65f (patch)
tree813193d528146695c4ef11a0db80c3c6ff9d0b17 /src/journal/test-compress.c
parent2ac3f19a51869fdecb5edd55372123a8a6400c3c (diff)
parent1a2a0ac53bbe724caf41c2bcf22ab9ea32b63d4e (diff)
Merge pull request #1527 from keszybz/lz4
Using lz4 frame api for coredump files
Diffstat (limited to 'src/journal/test-compress.c')
-rw-r--r--src/journal/test-compress.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
index f17c00e60d..e51b12407f 100644
--- a/src/journal/test-compress.c
+++ b/src/journal/test-compress.c
@@ -144,8 +144,8 @@ static void test_compress_stream(int compression,
const char *srcfile) {
_cleanup_close_ int src = -1, dst = -1, dst2 = -1;
- char pattern[] = "/tmp/systemd-test.xz.XXXXXX",
- pattern2[] = "/tmp/systemd-test.xz.XXXXXX";
+ char pattern[] = "/tmp/systemd-test.compressed.XXXXXX",
+ pattern2[] = "/tmp/systemd-test.compressed.XXXXXX";
int r;
_cleanup_free_ char *cmd = NULL, *cmd2;
struct stat st = {};
@@ -185,7 +185,7 @@ static void test_compress_stream(int compression,
assert_se(lseek(dst, 1, SEEK_SET) == 1);
r = decompress(dst, dst2, st.st_size);
- assert_se(r == -EBADMSG);
+ assert_se(r == -EBADMSG || r == 0);
assert_se(lseek(dst, 0, SEEK_SET) == 0);
assert_se(lseek(dst2, 0, SEEK_SET) == 0);
@@ -236,8 +236,7 @@ int main(int argc, char *argv[]) {
compress_blob_lz4, decompress_startswith_lz4,
data, sizeof(data), true);
- /* Produced stream is not compatible with lz4 binary, skip lz4cat check. */
- test_compress_stream(OBJECT_COMPRESSED_LZ4, NULL,
+ test_compress_stream(OBJECT_COMPRESSED_LZ4, "lz4cat",
compress_stream_lz4, decompress_stream_lz4, argv[0]);
#else
log_info("/* LZ4 test skipped */");