From: Venky Shankar Date: Thu, 17 Nov 2016 15:41:40 +0000 (+0530) Subject: test / librbd: use data pool IoCtx while listing objects X-Git-Tag: v11.1.0~219^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c1f4d2a347c3d04b41d555dc5a950c6b0eb6e91;p=ceph.git test / librbd: use data pool IoCtx while listing objects Signed-off-by: Venky Shankar --- diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 62a151dcaaa8..24015173e068 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -2146,7 +2146,12 @@ TEST_F(TestLibRBD, TestCoR) // find out what objects the parent image has generated ASSERT_EQ(0, rbd_stat(parent, &p_info, sizeof(p_info))); - ASSERT_EQ(0, rados_nobjects_list_open(ioctx, &list_ctx)); + + int64_t data_pool_id = rbd_get_data_pool_id(parent); + rados_ioctx_t d_ioctx; + rados_ioctx_create2(_cluster, data_pool_id, &d_ioctx); + + ASSERT_EQ(0, rados_nobjects_list_open(d_ioctx, &list_ctx)); while (rados_nobjects_list_next(list_ctx, &entry, NULL, NULL) != -ENOENT) { if (strstr(entry, p_info.block_name_prefix)) { const char *block_name_suffix = entry + strlen(p_info.block_name_prefix) + 1; @@ -2197,7 +2202,7 @@ TEST_F(TestLibRBD, TestCoR) printf("check whether child image has the same set of objects as parent\n"); ASSERT_EQ(0, rbd_open(ioctx, "child", &child, NULL)); ASSERT_EQ(0, rbd_stat(child, &c_info, sizeof(c_info))); - ASSERT_EQ(0, rados_nobjects_list_open(ioctx, &list_ctx)); + ASSERT_EQ(0, rados_nobjects_list_open(d_ioctx, &list_ctx)); while (rados_nobjects_list_next(list_ctx, &entry, NULL, NULL) != -ENOENT) { if (strstr(entry, c_info.block_name_prefix)) { const char *block_name_suffix = entry + strlen(c_info.block_name_prefix) + 1; @@ -2212,6 +2217,7 @@ TEST_F(TestLibRBD, TestCoR) ASSERT_EQ(0, rbd_close(child)); rados_ioctx_destroy(ioctx); + rados_ioctx_destroy(d_ioctx); } static void test_list_children(rbd_image_t image, ssize_t num_expected, ...)