set -xe
PS4='$LINENO: '
+# must be larger than the time it takes for osd pool create to perform
+# on the slowest http://ceph.com/gitbuilder.cgi machine
+TIMEOUT=${TIMEOUT:-30}
DIR=osd-pool-create
rm -fr $DIR
trap "test \$? = 0 || cat $DIR/log ; set +x ; kill_mon || true && rm -fr $DIR" EXIT
./ceph --format json osd dump | grep '"crush_ruleset":1'
kill_mon
+# try again if the ruleset creation is pending
+run_mon --paxos-propose-interval=200 --debug-mon=20 --debug-paxos=20
+crush_ruleset=erasure_ruleset
+./ceph osd crush rule create-erasure nevermind # the first modification ignores the propose interval, get past it
+! timeout $TIMEOUT ./ceph osd crush rule create-erasure $crush_ruleset || exit 1
+! timeout $TIMEOUT ./ceph osd pool create pool_erasure 12 12 erasure crush_ruleset=$crush_ruleset
+grep "$crush_ruleset try again" $DIR/log
+kill_mon
+
expected='"foo":"bar"'
# osd_pool_default_erasure_code_properties is JSON
run_mon --osd_pool_default_erasure_code_properties "{$expected}"
kill_mon
# Local Variables:
-# compile-command: "cd ../.. ; make TESTS=test/mon/osd-pool-create.sh check"
+# compile-command: "cd ../.. ; make -j4 && TIMEOUT=1 test/mon/osd-pool-create.sh"
# End: