mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
Merge pull request #18288 from trociny/wip-metadata
test/librbd: test metadata_set/remove is applied Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
commit
80bb052aa3
@ -2732,7 +2732,7 @@ int metadata_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
CLS_LOG(20, "metdata_set key=%s", key.c_str());
|
||||
CLS_LOG(20, "metdata_remove key=%s", key.c_str());
|
||||
|
||||
int r = cls_cxx_map_remove_key(hctx, metadata_key_for_name(key));
|
||||
if (r < 0) {
|
||||
|
@ -548,6 +548,26 @@ TEST_F(TestInternal, MetadataFilter) {
|
||||
ASSERT_TRUE(res.size() == 3U);
|
||||
}
|
||||
|
||||
TEST_F(TestInternal, MetadataConfApply) {
|
||||
REQUIRE_FEATURE(RBD_FEATURE_LAYERING);
|
||||
|
||||
librbd::ImageCtx *ictx;
|
||||
ASSERT_EQ(0, open_image(m_image_name, &ictx));
|
||||
|
||||
ASSERT_EQ(-ENOENT, ictx->operations->metadata_remove("conf_rbd_cache"));
|
||||
|
||||
bool cache = ictx->cache;
|
||||
std::string rbd_conf_cache = cache ? "true" : "false";
|
||||
std::string new_rbd_conf_cache = !cache ? "true" : "false";
|
||||
|
||||
ASSERT_EQ(0, ictx->operations->metadata_set("conf_rbd_cache",
|
||||
new_rbd_conf_cache));
|
||||
ASSERT_EQ(!cache, ictx->cache);
|
||||
|
||||
ASSERT_EQ(0, ictx->operations->metadata_remove("conf_rbd_cache"));
|
||||
ASSERT_EQ(cache, ictx->cache);
|
||||
}
|
||||
|
||||
TEST_F(TestInternal, SnapshotCopyup)
|
||||
{
|
||||
REQUIRE_FEATURE(RBD_FEATURE_LAYERING);
|
||||
|
Loading…
Reference in New Issue
Block a user