From: Samuel Just Date: Mon, 31 Oct 2016 17:55:30 +0000 (-0700) Subject: src/test: update ceph_test_rados to support overwrites X-Git-Tag: v11.1.0~245^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=050c9010e27cc15955128feb62b9f6d8f52e32a2;p=ceph.git src/test: update ceph_test_rados to support overwrites Signed-off-by: Samuel Just --- diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index bcc2315d3bc6..c67bbafe08f4 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -186,6 +186,7 @@ public: const uint64_t max_stride_size; AttrGenerator attr_gen; const bool no_omap; + const bool no_sparse; bool pool_snaps; bool write_fadvise_dontneed; int snapname_num; @@ -196,6 +197,7 @@ public: uint64_t min_stride_size, uint64_t max_stride_size, bool no_omap, + bool no_sparse, bool pool_snaps, bool write_fadvise_dontneed, const char *id = 0) : @@ -212,6 +214,7 @@ public: min_stride_size(min_stride_size), max_stride_size(max_stride_size), attr_gen(2000, 20000), no_omap(no_omap), + no_sparse(no_sparse), pool_snaps(pool_snaps), write_fadvise_dontneed(write_fadvise_dontneed), snapname_num(0) @@ -1209,7 +1212,7 @@ public: uint64_t len = 0; if (old_value.has_contents()) len = old_value.most_recent_gen()->get_length(old_value.most_recent()); - if (rand() % 2) { + if (context->no_sparse || rand() % 2) { is_sparse_read[index] = false; read_op.read(0, len, diff --git a/src/test/osd/TestRados.cc b/src/test/osd/TestRados.cc index 38ecedaf259a..0eae5bcd2e24 100644 --- a/src/test/osd/TestRados.cc +++ b/src/test/osd/TestRados.cc @@ -297,6 +297,7 @@ int main(int argc, char **argv) string pool_name = "rbd"; bool ec_pool = false; bool no_omap = false; + bool no_sparse = false; bool balance_reads = false; for (int i = 1; i < argc; ++i) { @@ -318,6 +319,8 @@ int main(int argc, char **argv) max_stride_size = atoi(argv[++i]); else if (strcmp(argv[i], "--no-omap") == 0) no_omap = true; + else if (strcmp(argv[i], "--no-sparse") == 0) + no_sparse = true; else if (strcmp(argv[i], "--balance_reads") == 0) balance_reads = true; else if (strcmp(argv[i], "--pool-snaps") == 0) @@ -331,6 +334,7 @@ int main(int argc, char **argv) } ec_pool = true; no_omap = true; + no_sparse = true; } else if (strcmp(argv[i], "--op") == 0) { i++; if (i == argc) { @@ -418,6 +422,7 @@ int main(int argc, char **argv) min_stride_size, max_stride_size, no_omap, + no_sparse, pool_snaps, write_fadvise_dontneed, id);