]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Add --write-fadvise-dontned option to ceph_test_rados 3295/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 23 Jan 2015 02:09:41 +0000 (10:09 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Fri, 23 Jan 2015 02:09:41 +0000 (10:09 +0800)
This test case for feature 'ceph osd pool set poolname
write_fadivse_dontneed ture|false'.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/test/osd/RadosModel.h
src/test/osd/TestRados.cc

index 2a97cfc8faa2f79c043e335f6133d287e073a14d..d295bf066686d08244f6e644ae59b7af7e4882ce 100644 (file)
@@ -184,6 +184,7 @@ public:
   AttrGenerator attr_gen;
   const bool no_omap;
   bool pool_snaps;
+  bool write_fadvise_dontneed;
   int snapname_num;
 
   RadosTestContext(const string &pool_name, 
@@ -193,6 +194,7 @@ public:
                   uint64_t max_stride_size,
                   bool no_omap,
                   bool pool_snaps,
+                  bool write_fadvise_dontneed,
                   const char *id = 0) :
     state_lock("Context Lock"),
     pool_obj_cont(),
@@ -208,6 +210,7 @@ public:
     attr_gen(2000, 20000),
     no_omap(no_omap),
     pool_snaps(pool_snaps),
+    write_fadvise_dontneed(write_fadvise_dontneed),
     snapname_num(0)
   {
   }
@@ -231,6 +234,15 @@ public:
       rados.shutdown();
       return r;
     }
+    bufferlist inbl;
+    r = rados.mon_command(
+      "{\"prefix\": \"osd pool set\", \"pool\": \"" + pool_name +
+      "\", \"var\", \"write_fadvise_dontneed\", \"val\": \"" + (write_fadvise_dontneed ? "true" : "false") + "\"}",
+      inbl, NULL, NULL);
+    if (r < 0) {
+      rados.shutdown();
+      return r;
+    }
     char hostname_cstr[100];
     gethostname(hostname_cstr, 100);
     stringstream hostpid;
index 405f9dfabe933d20c6806b52294a3c6b5cf6e70d..4d8b45cc486a6593ec53c2a53f9fd28225aefc20 100644 (file)
@@ -235,6 +235,7 @@ int main(int argc, char **argv)
   int64_t min_stride_size = -1, max_stride_size = -1;
   int max_seconds = 0;
   bool pool_snaps = false;
+  bool write_fadvise_dontneed = false;
 
   struct {
     TestOpType op;
@@ -287,6 +288,8 @@ int main(int argc, char **argv)
       no_omap = true;
     else if (strcmp(argv[i], "--pool-snaps") == 0)
       pool_snaps = true;
+    else if (strcmp(argv[i], "--write-fadvise-dontneed") == 0)
+      write_fadvise_dontneed = true;
     else if (strcmp(argv[i], "--ec-pool") == 0) {
       if (!op_weights.empty()) {
        cerr << "--ec-pool must be specified prior to any ops" << std::endl;
@@ -382,6 +385,7 @@ int main(int argc, char **argv)
     max_stride_size,
     no_omap,
     pool_snaps,
+    write_fadvise_dontneed,
     id);
 
   TestOpStat stats;