mirror of https://github.com/ceph/go-ceph
test/rbd: check for expected errors with Image.Open()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
22c15e5a37
commit
f611d4a986
|
@ -226,7 +226,7 @@ func TestGetImageNames(t *testing.T) {
|
|||
conn.Shutdown()
|
||||
}
|
||||
|
||||
func TestImageReadOnly(t *testing.T) {
|
||||
func TestImageOpen(t *testing.T) {
|
||||
conn, _ := rados.NewConn()
|
||||
conn.ReadDefaultConfigFile()
|
||||
conn.Connect()
|
||||
|
@ -242,6 +242,11 @@ func TestImageReadOnly(t *testing.T) {
|
|||
image, err := Create(ioctx, name, 1<<22, 22)
|
||||
assert.NoError(t, err)
|
||||
|
||||
// an integer is not a valid argument
|
||||
err = image.Open(123)
|
||||
assert.Error(t, err)
|
||||
|
||||
// open read-only
|
||||
err = image.Open(true)
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
|
Loading…
Reference in New Issue