]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: further extend our collection of corrupted journals
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 3 May 2023 09:06:01 +0000 (11:06 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 3 May 2023 15:22:37 +0000 (17:22 +0200)
And make adding them slightly easier.

Provides coverage for b5335da7a5.

test/test-journals/corrupted/id:000000,src:000031,time:210669947,execs:34191940,op:havoc,rep:32.zst [new file with mode: 0644]
test/units/testsuite-04.sh

diff --git a/test/test-journals/corrupted/id:000000,src:000031,time:210669947,execs:34191940,op:havoc,rep:32.zst b/test/test-journals/corrupted/id:000000,src:000031,time:210669947,execs:34191940,op:havoc,rep:32.zst
new file mode 100644 (file)
index 0000000..4090680
Binary files /dev/null and b/test/test-journals/corrupted/id:000000,src:000031,time:210669947,execs:34191940,op:havoc,rep:32.zst differ
index 3a7c0347ae4ec65780f47995701334a732150270..7ed91896232cd453d1df602dc4a2a0b0b8ebd0c2 100755 (executable)
@@ -323,6 +323,10 @@ JOURNAL_DIR="$(mktemp -d)"
 REMOTE_OUT="$(mktemp -d)"
 # tar on C8S doesn't support the --zstd option
 unzstd --stdout "/test-journals/afl-corrupted-journals.tar.zst" | tar -xC "$JOURNAL_DIR/"
+while read -r file; do
+    filename="${file##*/}"
+    unzstd "$file" -o "$JOURNAL_DIR/${filename%*.zst}"
+done < <(find /test-journals/corrupted/ -name "*.zst")
 # First, try each of them sequentially. Skip this part when running with plain
 # QEMU, as it is excruciatingly slow
 # Note: we care only about exit code 124 (timeout) and special bash exit codes