diff --git a/src/test/librados_test_stub/TestIoCtxImpl.cc b/src/test/librados_test_stub/TestIoCtxImpl.cc index fcca3b34567..ba7d845fb8a 100644 --- a/src/test/librados_test_stub/TestIoCtxImpl.cc +++ b/src/test/librados_test_stub/TestIoCtxImpl.cc @@ -260,7 +260,10 @@ int TestIoCtxImpl::tmap_update(const std::string& oid, bufferlist& cmdbl) { tmap[key] = value; break; case CEPH_OSD_TMAP_RM: - tmap.erase(key); + r = tmap.erase(key); + if (r == 0) { + return -ENOENT; + } break; default: return -EINVAL;