]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/mon: add test for "mon add" 5533/head
authorKefu Chai <kchai@redhat.com>
Tue, 11 Aug 2015 02:21:18 +0000 (10:21 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 11 Aug 2015 02:21:18 +0000 (10:21 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph-object-corpus
src/test/mon/misc.sh

index 7bd9bbe235c59527dd1ab192fed21944da686d20..20351c6bae6dd4802936a5a9fd76e41b8ce2bad0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7bd9bbe235c59527dd1ab192fed21944da686d20
+Subproject commit 20351c6bae6dd4802936a5a9fd76e41b8ce2bad0
index 76c6f92ef78ad8d306ae753893df50643110fbd6..6089abec0bf21d0fda7c563dfe37c907b5343543 100755 (executable)
@@ -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: