diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2021-12-26 23:26:56 +0000 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2021-12-29 10:39:06 +0000 |
commit | 4b65fc8725fa169bf870eb022d7b346796977c21 (patch) | |
tree | 1031e56ec9c9e35dca4f4d69f5a12520c81ecd8e /tools | |
parent | b3bfe6b9e1f150793d94ba398f47d672165fffef (diff) | |
download | systemd-4b65fc8725fa169bf870eb022d7b346796977c21.tar.gz |
tests: add fuzz-bcd
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/oss-fuzz.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh index 244eb83906..620015658e 100755 --- a/tools/oss-fuzz.sh +++ b/tools/oss-fuzz.sh @@ -36,6 +36,13 @@ else apt-get install -y gperf m4 gettext python3-pip \ libcap-dev libmount-dev libkmod-dev \ pkg-config wget python3-jinja2 + + # gnu-efi is installed here to enable -Dgnu-efi behind which fuzz-bcd + # is hidden. It isn't linked against efi. It doesn't + # even include "efi.h" because "bcd.c" can work in "unit test" mode + # where it isn't necessary. + apt-get install -y gnu-efi zstd + pip3 install -r .github/workflows/requirements.txt --require-hashes # https://github.com/google/oss-fuzz/issues/6868 @@ -56,6 +63,15 @@ fi ninja -v -C "$build" fuzzers +# Compressed BCD files are kept in test/test-bcd so let's unpack them +# and put them all in the seed corpus. +bcd=$(mktemp -d) +for i in test/test-bcd/*.zst; do + unzstd "$i" -o "$bcd/$(basename "${i%.zst}")"; +done +zip -jqr "$OUT/fuzz-bcd_seed_corpus.zip" "$bcd" +rm -rf "$bcd" + # The seed corpus is a separate flat archive for each fuzzer, # with a fixed name ${fuzzer}_seed_corpus.zip. for d in "$(dirname "$0")/../test/fuzz/fuzz-"*; do |