]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_crush_wrapper: attach buckets to root in adjust_item_weight test
authorSage Weil <sage@redhat.com>
Fri, 5 Jun 2015 19:17:26 +0000 (12:17 -0700)
committerSage Weil <sage@redhat.com>
Fri, 5 Jun 2015 19:17:59 +0000 (12:17 -0700)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/crush/CrushWrapper.cc

index 8b80f88052c417b37a6dfa6bf0c2482c8ca59e80..e6928e073dad877804ab782678c5fc3ec9abefcc 100644 (file)
@@ -408,6 +408,10 @@ TEST(CrushWrapper, adjust_item_weight) {
     EXPECT_EQ(true, c->bucket_exists(bucket_id));
     EXPECT_EQ(host_weight, c->get_bucket_weightf(bucket_id));
 
+    map<string,string> bloc;
+    bloc["root"] = "default";
+    EXPECT_EQ(0, c->insert_item(g_ceph_context, host0, host_weight,
+                               HOST0, bloc));
   }
 
   {
@@ -426,6 +430,11 @@ TEST(CrushWrapper, adjust_item_weight) {
     bucket_id = c->get_item_id("fake");
     EXPECT_EQ(true, c->bucket_exists(bucket_id));
     EXPECT_EQ(host_weight, c->get_bucket_weightf(bucket_id));
+
+    map<string,string> bloc;
+    bloc["root"] = "default";
+    EXPECT_EQ(0, c->insert_item(g_ceph_context, hostfake, host_weight,
+                               FAKE, bloc));
   }
 
   //