Skip to content

add fuzz tests for validation package #18096

@YooLCD

Description

@YooLCD

/kind feature

1. Describe IN DETAIL the feature/behavior/change you would like to see.

I would like to add Go native fuzz tests (testing.F) for the primary validation entrypoints in pkg/apis/kops/validation/.

The following fuzz targets are proposed:

  • FuzzValidateCluster
  • FuzzValidateClusterUpdate
  • FuzzValidateInstanceGroup
  • FuzzValidateControlPlaneInstanceGroup
  • FuzzDeepValidate
  • FuzzValidateAdditionalObject

Seeds cover both AWS and GCE providers to exercise cloud-specific validation branches. I have already written and tested the targets locally. While running FuzzValidateClusterUpdate, a nil pointer dereference was discovered in ValidateClusterUpdate (see #XXXX).

If this proposal is accepted, I will submit a PR with the implementation. If the maintainers are open to it, I would also like to propose integrating kops into OSS-Fuzz for continuous fuzzing going forward.

2. Feel free to provide a design supporting your feature request.

Each target parses raw bytes through the same kubemanifest.LoadObjectsFrom pipeline used in production, ensuring that fuzz inputs exercise realistic code paths.

Example invocation:

go test -fuzz=^FuzzDeepValidate$ -fuzztime=60s ./pkg/apis/kops/validation/

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions