diff --git a/rbd/snapshot_test.go b/rbd/snapshot_test.go index 6cc7442de..fb42f8c9d 100644 --- a/rbd/snapshot_test.go +++ b/rbd/snapshot_test.go @@ -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) @@ -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) @@ -156,6 +182,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) {