cephfs admin: update test helper functions to work on ceph "pacific"

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-03-17 14:42:49 -04:00 committed by Sven Anderson
parent 52ef909e2b
commit 1f02b52df2
2 changed files with 15 additions and 12 deletions

View File

@ -22,8 +22,13 @@ var (
debugTrace = false
// some tests are sensitive to the server version
serverIsNautilus = false
serverIsOctopus = false
serverVersion string
)
const (
cephNautilus = "nautilus"
cephOctopus = "octopus"
cephPacfic = "pacific"
)
func init() {
@ -31,11 +36,9 @@ func init() {
if ok, err := strconv.ParseBool(dt); ok && err == nil {
debugTrace = true
}
switch os.Getenv("CEPH_VERSION") {
case "nautilus":
serverIsNautilus = true
case "octopus":
serverIsOctopus = true
switch vname := os.Getenv("CEPH_VERSION"); vname {
case cephNautilus, cephOctopus, cephPacfic:
serverVersion = vname
}
}
@ -49,8 +52,8 @@ func TestServerSentinel(t *testing.T) {
// This check is intended to fail the test suite if you don't tell it a
// server version it expects and force us to update the tests if a new
// version of ceph is added.
if !serverIsNautilus && !serverIsOctopus {
t.Fatalf("server must be nautilus or octopus (do the tests need updating?)")
if serverVersion == "" {
t.Fatalf("server must be nautilus, octopus, or pacific (do the tests need updating?)")
}
}

View File

@ -178,8 +178,8 @@ func TestParseDumpToIdents(t *testing.T) {
}
func TestVolumeStatus(t *testing.T) {
if !serverIsOctopus {
t.Skipf("can only execute on octopus servers")
if serverVersion == cephNautilus {
t.Skipf("can only execute on octopus/pacific servers")
}
fsa := getFSAdmin(t)
@ -189,7 +189,7 @@ func TestVolumeStatus(t *testing.T) {
}
func TestVolumeStatusInvalid(t *testing.T) {
if !serverIsNautilus {
if serverVersion != cephNautilus {
t.Skipf("can only excecute on nautilus servers")
}
fsa := getFSAdmin(t)