From: Loic Dachary Date: Mon, 3 Feb 2014 21:59:30 +0000 (+0100) Subject: mon: osd-pool-create test EAGAIN when pending X-Git-Tag: v0.78~226^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=428c75e1d7d559ff65ad013d4a86e6ef8fcca36b;p=ceph.git mon: osd-pool-create test EAGAIN when pending Test that if the ruleset is found in the pending paxos proposal, the pool creation will try again. Reviewed-By: Christophe Courtaut Signed-off-by: Loic Dachary --- diff --git a/src/test/mon/osd-pool-create.sh b/src/test/mon/osd-pool-create.sh index 24f7d18f7609..98e25e815564 100755 --- a/src/test/mon/osd-pool-create.sh +++ b/src/test/mon/osd-pool-create.sh @@ -17,6 +17,9 @@ 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 @@ -97,6 +100,15 @@ grep 'EINVAL' $DIR/out ./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}" @@ -137,5 +149,5 @@ grep "erasure-code-directory" $DIR/osd.json > /dev/null 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: