-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fuzz tests for storage_fs (#601)
This commit uses native go fuzzing to fuzz test implementations of storage in storage_fs. moved fuzzing testdata for storage_fs in separate repo added make target and script for importing fuzz data and running all fuzz tests Signed-off-by: Alex Stan <alexandrustan96@yahoo.ro>
- Loading branch information
1 parent
b5f27c5
commit 16e9822
Showing
6 changed files
with
870 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Fuzzing in Zot | ||
|
||
This project makes use of native Go 1.18 fuzzing. An in-depth tutorial for fuzzing in Go can be found [here](https://go.dev/doc/fuzz/). | ||
As language specifies, fuzz tests are included among unit-tests, inside the the same `*_test.go files`, in the packages they intend to fuzz. See [fuzzing for local storage](pkg/storage/local_test.go) | ||
|
||
Zot doesn't store the test data for fuzzing in the same repo, nor it is added before fuzzing with `(*testing.F).Add` . Instead, it is stored in a separate repo called [test-data](https://github.com/project-zot/test-data). | ||
|
||
To start fuzzing locally, one can use the Make target [fuzz-all](Makefile) . | ||
**The default runtime for each fuzz test is 10s**, which can be overriden with the **fuzztime** variable | ||
``` | ||
make fuzz-all fuzztime=20 | ||
``` | ||
By running this target, testdata for fuzzing gets downloaded from the previously mentioned repo and the fuzzing begins for every fuzz function that is found. |
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
Oops, something went wrong.