Use Go 1.18's testing.F on simple fuzzers#7056
Conversation
|
Skipping CI for Draft Pull Request. |
c64378f to
086db70
Compare
mxpv
left a comment
There was a problem hiding this comment.
Should we enable these on CI?
go test -fuzz FuzzXYZ
@AdamKorcz - Would it be covered by #7052? I don't want to maintain the list of the fuzzing tests if possible. |
No |
Signed-off-by: Kazuyoshi Kato <[email protected]>
Signed-off-by: Kazuyoshi Kato <[email protected]>
106201b to
bf88348
Compare
In addition to oss-fuzz's CIFuzz (see containerd#7052), this commit adds a small shell script that run all fuzzing tests with go test -fuzz. While running for 30 seconds would be too short to acutally find issues, we want to make sure that these fuzzing tests are not fundamentally broken. Signed-off-by: Kazuyoshi Kato <[email protected]>
|
The last commit is adding simple |
|
@mxpv Can you take a look again? Your comment should be addressed by the last commit. |
| "github.com/containerd/containerd/pkg/cap" | ||
| ) | ||
|
|
||
| func FuzzParseProcPIDStatus(data []byte) int { |
There was a problem hiding this comment.
Why was this removed? Is it not needed for the oss-fuzz integration?
There was a problem hiding this comment.
This one is moved under pkg/cap.
There was a problem hiding this comment.
Yes, but the signature is now func (*testing.F) rather than func ([]byte) int and is moved into a _test.go file. Does the external OSS-fuzz runner that consumes these functions (from #4841) know how to invoke a func (*testing.F)?
There was a problem hiding this comment.
Does the external OSS-fuzz runner that consumes these functions (from #4841) know how to invoke a
func (*testing.F)?
Yes. Some other changes might be needed in the build script, though. For example, utilities from _test.go files are currently not available to OSS-Fuzz, so these files need to be non _test.go files.
There was a problem hiding this comment.
the signature is now func (*testing.F) rather than func ([]byte) int
Both can be used by OSS-Fuzz.
| "github.com/containerd/containerd/platforms" | ||
| ) | ||
|
|
||
| func FuzzPlatformsParse(data []byte) int { |
There was a problem hiding this comment.
This one is moved under platforms/. Since Go's fuzzing support is part of testing package. I'm moving fuzzing from contrib/fuzz to each package if possible.
These two fuzzers are simple enough to use Go 1.18's testing.F