From: myoungwon oh Date: Mon, 3 Aug 2020 07:07:46 +0000 (+0900) Subject: src/test: create a instance and use tier-flush X-Git-Tag: v16.1.0~1248^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4bd35f2d829b8ceb8a923c6346453775e10c3523;p=ceph.git src/test: create a instance and use tier-flush Signed-off-by: Myoungwon Oh --- diff --git a/src/test/librados/tier_cxx.cc b/src/test/librados/tier_cxx.cc index c07cabbee10..d49e46dfcf3 100644 --- a/src/test/librados/tier_cxx.cc +++ b/src/test/librados/tier_cxx.cc @@ -3001,8 +3001,10 @@ TEST_F(LibRadosTwoPoolsPP, SetChunkRead) { // create object { + bufferlist bl; + bl.append("There hi"); ObjectWriteOperation op; - op.create(true); + op.write_full(bl); ASSERT_EQ(0, ioctx.operate("foo", &op)); } { @@ -3013,14 +3015,6 @@ TEST_F(LibRadosTwoPoolsPP, SetChunkRead) { ASSERT_EQ(0, cache_ioctx.operate("bar", &op)); } - // configure tier - bufferlist inbl; - ASSERT_EQ(0, cluster.mon_command( - "{\"prefix\": \"osd tier add\", \"pool\": \"" + pool_name + - "\", \"tierpool\": \"" + cache_pool_name + - "\", \"force_nonempty\": \"--force-nonempty\" }", - inbl, NULL, NULL)); - // wait for maps to settle cluster.wait_for_latest_osdmap(); @@ -3039,13 +3033,17 @@ TEST_F(LibRadosTwoPoolsPP, SetChunkRead) { completion->release(); } - // make all chunks dirty --> full flush --> all chunks are evicted + // flush { - bufferlist bl; - bl.append("There hi"); - ObjectWriteOperation op; - op.write_full(bl); - ASSERT_EQ(0, ioctx.operate("foo", &op)); + ObjectReadOperation op; + op.tier_flush(); + librados::AioCompletion *completion = cluster.aio_create_completion(); + ASSERT_EQ(0, ioctx.aio_operate( + "foo", completion, &op, + librados::OPERATION_IGNORE_CACHE, NULL)); + completion->wait_for_complete(); + ASSERT_EQ(0, completion->get_return_value()); + completion->release(); } // read and verify the object @@ -3055,11 +3053,6 @@ TEST_F(LibRadosTwoPoolsPP, SetChunkRead) { ASSERT_EQ('T', bl[0]); } - ASSERT_EQ(0, cluster.mon_command( - "{\"prefix\": \"osd tier remove\", \"pool\": \"" + pool_name + - "\", \"tierpool\": \"" + cache_pool_name + "\"}", - inbl, NULL, NULL)); - // wait for maps to settle before next test cluster.wait_for_latest_osdmap(); }