-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fuzzing): New hourly job to run fuzzers on CI (#2592)
1. Add a new script `run-all-fuzzers.sh` which runs the fuzzers for a limited amount of turns. 2. Add a hourly job `bazel-run-fuzzers-hourly` which executes each fuzzer for 100 runs. 3. Fix a regression in validator fuzzers due to changes in #1768 --------- Co-authored-by: IDX GitHub Automation <IDX GitHub Automation>
- Loading branch information
1 parent
beafd60
commit f91ac27
Showing
8 changed files
with
101 additions
and
6 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,10 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
sh_binary( | ||
name = "afl_wrapper", | ||
srcs = ["afl_wrapper.sh"], | ||
tags = [ | ||
"afl", | ||
"fuzz_test", | ||
], | ||
) |
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,38 @@ | ||
#!/usr/bin/env bash | ||
# A utility script to run all fuzzers on IC for limited turns defined under MAX_EXECUTIONS | ||
set -ex | ||
|
||
MAX_EXECUTIONS=100 | ||
if [[ -n "$2" ]]; then | ||
MAX_EXECUTIONS=$2 | ||
fi | ||
|
||
case $1 in | ||
-h | --help) | ||
cat <<EOF >&2 | ||
usage: | ||
$0 --libfuzzer 100 # Run all libfuzzer targets. Each target will have 100 executions. | ||
$0 --afl 100 # Run all afl targets. Each target will have 100 executions. | ||
EOF | ||
exit 0 | ||
;; | ||
--libfuzzer) | ||
bazel build --config=fuzzing --build_tag_filters=libfuzzer //rs/... | ||
LIST_OF_FUZZERS=$(bazel query 'attr(tags, "libfuzzer", //rs/...) except attr(tags, "sandbox_libfuzzer", //rs/...)') | ||
for FUZZER in $LIST_OF_FUZZERS; do | ||
bazel run --config=fuzzing $FUZZER -- -runs=$MAX_EXECUTIONS | ||
done | ||
LIST_OF_FUZZERS=$(bazel query 'attr(tags, "sandbox_libfuzzer", //rs/...)') | ||
for FUZZER in $LIST_OF_FUZZERS; do | ||
bazel run --config=sandbox_fuzzing $FUZZER -- -runs=$MAX_EXECUTIONS | ||
done | ||
;; | ||
|
||
--afl) | ||
LIST_OF_FUZZERS=$(bazel query 'attr(tags, "afl", //rs/...)') | ||
bazel build --config=afl //rs/... | ||
for FUZZER in $LIST_OF_FUZZERS; do | ||
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 bazel run --config=afl $FUZZER -- -E $MAX_EXECUTIONS | ||
done | ||
;; | ||
esac |
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