Merge pull request #36 from immesys/test-omap-enoent

Add test for ENOENT for omap

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
Noah Watkins 2017-01-20 09:38:21 -08:00 committed by GitHub
commit 616140cd3c
1 changed files with 19 additions and 0 deletions

View File

@ -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)
}