Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbd: Remove invalid snap ID test skip #1021

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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