]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: mon/mon-ping.sh: make sure 'ceph mon ping' works as expected 5859/head
authorJoao Eduardo Luis <joao@suse.de>
Wed, 9 Sep 2015 19:08:38 +0000 (20:08 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 10 Sep 2015 08:53:59 +0000 (09:53 +0100)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/test/CMakeLists.txt
src/test/Makefile.am
src/test/mon/mon-ping.sh [new file with mode: 0755]

index 71f304c5c194172c55f53463b4ebcf641f8675ef..18ea8815758e253bb2fc3b292b9b6625efa68fe8 100644 (file)
@@ -358,6 +358,9 @@ add_dependencies(check osd_crush)
 add_test(NAME mon_scrub COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/mon/mon-scrub.sh)
 add_dependencies(check mon_scrub)
 
+add_test(NAME mon_ping COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/mon/mon-ping.sh)
+add_dependencies(check mon_ping)
+
 add_test(NAME test_ceph_daemon COMMAND python ${CMAKE_SOURCE_DIR}/src/test/pybind/test_ceph_daemon.py)
 add_dependencies(check test_ceph_daemon)
 
index 65f1f77fdc35a34c67cdcf04807e5b0a7569d461..89fc7dfa7603a783f21e75a50e1ca9cee9b8d396 100644 (file)
@@ -74,6 +74,7 @@ check_SCRIPTS += \
        test/mon/osd-pool-create.sh \
        test/mon/misc.sh \
        test/mon/osd-crush.sh \
+       test/mon/mon-ping.sh \
        test/mon/osd-erasure-code-profile.sh \
        test/mon/mkfs.sh \
        test/mon/mon-scrub.sh \
diff --git a/src/test/mon/mon-ping.sh b/src/test/mon/mon-ping.sh
new file mode 100755 (executable)
index 0000000..e3f7395
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# Copyright (C) 2015 SUSE LINUX GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library Public License for more details.
+#
+source ../qa/workunits/ceph-helpers.sh
+
+function run() {
+    local dir=$1
+    shift
+
+    export CEPH_MON="127.0.0.1:7119"
+    export CEPH_ARGS
+    CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
+    CEPH_ARGS+="--mon-host=$CEPH_MON "
+
+    local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
+    for func in $funcs ; do
+        setup $dir || return 1
+        $func $dir || return 1
+        teardown $dir || return 1
+    done
+}
+
+function TEST_mon_ping() {
+    local dir=$1
+
+    run_mon $dir a || return 1
+
+    ./ceph ping mon.a || return 1
+}
+
+main mon-ping "$@"
+
+# Local Variables:
+# compile-command: "cd ../.. ; make -j4 && test/mon/mon-ping.sh"
+# End: