Skip to content

Commit

Permalink
rbd: Remove invalid snap ID test skip
Browse files Browse the repository at this point in the history
Fix for https://tracker.ceph.com/issues/47287 is now available with
quincy and above releases. Therefore do not skip GetSnapTimestamp
API test for an invalid snap ID.

Signed-off-by: Anoop C S <[email protected]>
  • Loading branch information
anoopcs9 committed Aug 19, 2024
1 parent fcfb1d4 commit 19e53f4
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion rbd/snapshot_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
package rbd

import (
"os"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

var (
serverVersion string
)

const (
cephNautilus = "nautilus"
cephOctopus = "octopus"
cephPacfic = "pacific"
cephQuincy = "quincy"
cephReef = "reef"
cephSquid = "squid"
cephMain = "main"
)

func init() {
switch vname := os.Getenv("CEPH_VERSION"); vname {
case cephNautilus, cephOctopus, cephPacfic, cephQuincy, cephReef, cephSquid, cephMain:
serverVersion = vname
}
}

func TestCreateSnapshot(t *testing.T) {
conn := radosConnect(t)

Expand Down Expand Up @@ -138,7 +160,11 @@ func TestGetSnapTimestamp(t *testing.T) {
})

t.Run("invalidSnapID", func(t *testing.T) {
t.Skip("hits assert due to https://tracker.ceph.com/issues/47287")
switch serverVersion {
case cephNautilus, cephOctopus, cephPacfic:
t.Skip("hits assert due to https://tracker.ceph.com/issues/47287")
}

imgName := "someImage"
img, err := Create(ioctx, imgName, testImageSize, testImageOrder, 1)
assert.NoError(t, err)
Expand All @@ -156,6 +182,7 @@ func TestGetSnapTimestamp(t *testing.T) {
snapID = 22
_, err = img.GetSnapTimestamp(snapID)
assert.Error(t, err)
assert.Equal(t, err, ErrNotExist)
})

t.Run("happyPath", func(t *testing.T) {
Expand Down

0 comments on commit 19e53f4

Please sign in to comment.