Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Commit 76c698e

Browse files
authored
Update fuzzit.sh to latest fuzzit; more comments
Made it easier to re-use by defining TARGET variable.
1 parent 57576cf commit 76c698e

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

ci/fuzzit.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,35 @@ fi
1212

1313
if [ -z "${FUZZIT_API_KEY}" ]; then
1414
echo "Please set env variable FUZZIT_API_KEY to api key for your project"
15+
echo "Api key for your account: https://app.fuzzit.dev/orgs/<ACCOUNT>/settings"
1516
exit 1
1617
fi
1718

1819
## Install go-fuzz
1920
go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
2021

21-
## build fuzzer
22+
## build fuzz target
2223
go build ./...
23-
go-fuzz-build -libfuzzer -o fuzzer.a .
24-
clang -fsanitize=fuzzer fuzzer.a -o fuzzer
2524

26-
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.2/fuzzit_Linux_x86_64
25+
# target name can only contain lower-case letters (a-z), digits (0-9) and a dash (-)
26+
TARGET=parse-complex
27+
28+
go-fuzz-build -libfuzzer -o ${TARGET}.a .
29+
clang -fsanitize=fuzzer ${TARGET}.a -o ${TARGET}
30+
31+
# you can repeat the above for more fuzzing targets
32+
33+
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.12/fuzzit_Linux_x86_64
2734
chmod a+x fuzzit
35+
36+
# authenticate with fuzzit.dev server using api key from settings panel in the dashboard
2837
./fuzzit auth ${FUZZIT_API_KEY}
2938

39+
# create fuzzing target on the server if it doesn't already exist
40+
./fuzzit create target ${TARGET} || true
41+
3042
if [ $1 == "fuzzing" ]; then
31-
./fuzzit create job --branch $TRAVIS_BRANCH --revision $TRAVIS_COMMIT parse-complex ./fuzzer
43+
./fuzzit create job --branch $TRAVIS_BRANCH --revision $TRAVIS_COMMIT ${TARGET} ./${TARGET}
3244
else
33-
./fuzzit create job --local parse-complex ./fuzzer
45+
./fuzzit create job --local ${TARGET} ./${TARGET}
3446
fi

0 commit comments

Comments
 (0)