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:
John Mulligan 2021-11-01 10:03:01 -04:00 committed by mergify[bot]
parent cc9f4d6b39
commit 5985d410ce
2 changed files with 25 additions and 38 deletions

View File

@ -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)
}

View File

@ -218,3 +218,28 @@ func (suite *RadosTestSuite) TestMonCommandTargetMalformedCommand() {
assert.NotEqual(suite.T(), info, "")
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)
}