From: Jianpeng Ma Date: Fri, 23 Jan 2015 02:09:41 +0000 (+0800) Subject: test: Add --write-fadvise-dontned option to ceph_test_rados X-Git-Tag: v0.93~160^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9d82e63a7e3718787b979a9379f8a87831ed791;p=ceph.git test: Add --write-fadvise-dontned option to ceph_test_rados This test case for feature 'ceph osd pool set poolname write_fadivse_dontneed ture|false'. Signed-off-by: Jianpeng Ma --- diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index 2a97cfc8faa2..d295bf066686 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -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; diff --git a/src/test/osd/TestRados.cc b/src/test/osd/TestRados.cc index 405f9dfabe93..4d8b45cc486a 100644 --- a/src/test/osd/TestRados.cc +++ b/src/test/osd/TestRados.cc @@ -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;