Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzz pvc.Spec.Selector in API tests #27052

Closed
wants to merge 2 commits into from

Conversation

pmorie
Copy link
Member

@pmorie pmorie commented Jun 8, 2016

Fuzz PersistentVolumeClaim.Spec.Selector

Follow-up to #25917

@pmorie pmorie added area/api Indicates an issue on api area. sig/storage Categorizes an issue or PR as relevant to SIG Storage. labels Jun 8, 2016
@pmorie pmorie added this to the v1.3 milestone Jun 8, 2016
@pmorie pmorie added the release-note-none Denotes a PR that doesn't merit a release note. label Jun 8, 2016
@k8s-github-robot k8s-github-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 8, 2016
@@ -357,6 +357,11 @@ func FuzzerFor(t *testing.T, version unversioned.GroupVersion, src rand.Source)
},
func(pvc *api.PersistentVolumeClaim, c fuzz.Continue) {
c.FuzzNoCustom(pvc) // fuzz self without calling this function again
pvc.Spec.Selector = &unversioned.LabelSelector{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to write a custom fuzzer for unversioned.LabelSelector?

I can't tell if this is adding coverage or removing coverage.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lavalamp there's already a TODO for it elsewhere in the file -- I would do it in a follow up if you wanted but it seemed like quite a bit of work -- this at least tests that the selelector goes through the conversion appropraitely.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be as easy as adding a function like this? Then you'll test it everywhere it appears.

...,
func(uls *unversioned.LabelSelector, c fuzz.Continue) {
  uls.MatchLabels = map[string]string{
    "testlabelkey": "testlabelval",
  }
},
...

Are you sure it's not tested now? I'm pretty sure that the fuzzer recurses into map types.

@dchen1107
Copy link
Member

ping ...

@k8s-bot
Copy link

k8s-bot commented Jun 14, 2016

GCE e2e build/test passed for commit d34c1e6.

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 14, 2016
@pmorie
Copy link
Member Author

pmorie commented Jun 14, 2016

I don't think this PR is needed, actually. After looking in the fuzzer, I think this removes instead of adds coverage. Closing. In a follow up, we should remove the logic for another test that does similar manual fuzzing for unversioned.LabelSelector. Sorry for the churn.

@pmorie pmorie closed this Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants