@@ -8,7 +8,7 @@ This is an example of how to integrate your [go-fuzz](https://github.com/dvyukov
88
99This example will show the following steps:
1010* [ Building and running locally a simple go-fuzz target] ( #building-go-fuzz-target )
11- * [ Integrate the go-fuzz target with Fuzzit via Travis-CI] ( #integrating-with-fuzzit )
11+ * [ Integrate the go-fuzz target with Fuzzit via Travis-CI] ( #integrating-with-fuzzit-from-ci )
1212
1313Result:
1414* Fuzzit will run the fuzz targets continuously on daily basis with the latest release.
@@ -82,14 +82,14 @@ go get github.com/fuzzitdev/example-go
8282
8383``` bash
8484cd /go/src/github.com/fuzzitdev/example-go
85- go-fuzz-build -libfuzzer ./.. .
86- clang-9 -fsanitize=fuzzer parser-fuzz .a -o parser-fuzz.libfuzzer
85+ go-fuzz-build -libfuzzer -o fuzzer.a .
86+ clang-9 -fsanitize=fuzzer fuzzer .a -o fuzzer
8787```
8888
8989### Running the fuzzer
9090
9191``` bash
92- ./parser-fuzz.libfuzzer
92+ ./fuzzer
9393```
9494
9595Will print the following output and stacktrace:
@@ -138,27 +138,33 @@ artifact_prefix='./'; Test unit written to ./crash-df779ced6b712c5fca247e465de2d
138138Base64: RlVaWkk=
139139```
140140
141+ ## Integrating with Fuzzit from CI
141142
142- ## Integrating with Fuzzit
143-
144- The integration with fuzzit is easy and consists of adding a travis stage, downloading the fuzzit cli,
145- authenticating and uploading the fuzzer to fuzzit.
143+ The best way to integrate with Fuzzit is by adding a stage in your Contintous Build system
144+ (like Travis CI or Circle CI). In that stage:
145+ * build a fuzz target
146+ * download ` fuzzit ` cli
147+ * authenticate with ` fuzzit auth `
148+ * create a fuzzing job by uploading fuzz target
146149
147150here is the relevant snippet from the [ ./ci/fuzzit.sh] ( https://github.com/fuzzitdev/example-go/blob/master/ci/fuzzit.sh )
148151which is being run by [ .travis.yml] ( https://github.com/fuzzitdev/example-go/blob/master/.travis.yml )
149152
150153``` bash
151- wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v1.2.7 /fuzzit_Linux_x86_64
154+ wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.0.0 /fuzzit_Linux_x86_64
152155chmod a+x fuzzit
153156./fuzzit auth ${FUZZIT_API_KEY}
154157export TARGET_ID=2n6hO2dQzylLxX5GGhRG
155158./fuzzit create job --type $1 --branch $TRAVIS_BRANCH --revision $TRAVIS_COMMIT $TARGET_ID ./fuzzer
156159```
157160
158161NOTE: In production it is advised to download a pinned version of the [ CLI] ( https://github.com/fuzzitdev/fuzzit )
159- like in the example. In development you can use latest with the following link:
160- https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_\ <Os\> _ \< Arch\>
162+ like in the example. In development you can use latest version:
163+ https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_${OS}_${ARCH} .
164+ Valid values for ` ${OS} ` are: ` Linux ` , ` Darwin ` , ` Windows ` .
165+ Valid values for ` ${ARCH} ` are: ` x86_64 ` and ` i386 ` .
161166
167+ The steps are:
162168* Authenticate with the API key (you should keep this secret) you can find in the fuzzit settings dashboard.
163169* Upload the fuzzer via create job command and create the fuzzing job. In This example we use two type of jobs:
164170 * Fuzzing job which is run on every push to master which continuous the previous job just with the new release.
0 commit comments