Updating fuzzing script with list of target.

Signed-off-by: Samuele Resca <samuele.resca@gmail.com>
This commit is contained in:
Samuele Resca 2022-10-23 12:48:21 +01:00 committed by Samuele Resca
parent b58f9c27e4
commit 37d62ba477
2 changed files with 11 additions and 9 deletions

View File

@ -5,10 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Target: [FuzzRangeRequest, FuzzPutRequest, FuzzDeleteRangeRequest]
env:
FUZZ_TARGET: ${{matrix.Target}}
TARGET_PATH: ./server/etcdserver/api/v3rpc
steps:
- uses: actions/checkout@v2
@ -19,4 +16,4 @@ jobs:
- uses: actions/upload-artifact@v2
if: failure()
with:
path: "${{env.TARGET_PATH}}/testdata/fuzz/${{env.FUZZ_TARGET}}/*"
path: "${{env.TARGET_PATH}}/testdata/fuzz/**/*"

View File

@ -5,9 +5,14 @@ source ./scripts/test_lib.sh
GO_CMD="go"
fuzz_time=${FUZZ_TIME:-"300s"}
target_path=${TARGET_PATH:-"./server/etcdserver/api/v3rpc"}
fuzz_target=${FUZZ_TARGET:-"FuzzRangeRequest"}
TARGETS="FuzzTxnRangeRequest FuzzTxnPutRequest FuzzTxnDeleteRangeRequest"
for target in ${TARGETS}; do
log_callout -e "\\nExecuting fuzzing with target ${target} in $target_path with a timeout of $fuzz_time\\n"
run pushd ${target_path}
$GO_CMD test -fuzz ${target} -fuzztime ${fuzz_time}
run popd
log_success -e "\\COMPLETED: fuzzing with target $target in $target_path \\n"
done
log_callout -e "\\nExecuting fuzzing with target ${fuzz_target} in $target_path with a timeout of $fuzz_time\\n"
cd "$target_path"
$GO_CMD test -fuzz "$fuzz_target" -fuzztime "$fuzz_time"
log_success -e "\\COMPLETED: fuzzing with target $fuzz_target in $target_path \\n"