]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Add erasure coding to stress watch test 1513/head
authorDavid Zafman <david.zafman@inktank.com>
Wed, 19 Mar 2014 23:01:19 +0000 (16:01 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Fri, 21 Mar 2014 06:12:47 +0000 (23:12 -0700)
Fixes: #7438
Signed-off-by: David Zafman <david.zafman@inktank.com>
src/test/multi_stress_watch.cc

index 42e2f4cbc468a1c9a49b0cd8fe962ee951aa12b7..6203d7b129812c02b6a83424061f980d5d996146 100644 (file)
@@ -75,7 +75,31 @@ test_replicated(Rados &cluster, std::string pool_name, std::string obj_name)
 void
 test_erasure(Rados &cluster, std::string pool_name, std::string obj_name)
 {
-  std::cout << "Skip erasure test" << std::endl;
+  string outs;
+  bufferlist inbl;
+  int ret;
+  ret = cluster.mon_command(
+    "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile\", \"profile\": [ \"k=2\", \"m=1\", \"ruleset-failure-domain=osd\"]}",
+    inbl, NULL, &outs);
+  if (ret < 0) {
+    std::cerr << "mon_command erasure-code-profile set failed with " << ret << std::endl;
+    exit(1);
+  }
+  //std::cout << outs << std::endl;
+
+  outs.clear();
+  ret = cluster.mon_command(
+    "{\"prefix\": \"osd pool create\", \"pool\": \"" + pool_name + "\", \"pool_type\":\"erasure\", \"pg_num\":12, \"pgp_num\":12, \"erasure_code_profile\":\"testprofile\"}",
+    inbl, NULL, &outs);
+  if (ret < 0) {
+    std::cerr << outs << std::endl;
+    std::cerr << "mon_command create pool failed with " << ret << std::endl;
+    exit(1);
+  }
+  //std::cout << outs << std::endl;
+
+  cluster.wait_for_latest_osdmap();
+  test_loop(cluster, pool_name, obj_name);
   return;
 }