Skip to content

Commit

Permalink
rbd: Use internal wrapper for detecting server version
Browse files Browse the repository at this point in the history
Signed-off-by: Anoop C S <[email protected]>
  • Loading branch information
anoopcs9 authored and mergify[bot] committed Feb 5, 2025
1 parent 18fcad1 commit 2e15e72
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions rbd/snapshot_test.go
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
package rbd

import (
"os"
"testing"

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

"github.com/ceph/go-ceph/internal/util"
)

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
}
serverVersion = util.CurrentCephVersionString()
}

func TestCreateSnapshot(t *testing.T) {
Expand Down Expand Up @@ -160,7 +149,7 @@ func TestGetSnapTimestamp(t *testing.T) {

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

Expand Down

0 comments on commit 2e15e72

Please sign in to comment.