Skip to content

Commit 0da4ffd

Browse files
Add section on Fuzzing to testing guide
Signed-off-by: killianmuldoon <[email protected]>
1 parent e5f7e84 commit 0da4ffd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/book/src/developer/testing.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ Kubernetes objects and waiting for the controllers to take action. See the [quic
4848

4949
Also in case of integration tests, considerations about [mocking external APIs](#mocking-external-apis) and usage of [generic providers](#generic-providers) apply.
5050

51+
## Fuzzing tests
52+
53+
Fuzzing tests automatically inject randomly generated inputs, often invalid or with unexpected values, into functions to discover vulnerabilities.
54+
55+
Two different types of fuzzing are currently being used on the Cluster API repository:
56+
57+
### Fuzz testing for API conversion
58+
59+
Cluster API uses Kubernetes' conversion-gen to automate the generation of functions to convert our API objects between versions. These conversion functions are tested using the [FuzzTestFunc util in our conversion utils package](https://github.com/kubernetes-sigs/cluster-api/blob/1ec0cd6174f1b860dc466db587241ea7edea0b9f/util/conversion/conversion.go#L194).
60+
For more information about these conversions see the API conversion code walkthrough in our [video walkthrough series](./guide.md#videos-explaining-capi-architecture-and-code-walkthroughs).
61+
62+
### OSS-Fuzz continuous fuzzing
63+
64+
Parts of the CAPI code base are continuously fuzzed through the [OSS-Fuzz project](https://github.com/google/oss-fuzz). Issues found in these fuzzing tests are reported to Cluster API maintainers and surfaced in issues on the repo for resolution.
65+
To read more about the integration of Cluster API with OSS Fuzz see [the 2022 Cluster API Fuzzing Report](https://github.com/kubernetes/sig-security/blob/main/sig-security-assessments/cluster-api/capi_2022_fuzzing.pdf).
66+
5167
## Test maintainability
5268

5369
Tests are an integral part of the project codebase.

0 commit comments

Comments
 (0)