rados: fix test for mon command with input buffer on ceph octopus

It appears that ceph octopus (currently testing as master) is stricter
about some inputs and the old formatting in the test was failing.
Use formatting that all versions should be happy with.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-03-11 17:04:28 -04:00 committed by Niels de Vos
parent 01b38c2e42
commit 1bd65c6f20
1 changed files with 8 additions and 4 deletions

View File

@ -605,6 +605,13 @@ func (suite *RadosTestSuite) TestMonCommand() {
assert.NoError(suite.T(), err) assert.NoError(suite.T(), err)
} }
// NB: ceph octopus appears to be stricter about the formatting of the keyring
// and now rejects whitespace that older versions did not have a problem with.
const clientKeyFormat = `
[%s]
key = AQD4PGNXBZJNHhAA582iUgxe9DsN+MqFN4Z6Jw==
`
func (suite *RadosTestSuite) TestMonCommandWithInputBuffer() { func (suite *RadosTestSuite) TestMonCommandWithInputBuffer() {
suite.SetupConnection() suite.SetupConnection()
@ -618,10 +625,7 @@ func (suite *RadosTestSuite) TestMonCommandWithInputBuffer() {
}) })
assert.NoError(suite.T(), err) assert.NoError(suite.T(), err)
client_key := fmt.Sprintf(` client_key := fmt.Sprintf(clientKeyFormat, entity)
[%s]
key = AQD4PGNXBZJNHhAA582iUgxe9DsN+MqFN4Z6Jw==
`, entity)
inbuf := []byte(client_key) inbuf := []byte(client_key)