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 authored and phlogistonjohn committed Oct 10, 2024
1 parent 08e5b62 commit 905902d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion rbd/snapshot_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
package rbd

import (
"os"
"testing"

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

var (
serverVersion string
)

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

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

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

Expand Down Expand Up @@ -138,7 +159,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 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 +181,7 @@ func TestGetSnapTimestamp(t *testing.T) {
snapID = 22
_, err = img.GetSnapTimestamp(snapID)
assert.Error(t, err)
assert.Equal(t, err, ErrNotFound)
})

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

0 comments on commit 905902d

Please sign in to comment.