mirror of https://github.com/ceph/go-ceph
rados: merge test case into standard tests file, removing luminous tag
We no longer support ceph luminous, and have not for a while. This test case was kept separately from the others because it didn't function correctly when tested against luminous clusters. As part of the effort to remove the unsupported build tags, there's no longer even a reason to keep this as it's own file with the tags removed, so merge it together. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
cc9f4d6b39
commit
5985d410ce
|
@ -1,38 +0,0 @@
|
||||||
//go:build !luminous
|
|
||||||
// +build !luminous
|
|
||||||
|
|
||||||
package rados
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
// A real test using input buffer is hard to find for mgr.
|
|
||||||
// The simplest does not work on luminous, so we simply don't
|
|
||||||
// provide the test for luminous.
|
|
||||||
|
|
||||||
func (suite *RadosTestSuite) TestMgrCommandWithInputBuffer() {
|
|
||||||
suite.SetupConnection()
|
|
||||||
|
|
||||||
command, err := json.Marshal(
|
|
||||||
map[string]string{"prefix": "crash post", "format": "json"})
|
|
||||||
assert.NoError(suite.T(), err)
|
|
||||||
|
|
||||||
buf, info, err := suite.conn.MgrCommandWithInputBuffer(
|
|
||||||
[][]byte{command}, []byte(`{"crash_id": "foobar", "timestamp": "2020-04-10 15:08:34.659679Z"}`))
|
|
||||||
assert.NoError(suite.T(), err)
|
|
||||||
assert.Equal(suite.T(), info, "")
|
|
||||||
assert.Len(suite.T(), buf, 0)
|
|
||||||
|
|
||||||
command, err = json.Marshal(
|
|
||||||
map[string]string{"prefix": "crash rm", "id": "foobar", "format": "json"})
|
|
||||||
assert.NoError(suite.T(), err)
|
|
||||||
|
|
||||||
buf, info, err = suite.conn.MgrCommandWithInputBuffer(
|
|
||||||
[][]byte{command}, nil)
|
|
||||||
assert.NoError(suite.T(), err)
|
|
||||||
assert.Equal(suite.T(), info, "")
|
|
||||||
assert.Len(suite.T(), buf, 0)
|
|
||||||
}
|
|
|
@ -218,3 +218,28 @@ func (suite *RadosTestSuite) TestMonCommandTargetMalformedCommand() {
|
||||||
assert.NotEqual(suite.T(), info, "")
|
assert.NotEqual(suite.T(), info, "")
|
||||||
assert.Len(suite.T(), buf, 0)
|
assert.Len(suite.T(), buf, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Does not work on ceph luminous, but we do not support ceph luminous.
|
||||||
|
func (suite *RadosTestSuite) TestMgrCommandWithInputBuffer() {
|
||||||
|
suite.SetupConnection()
|
||||||
|
|
||||||
|
command, err := json.Marshal(
|
||||||
|
map[string]string{"prefix": "crash post", "format": "json"})
|
||||||
|
assert.NoError(suite.T(), err)
|
||||||
|
|
||||||
|
buf, info, err := suite.conn.MgrCommandWithInputBuffer(
|
||||||
|
[][]byte{command}, []byte(`{"crash_id": "foobar", "timestamp": "2020-04-10 15:08:34.659679Z"}`))
|
||||||
|
assert.NoError(suite.T(), err)
|
||||||
|
assert.Equal(suite.T(), info, "")
|
||||||
|
assert.Len(suite.T(), buf, 0)
|
||||||
|
|
||||||
|
command, err = json.Marshal(
|
||||||
|
map[string]string{"prefix": "crash rm", "id": "foobar", "format": "json"})
|
||||||
|
assert.NoError(suite.T(), err)
|
||||||
|
|
||||||
|
buf, info, err = suite.conn.MgrCommandWithInputBuffer(
|
||||||
|
[][]byte{command}, nil)
|
||||||
|
assert.NoError(suite.T(), err)
|
||||||
|
assert.Equal(suite.T(), info, "")
|
||||||
|
assert.Len(suite.T(), buf, 0)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue