]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
src/test: update ceph_test_rados to support overwrites
authorSamuel Just <sjust@redhat.com>
Mon, 31 Oct 2016 17:55:30 +0000 (10:55 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 17 Nov 2016 18:40:17 +0000 (10:40 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/test/osd/RadosModel.h
src/test/osd/TestRados.cc

index bcc2315d3bc6ec9f542b3d0b568f1b685ab7afab..c67bbafe08f40a65579b5a4cc19dae15390c2c8f 100644 (file)
@@ -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,
index 38ecedaf259ac2a0d650e0dca999112037b8922e..0eae5bcd2e24f278b6474b87132df56b47b9571b 100644 (file)
@@ -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);