Skip to content

Commit 5b83f69

Browse files
committed
rbd: Remove invalid snap ID test skip
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]>
1 parent ab45bcd commit 5b83f69

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

rbd/snapshot_test.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
package rbd
22

33
import (
4+
"os"
45
"testing"
56

67
"github.com/stretchr/testify/assert"
78
"github.com/stretchr/testify/require"
89
)
910

11+
var (
12+
serverVersion string
13+
)
14+
15+
const (
16+
cephOctopus = "octopus"
17+
cephPacfic = "pacific"
18+
cephQuincy = "quincy"
19+
cephReef = "reef"
20+
cephSquid = "squid"
21+
cephMain = "main"
22+
)
23+
24+
func init() {
25+
switch vname := os.Getenv("CEPH_VERSION"); vname {
26+
case cephOctopus, cephPacfic, cephQuincy, cephReef, cephSquid, cephMain:
27+
serverVersion = vname
28+
}
29+
}
30+
1031
func TestCreateSnapshot(t *testing.T) {
1132
conn := radosConnect(t)
1233

@@ -138,7 +159,11 @@ func TestGetSnapTimestamp(t *testing.T) {
138159
})
139160

140161
t.Run("invalidSnapID", func(t *testing.T) {
141-
t.Skip("hits assert due to https://tracker.ceph.com/issues/47287")
162+
switch serverVersion {
163+
case cephOctopus, cephPacfic:
164+
t.Skip("hits assert due to https://tracker.ceph.com/issues/47287")
165+
}
166+
142167
imgName := "someImage"
143168
img, err := Create(ioctx, imgName, testImageSize, testImageOrder, 1)
144169
assert.NoError(t, err)
@@ -156,6 +181,7 @@ func TestGetSnapTimestamp(t *testing.T) {
156181
snapID = 22
157182
_, err = img.GetSnapTimestamp(snapID)
158183
assert.Error(t, err)
184+
assert.Equal(t, err, ErrNotFound)
159185
})
160186

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

0 commit comments

Comments
 (0)