mirror of https://github.com/ceph/go-ceph
cephfs admin: update test helper functions to work on ceph "pacific"
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
52ef909e2b
commit
1f02b52df2
|
@ -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?)")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue