forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continuous Fuzzing Integration with Fuzzit (envoyproxy#7509)
This will introduce another platform (apart from oss) fuzz that will run the long-running fuzzers as well as will introduce "sanity fuzzers" that will run the accumlated corpus and crashes on every Pull-Request to detect bugs early-on in the development cycle. Risk Level: Low - as this will introduce only another step in CircleCI where the fuzzers will be uploaded to Fuzzit and the heavy lifting will be there. Testing: No code is added just a CI code in Circle Signed-off-by: Yevgeny Pats <[email protected]>
- Loading branch information
1 parent
52f393a
commit 28707df
Showing
5 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash -eux | ||
|
||
# Dynamically source fuzzing targets | ||
declare -r FUZZER_TARGETS_CC=$(find . -name *_fuzz_test.cc) | ||
declare -r FUZZER_TARGETS="$(for t in ${FUZZER_TARGETS_CC}; do echo "${t:2:-3}"; done)" | ||
|
||
declare BAZEL_BUILD_TARGETS="" | ||
for t in ${FUZZER_TARGETS} | ||
do | ||
declare BAZEL_PATH="//"$(dirname "$t")":"$(basename "$t") | ||
declare TAGGED=$(bazel query "attr('tags', 'no_fuzz', ${BAZEL_PATH})") | ||
if [ -z "${TAGGED}" ] | ||
then | ||
FILTERED_FUZZER_TARGETS+="$t " | ||
fi | ||
done | ||
|
||
|
||
# run fuzzing regression or upload to Fuzzit for long running fuzzing job ($1 is either local-regression or fuzzing) | ||
wget -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.55/fuzzit_Linux_x86_64 | ||
chmod a+x fuzzit | ||
|
||
PREFIX=$(realpath /build/tmp/_bazel_bazel/*/execroot/envoy/bazel-out/k8-fastbuild/bin) | ||
for t in ${FILTERED_FUZZER_TARGETS} | ||
do | ||
TARGET_BASE="$(expr "$t" : '.*/\(.*\)_fuzz_test')" | ||
# Fuzzit target names can't contain underscore | ||
FUZZIT_TARGET_NAME=${TARGET_BASE//_/-} | ||
if [ $1 == "fuzzing" ]; then | ||
./fuzzit create target --skip-if-exists --public-corpus envoyproxy/"${FUZZIT_TARGET_NAME}" | ||
fi | ||
./fuzzit create job --skip-if-not-exists --type $1 envoyproxy/"${FUZZIT_TARGET_NAME}" "${PREFIX}"/"${t}"_with_libfuzzer | ||
done |