From: Matt Benjamin Date: Wed, 6 Jan 2016 00:23:07 +0000 (-0500) Subject: incremental marker X-Git-Tag: v10.1.0~382^2~67 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b6af8a1afb09f098cacd0c63bc35405af2de890;p=ceph.git incremental marker Signed-off-by: Matt Benjamin --- diff --git a/src/test/librgw_file_nfsns.cc b/src/test/librgw_file_nfsns.cc index b41068128191..ee1867141281 100644 --- a/src/test/librgw_file_nfsns.cc +++ b/src/test/librgw_file_nfsns.cc @@ -91,7 +91,7 @@ namespace { struct dirent_vec { std::vector obj_names; - uint64_t count; + uint32_t count; dirent_vec() : count(0) {} }; @@ -259,19 +259,28 @@ extern "C" { TEST(LibRGW, MARKER1_READDIR) { - using std::get; - - dirent_vec dvec; - uint64_t offset; - bool eof; - - eof = false; - do { - int ret = rgw_readdir(fs, marker_fh, &offset, r2_cb, &dvec, &eof); - ASSERT_EQ(ret, 0); - ASSERT_EQ(offset, get<1>(dvec.obj_names.back())); // cookie check - ++dvec.count; - } while(!eof); + if (do_marker1) { + using std::get; + + dirent_vec dvec; + uint64_t offset; + bool eof = false; + + /* because RGWReaddirRequest::default_max is 1000 (XXX make + * configurable?) and marker_nobjs is 5*1024, the number + * of required rgw_readdir operations N should be + * marker_nobjs/1000 < N < marker_nobjs/1000+1, i.e., 6 when + * marker_nobjs==5*1024 */ + uint32_t max_iterations = marker_nobjs/1000+1; + + do { + ASSERT_TRUE(dvec.count <= max_iterations); + int ret = rgw_readdir(fs, marker_fh, &offset, r2_cb, &dvec, &eof); + ASSERT_EQ(ret, 0); + ASSERT_EQ(offset, get<1>(dvec.obj_names.back())); // cookie check + ++dvec.count; + } while(!eof); + } } TEST(LibRGW, CLEANUP) {