2021-06-01 09:48:37 +00:00
|
|
|
// +build nautilus
|
2020-10-09 15:10:48 +00:00
|
|
|
|
|
|
|
package rados
|
2021-06-01 09:53:21 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
})
|
|
|
|
}
|