Skip to content

Commit

Permalink
refactor fuzz-introspector command generation
Browse files Browse the repository at this point in the history
This is to shorten the long line that runs fuzz-introspector and also in
anticipation that down the line we will have more oss-fuzz specific
commands in fuzz-introspector
  • Loading branch information
DavidKorczynski committed Apr 4, 2022
1 parent 8570b9d commit bc657df
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions infra/base-images/base-builder/compile
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,22 @@ if [ "$SANITIZER" = "introspector" ]; then
then
cp $OUT/textcov_reports/*.covreport $SRC/inspector/
fi

if [[ -z "${COVERAGE_URL}" ]]; then
export COVERAGE_URL="/covreport/linux"
fi

cd $SRC/inspector

# Correlate fuzzer binaries to fuzz-introspector's raw data
python3 /fuzz-introspector/post-processing/main.py correlate --binaries_dir=$OUT/
python3 /fuzz-introspector/post-processing/main.py report --target_dir=$SRC/inspector --coverage_url=$COVERAGE_URL --correlation_file=exe_to_fuzz_introspector_logs.yaml

# Generate fuzz-introspector HTML report, this generates
# the file exe_to_fuzz_introspector_logs.yaml
REPORT_ARGS="--target_dir=$SRC/inspector"
# Only pass coverage_url when COVERAGE_URL is set (in cloud builds)
if [[ ! -z "${COVERAGE_URL+x}" ]]; then
REPORT_ARGS="$REPORT_ARGS --coverage_url=${COVERAGE_URL}"
fi
# Use the just-generated correlation file
REPORT_ARGS="$REPORT_ARGS --correlation_file=exe_to_fuzz_introspector_logs.yaml"
python3 /fuzz-introspector/post-processing/main.py report $REPORT_ARGS

cp -rf $SRC/inspector $OUT/inspector
fi
Expand Down

0 comments on commit bc657df

Please sign in to comment.