From: Kefu Chai Date: Tue, 11 Aug 2015 02:21:18 +0000 (+0800) Subject: test/mon: add test for "mon add" X-Git-Tag: v9.1.0~396^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5533%2Fhead;p=ceph.git test/mon: add test for "mon add" Signed-off-by: Kefu Chai --- diff --git a/ceph-object-corpus b/ceph-object-corpus index 7bd9bbe235c5..20351c6bae6d 160000 --- a/ceph-object-corpus +++ b/ceph-object-corpus @@ -1 +1 @@ -Subproject commit 7bd9bbe235c59527dd1ab192fed21944da686d20 +Subproject commit 20351c6bae6dd4802936a5a9fd76e41b8ce2bad0 diff --git a/src/test/mon/misc.sh b/src/test/mon/misc.sh index 76c6f92ef78a..6089abec0bf2 100755 --- a/src/test/mon/misc.sh +++ b/src/test/mon/misc.sh @@ -85,6 +85,41 @@ function TEST_osd_pool_get_set() { teardown $dir || return 1 } +function TEST_mon_add_to_single_mon() { + local dir=$1 + + fsid=$(uuidgen) + MONA=127.0.0.1:7117 + MONB=127.0.0.1:7118 + CEPH_ARGS_orig=$CEPH_ARGS + CEPH_ARGS="--fsid=$fsid --auth-supported=none " + CEPH_ARGS+="--mon-initial-members=a " + CEPH_ARGS+="--mon-host=$MONA " + + setup $dir || return 1 + run_mon $dir a --public-addr $MONA || return 1 + # wait for the quorum + timeout 3 ceph -s > /dev/null || return 1 + # strictly speaking it's not a feature, but an expected hahaviour. + timeout 3 ceph mon add b $MONB || [ $? = 124 ] || return 1 + run_mon $dir b --public-addr $MONB || return 1 + teardown $dir || return 1 + + setup $dir || return 1 + run_mon $dir a --public-addr $MONA || return 1 + # without the fix of #5454, mon.a will assert failure at seeing the MMonJoin + # from mon.b + run_mon $dir b --public-addr $MONB || return 1 + # wait for the quorum + timeout 9 ceph -s > /dev/null || return 1 + local num_mons + num_mons=$(ceph mon dump --format=xml 2>/dev/null | $XMLSTARLET sel -t -v "count(//mons/mon)") || return 1 + [ $num_mons == 2 ] || return 1 + # no reason to take more than 2 secs to get this submitted + timeout 1 ceph mon add b $MONB || return 1 + teardown $dir || return 1 +} + main misc "$@" # Local Variables: