From f40720f2387c02c34a1c074257d47f93cfda41b8 Mon Sep 17 00:00:00 2001 From: Michael Andersen Date: Thu, 12 Jan 2017 17:49:01 -0800 Subject: [PATCH] Add test for ENOENT for omap --- rados/rados_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rados/rados_test.go b/rados/rados_test.go index 378114a..f8ffa71 100644 --- a/rados/rados_test.go +++ b/rados/rados_test.go @@ -979,3 +979,22 @@ func TestLocking(t *testing.T) { pool.Destroy() conn.Shutdown() } + +func TestOmapOnNonexistentObjectError(t *testing.T) { + conn, _ := rados.NewConn() + conn.ReadDefaultConfigFile() + conn.Connect() + + pool_name := GetUUID() + err := conn.MakePool(pool_name) + assert.NoError(t, err) + + pool, err := conn.OpenIOContext(pool_name) + assert.NoError(t, err) + + //This object does not exist + objname := GetUUID() + + _, err = pool.GetAllOmapValues(objname, "", "", 100) + assert.Equal(t, err, rados.RadosErrorNotFound) +}