mirror of
https://github.com/ceph/go-ceph
synced 2024-12-25 07:32:27 +00:00
rbd: fix cleanup of CloneFromGroupSnap test case
When there is a failure during the CloneFromGroupSnap test case, the rbd-group snapshot was not removed, preventing images from being deleted as well. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
0460442cba
commit
8bced26404
@ -112,6 +112,9 @@ func TestCloneImageByID(t *testing.T) {
|
||||
t.Run("CloneFromGroupSnap", func(t *testing.T) {
|
||||
err := GroupSnapCreate(ioctx, gname, "groupsnap")
|
||||
assert.NoError(t, err)
|
||||
defer func() {
|
||||
assert.NoError(t, GroupSnapRemove(ioctx, gname, "groupsnap"))
|
||||
}()
|
||||
|
||||
cloneName := "img-clone"
|
||||
optionsClone := NewRbdImageOptions()
|
||||
@ -147,8 +150,5 @@ func TestCloneImageByID(t *testing.T) {
|
||||
assert.Equal(t, parentInfo.Snap.ID, snapID)
|
||||
assert.Equal(t, parentInfo.Image.PoolName, poolname)
|
||||
assert.False(t, parentInfo.Image.Trash)
|
||||
|
||||
err = GroupSnapRemove(ioctx, gname, "groupsnap")
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user