Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions pkg/sanity/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1254,21 +1254,6 @@ var _ = DescribeSanity("ListSnapshots [Controller Server]", func(sc *SanityConte
Expect(snapshots.GetEntries()).To(BeEmpty())
})

It("should fail when an invalid starting_token is passed", func() {
vols, err := c.ListSnapshots(
context.Background(),
&csi.ListSnapshotsRequest{
StartingToken: "invalid-token",
},
)
Expect(err).To(HaveOccurred())
Expect(vols).To(BeNil())

serverError, ok := status.FromError(err)
Expect(ok).To(BeTrue())
Expect(serverError.Code()).To(Equal(codes.Aborted))
})

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we still need some kind of invalid token test? I thought you want to remove the next test "should fail when the starting_token is greater than total number of snapshots".

Copy link
Contributor

Choose a reason for hiding this comment

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

Just talked to Jing. We don't know what kind of token a driver will use so we don't really know what is invalid. So this test can be removed.

It("should fail when the starting_token is greater than total number of snapshots", func() {
// Get total number of snapshots.
snapshots, err := c.ListSnapshots(
Expand Down Expand Up @@ -1590,8 +1575,11 @@ var _ = DescribeSanity("CreateSnapshot [Controller Server]", func(sc *SanityCont
Expect(snap1).NotTo(BeNil())
verifySnapshotInfo(snap1.GetSnapshot())

volume2, err := c.CreateVolume(context.Background(), MakeCreateVolumeReq(sc, "CreateSnapshot-volume-3"))
Expect(err).ToNot(HaveOccurred())

By("creating a snapshot with the same name but different volume source id")
req2 := MakeCreateSnapshotReq(sc, "CreateSnapshot-snapshot-2", "test001", nil)
req2 := MakeCreateSnapshotReq(sc, "CreateSnapshot-snapshot-2", volume2.GetVolume().GetId(), nil)
_, err = c.CreateSnapshot(context.Background(), req2)
Expect(err).To(HaveOccurred())
serverError, ok := status.FromError(err)
Expand Down