expect_false ceph osd crush rule rm replicated_ruleset
# build a simple map
+expect_false ceph osd crush add-bucket foo osd
ceph osd crush add-bucket foo root
o1=`ceph osd create`
o2=`ceph osd create`
/* modifiers */
int add_bucket(int bucketno, int alg, int hash, int type, int size,
int *items, int *weights, int *idout) {
+ if (type == 0)
+ return -EINVAL;
crush_bucket *b = crush_make_bucket(alg, hash, type, size, items, weights);
assert(b);
return crush_add_bucket(crush, bucketno, b, idout);
err = -EINVAL;
goto reply;
}
+ if (type == 0) {
+ ss << "type '" << typestr << "' is for devices, not buckets";
+ err = -EINVAL;
+ goto reply;
+ }
int bucketno;
err = newcrush.add_bucket(0, CRUSH_BUCKET_STRAW,
CRUSH_HASH_DEFAULT, type, 0, NULL,
{
// create an OSD bucket
int osdno;
- c->add_bucket(0, CRUSH_BUCKET_STRAW, CRUSH_HASH_RJENKINS1,
- OSD_TYPE, 0, NULL, NULL, &osdno);
+ int r = c->add_bucket(0, CRUSH_BUCKET_STRAW, CRUSH_HASH_RJENKINS1,
+ 10, 0, NULL, NULL, &osdno);
+ ASSERT_EQ(0, r);
c->set_item_name(osdno, "myosd");
map<string,string> loc;
loc["root"] = "default";