-
Couldn't load subscription status.
- Fork 151
Open
Labels
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
Description
All of the "should return empty when" tests have a conceptual problem: the don't ensure that there are snapshots to return.
In other words, a broken driver that doesn't check the snapshot or source volume ID and always returns all current snapshots passes the test because the empty list is the expected outcome.
Example:
csi-test/pkg/sanity/controller.go
Lines 1200 to 1208 in a251c44
| It("should return empty when the specified source volume id does not exist", func() { | |
| snapshots, err := r.ListSnapshots( | |
| context.Background(), | |
| &csi.ListSnapshotsRequest{SourceVolumeId: sc.Config.IDGen.GenerateUniqueValidVolumeID()}) | |
| Expect(err).NotTo(HaveOccurred()) | |
| Expect(snapshots).NotTo(BeNil()) | |
| Expect(snapshots.GetEntries()).To(BeEmpty()) | |
| }) |
What these tests should do is to first create at least one snapshot, then ensure that the result is empty.
Metadata
Metadata
Assignees
Labels
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.