Skip to content

Commit

Permalink
fix: Fix tests for snapshot does not exist error
Browse files Browse the repository at this point in the history
Follow-up to #2925
Fix test matching and add additional wrapping for EBS
  • Loading branch information
hairyhum committed Jun 7, 2024
1 parent 3727ec4 commit d26d339
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/blockstorage/awsebs/awsebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ func getSnapshots(ctx context.Context, ec2Cli *EC2, snapIDs []*string) ([]*ec2.S
dsi := &ec2.DescribeSnapshotsInput{SnapshotIds: snapIDs}
dso, err := ec2Cli.DescribeSnapshotsWithContext(ctx, dsi)
if err != nil {
return nil, errors.Wrapf(err, "Failed to get snapshot, snapshot_ids: %p", snapIDs)
return nil, errors.Wrapf(err, blockstorage.SnapshotDoesNotExistError+", snapshot_ids: %p", snapIDs)
}
// TODO: handle paging and continuation
if len(dso.Snapshots) != len(snapIDs) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/blockstorage/blockstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (s *BlockStorageProviderSuite) TestCreateSnapshot(c *C) {
s.snapshots = nil
_, err = s.provider.SnapshotGet(context.Background(), snapshot.ID)
c.Assert(err, NotNil)
c.Assert(err.Error(), Matches, blockstorage.SnapshotDoesNotExistError)
c.Assert(strings.Contains(err.Error(), blockstorage.SnapshotDoesNotExistError), Equals, true)
}
}

Expand Down

0 comments on commit d26d339

Please sign in to comment.