mirror of
https://github.com/ceph/go-ceph
synced 2025-01-05 05:20:03 +00:00
4955746fb2
SetPoolFullTry implements rados_set_osdmap_full_try() and UnsetPoolFullTry implements rados_unset_osdmap_full_try() in nautilus. Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
31 lines
675 B
Go
31 lines
675 B
Go
// +build nautilus
|
|
|
|
package rados
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func (suite *RadosTestSuite) TestSetUnsetPoolFullTry() {
|
|
suite.SetupConnection()
|
|
suite.T().Run("invalidIOContext", func(t *testing.T) {
|
|
ioctx := &IOContext{}
|
|
err := ioctx.SetPoolFullTry()
|
|
assert.Error(t, err)
|
|
err = ioctx.UnsetPoolFullTry()
|
|
assert.Error(t, err)
|
|
})
|
|
|
|
suite.T().Run("validIOContext", func(t *testing.T) {
|
|
ioctx, err := suite.conn.OpenIOContext(suite.pool)
|
|
require.NoError(suite.T(), err)
|
|
err = ioctx.SetPoolFullTry()
|
|
assert.NoError(t, err)
|
|
err = ioctx.UnsetPoolFullTry()
|
|
assert.NoError(t, err)
|
|
})
|
|
}
|