r = build_simple_crush_map(cct, *crush, nosd, &ss);
else
r = build_simple_crush_map_from_conf(cct, *crush, &ss);
+ assert(r == 0);
int poolbase = get_max_osd() ? get_max_osd() : 1;
name_pool[*p] = pool;
}
- if (r < 0)
- lderr(cct) << ss.str() << dendl;
-
for (int i=0; i<get_max_osd(); i++) {
set_state(i, 0);
set_weight(i, CEPH_OSD_OUT);
grep "doesn't exist" || return 1
}
+function TEST_replicated_pool_with_non_existent_default_ruleset_0() {
+ local dir=$1
+ run_mon $dir a || return 1
+ # change the default crush rule
+ ./ceph tell mon.a injectargs -- \
+ --osd_pool_default_crush_replicated_ruleset 66 || return 1
+ ./ceph osd pool create mypool 12 12 replicated 2>&1 | \
+ grep "No suitable CRUSH ruleset exists" || return 1
+ CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
+ ! grep "osd_pool_default_crush_rule is deprecated " $dir/mon.a.log || return 1
+}
+
+function TEST_replicated_pool_with_non_existent_default_ruleset_1() {
+ local dir=$1
+ run_mon $dir a || return 1
+ # change the default crush rule using deprecated option
+ ./ceph tell mon.a injectargs -- \
+ --osd_pool_default_crush_rule 55 || return 1
+ ./ceph osd pool create mypool 12 12 replicated 2>&1 | \
+ grep "No suitable CRUSH ruleset exists" || return 1
+ CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
+ grep "osd_pool_default_crush_rule is deprecated " $dir/mon.a.log || return 1
+}
+
+function TEST_replicated_pool_with_non_existent_default_ruleset_2() {
+ local dir=$1
+ run_mon $dir a || return 1
+ ./ceph tell mon.a injectargs -- \
+ --osd_pool_default_crush_rule 77 \
+ --osd_pool_default_crush_replicated_ruleset 33 || return 1
+ ./ceph osd pool create mypool 12 12 replicated 2>&1 | \
+ grep "No suitable CRUSH ruleset exists" || return 1
+ CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
+ grep "osd_pool_default_crush_rule is deprecated " $dir/mon.a.log || return 1
+}
+
function TEST_erasure_code_pool_lrc() {
local dir=$1
run_mon $dir a || return 1