mirror of https://github.com/ceph/go-ceph
rados: add test function for error type and functions
Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
105ccc6ee1
commit
d4b6798928
|
@ -1136,3 +1136,16 @@ func (suite *RadosTestSuite) TestOmapOnNonexistentObjectError() {
|
|||
func TestRadosTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(RadosTestSuite))
|
||||
}
|
||||
|
||||
func TestRadosError(t *testing.T) {
|
||||
err := GetRadosError(0)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = GetRadosError(-5) // IO error
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, err.Error(), "rados: ret=5, Input/output error")
|
||||
|
||||
err = GetRadosError(345) // no such errno
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, err.Error(), "rados: ret=345")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue