]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: destroy testprofile before creating one
authorLoic Dachary <ldachary@redhat.com>
Mon, 2 Nov 2015 19:24:51 +0000 (20:24 +0100)
committerLoic Dachary <ldachary@redhat.com>
Mon, 2 Nov 2015 22:20:44 +0000 (23:20 +0100)
The testprofile erasure code profile is destroyed before creating a new
one so that it does not fail when another testprofile erasure code
profile already exists with different parameters.

This must be done when creating erasure coded pools with the C++
interface, in the same way it's done with the C interface.

http://tracker.ceph.com/issues/13664 Fixes: #13664

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit 47abab9a6f182aa0abe5047c04402850379bcd6d)

src/test/librados/test.cc

index e6e3ea2b1eb01f69928f122b4591bb6c5ed06f17..8380b28146fb5df923c884f46832d184063297e2 100644 (file)
@@ -115,6 +115,14 @@ std::string create_one_ec_pool_pp(const std::string &pool_name, Rados &cluster)
   if (err.length())
     return err;
 
+  int ret = destroy_ec_profile_pp(cluster);
+  if (ret) {
+    cluster.shutdown();
+    std::ostringstream oss;
+    oss << "rados_mon_command erasure-code-profile rm testprofile failed with error " << ret;
+    return oss.str();
+  }
+
   bufferlist inbl;
   ret = cluster.mon_command(
     "{\"prefix\": \"osd erasure-code-profile set\", \"name\": \"testprofile\", \"profile\": [ \"k=2\", \"m=1\", \"ruleset-failure-domain=osd\"]}",