From: myoungwon oh Date: Thu, 6 Aug 2020 13:39:56 +0000 (+0900) Subject: src/test: adjust test scenario based on modified refcount scheme X-Git-Tag: wip-pdonnell-testing-20200918.022351~185^2~19 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=06bedbb8bf37998a1b3da227326885a319f701d1;p=ceph-ci.git src/test: adjust test scenario based on modified refcount scheme Based on the reference decrement upon modification, test scenario is adjusted with cleanups Signed-off-by: Myoungwon Oh --- diff --git a/src/test/librados/tier_cxx.cc b/src/test/librados/tier_cxx.cc index ba839ea42b6..e9a3f5d1ff4 100644 --- a/src/test/librados/tier_cxx.cc +++ b/src/test/librados/tier_cxx.cc @@ -3388,14 +3388,14 @@ TEST_F(LibRadosTwoPoolsPP, ManifestDedupRefRead) { // create object { bufferlist bl; - bl.append("hi there"); + bl.append("There hi"); ObjectWriteOperation op; op.write_full(bl); ASSERT_EQ(0, ioctx.operate("foo", &op)); } { bufferlist bl; - bl.append("hi there"); + bl.append("There hi"); ObjectWriteOperation op; op.write_full(bl); ASSERT_EQ(0, ioctx.operate("foo-dedup", &op)); @@ -3444,15 +3444,6 @@ TEST_F(LibRadosTwoPoolsPP, ManifestDedupRefRead) { ASSERT_EQ(0, completion->get_return_value()); completion->release(); } - // make all chunks dirty --> flush - { - // make a dirty chunks - bufferlist bl; - bl.append("There hi"); - ObjectWriteOperation op; - op.write_full(bl); - ASSERT_EQ(0, ioctx.operate("foo-dedup", &op)); - } // flush { ObjectReadOperation op; @@ -3465,14 +3456,6 @@ TEST_F(LibRadosTwoPoolsPP, ManifestDedupRefRead) { ASSERT_EQ(0, completion->get_return_value()); completion->release(); } - { - // make a dirty chunks - bufferlist bl; - bl.append("There hi"); - ObjectWriteOperation op; - op.write_full(bl); - ASSERT_EQ(0, ioctx.operate("foo", &op)); - } // flush { ObjectReadOperation op; @@ -3634,42 +3617,13 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) { cluster.wait_for_latest_osdmap(); // set-chunk (dedup) - { - ObjectReadOperation op; - op.set_chunk(2, 2, cache_ioctx, "bar", 0, - CEPH_OSD_OP_FLAG_WITH_REFERENCE); - 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(); - } + manifest_set_chunk(cluster, cache_ioctx, ioctx, 2, 2, "bar", "foo"); // set-chunk (dedup) - { - ObjectReadOperation op; - op.set_chunk(6, 2, cache_ioctx, "bar", 0, - CEPH_OSD_OP_FLAG_WITH_REFERENCE); - 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(); - } - + manifest_set_chunk(cluster, cache_ioctx, ioctx, 6, 2, "bar", "foo"); // make all chunks dirty --> flush // foo: [er] [hi] - // make a dirty chunks - { - bufferlist bl; - bl.append("There hi"); - ObjectWriteOperation op; - op.write_full(bl); - ASSERT_EQ(0, ioctx.operate("foo", &op)); - } // flush { ObjectReadOperation op; @@ -3986,7 +3940,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) { // create object { bufferlist bl; - bl.append("there hiHI"); + bl.append("Thabe cdHI"); ObjectWriteOperation op; op.write_full(bl); ASSERT_EQ(0, ioctx.operate("foo", &op)); @@ -4003,53 +3957,16 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) { cluster.wait_for_latest_osdmap(); // set-chunk (dedup) - { - ObjectReadOperation op; - op.set_chunk(2, 2, cache_ioctx, "bar", 0, - CEPH_OSD_OP_FLAG_WITH_REFERENCE); - 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(); - } + manifest_set_chunk(cluster, cache_ioctx, ioctx, 2, 2, "bar", "foo"); // set-chunk (dedup) - { - ObjectReadOperation op; - op.set_chunk(6, 2, cache_ioctx, "bar", 0, - CEPH_OSD_OP_FLAG_WITH_REFERENCE); - 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(); - } + manifest_set_chunk(cluster, cache_ioctx, ioctx, 6, 2, "bar", "foo"); // set-chunk (dedup) - { - ObjectReadOperation op; - op.set_chunk(8, 2, cache_ioctx, "bar", 0, - CEPH_OSD_OP_FLAG_WITH_REFERENCE); - 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(); - } + manifest_set_chunk(cluster, cache_ioctx, ioctx, 8, 2, "bar", "foo"); // make all chunks dirty --> flush // foo: [ab] [cd] [ef] - // make a dirty chunks - { - bufferlist bl; - bl.append("Thabe cd"); - ObjectWriteOperation op; - ASSERT_EQ(0, ioctx.write("foo", bl, bl.length(), 0)); - } // flush { ObjectReadOperation op; @@ -4243,38 +4160,11 @@ TEST_F(LibRadosTwoPoolsPP, ManifestFlushSnap) { cluster.wait_for_latest_osdmap(); // set-chunk (dedup) - { - ObjectReadOperation op; - op.set_chunk(2, 2, cache_ioctx, "bar", 0, - CEPH_OSD_OP_FLAG_WITH_REFERENCE); - 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(); - } + manifest_set_chunk(cluster, cache_ioctx, ioctx, 2, 2, "bar", "foo"); // set-chunk (dedup) - { - ObjectReadOperation op; - op.set_chunk(6, 2, cache_ioctx, "bar", 0, - CEPH_OSD_OP_FLAG_WITH_REFERENCE); - 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(); - } + manifest_set_chunk(cluster, cache_ioctx, ioctx, 6, 2, "bar", "foo"); // foo head: [er] [hi] - // make a dirty chunks - { - bufferlist bl; - bl.append("There"); - ObjectWriteOperation op; - ASSERT_EQ(0, ioctx.write("foo", bl, bl.length(), 0)); - } // create a snapshot, clone vector my_snaps(1);