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

ListSnapshots test makes invalid assumption about NextToken #104

Closed
bswartz opened this issue Aug 30, 2018 · 0 comments
Closed

ListSnapshots test makes invalid assumption about NextToken #104

bswartz opened this issue Aug 30, 2018 · 0 comments

Comments

@bswartz
Copy link
Contributor

bswartz commented Aug 30, 2018

https://github.com/kubernetes-csi/csi-test/blob/master/pkg/sanity/controller.go#L1352
says
Expect(nextToken).To(Equal(strconv.Itoa(maxEntries)))

The ListSnapshots tests assumes that the NextToken field of the ListSnapshotsResponse message is a string representation of an integer. It also assumes that integer is equal to MaxEntries. The CSI spec says neither of these things, so this is a bad test.

According to the CSI spec, NextToken is merely an opaque string that should be passed back to another invocation of ListSnapshots, so a better test would be to call ListSnapshots with the returned token and validate that the first page of snapshots plus the second page of snapshots equals the whole list of unpaginated snapshots.

At a minimum we need to remove the bad line from the test because it encourages CSI driver authors to implement snapshot list pagination in a dumb way.

pohly added a commit to pohly/csi-test that referenced this issue Oct 27, 2020
22c0395 Merge pull request kubernetes-csi#108 from bnrjee/master
b5b447b Add go ldflags using LDFLAGS at the time of compilation
16f4afb Merge pull request kubernetes-csi#107 from pohly/kind-update
7bcee13 prow.sh: update to kind 0.9, support Kubernetes 1.19
df518fb prow.sh: usage of Bazel optional
c3afd42 Merge pull request kubernetes-csi#104 from xing-yang/snapshot
dde93b2 Update to snapshot-controller v3.0.0

git-subtree-dir: release-tools
git-subtree-split: 22c0395
pohly added a commit to pohly/csi-test that referenced this issue Oct 27, 2020
4aff857 Merge pull request kubernetes-csi#109 from pohly/alpha-test-defaults
0427289 Merge pull request kubernetes-csi#110 from pohly/kind-0.9-bazel-build-workaround
9a370ab prow.sh: work around "kind build node-image" failure
522361e prow.sh: only run alpha tests for latest Kubernetes release
22c0395 Merge pull request kubernetes-csi#108 from bnrjee/master
b5b447b Add go ldflags using LDFLAGS at the time of compilation
16f4afb Merge pull request kubernetes-csi#107 from pohly/kind-update
7bcee13 prow.sh: update to kind 0.9, support Kubernetes 1.19
df518fb prow.sh: usage of Bazel optional
c3afd42 Merge pull request kubernetes-csi#104 from xing-yang/snapshot
dde93b2 Update to snapshot-controller v3.0.0

git-subtree-dir: release-tools
git-subtree-split: 4aff857
stmcginnis pushed a commit to stmcginnis/csi-test that referenced this issue Oct 9, 2024
Update to snapshot-controller v3.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant