]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: add mgr/ and smoke test for mgr dashboard 14946/head
authorDan Mick <dan.mick@redhat.com>
Thu, 18 May 2017 04:52:31 +0000 (21:52 -0700)
committerDan Mick <dan.mick@redhat.com>
Fri, 19 May 2017 21:47:48 +0000 (14:47 -0700)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
src/test/CMakeLists.txt
src/test/mgr/CMakeLists.txt [new file with mode: 0644]
src/test/mgr/mgr-dashboard-smoke.sh [new file with mode: 0755]

index ef2e1f8ef975064e79295fe7b2bcc8b911828bae..071d1054ae2c0c7a1eded9ea50cc5da5401093cf 100644 (file)
@@ -44,6 +44,7 @@ endif(WITH_RBD)
 add_subdirectory(messenger)
 add_subdirectory(mds)
 add_subdirectory(mon)
+add_subdirectory(mgr)
 add_subdirectory(msgr)
 add_subdirectory(ObjectMap)
 add_subdirectory(objectstore)
diff --git a/src/test/mgr/CMakeLists.txt b/src/test/mgr/CMakeLists.txt
new file mode 100644 (file)
index 0000000..fccf667
--- /dev/null
@@ -0,0 +1,2 @@
+#scripts
+add_ceph_test(mgr-dashboard-smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/mgr-dashboard-smoke.sh)
diff --git a/src/test/mgr/mgr-dashboard-smoke.sh b/src/test/mgr/mgr-dashboard-smoke.sh
new file mode 100755 (executable)
index 0000000..3c953b9
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/bash
+#
+# Copyright (C) 2014,2015,2017 Red Hat <contact@redhat.com>
+#
+# 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 $(dirname $0)/../detect-build-env-vars.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
+
+function run() {
+    local dir=$1
+
+    setup $dir || return 1
+
+    MON=127.0.0.1:7150  # git grep '\<7150\>' : there must be only one
+    (
+        FSID=$(uuidgen) 
+        export CEPH_ARGS
+        CEPH_ARGS+="--fsid=$FSID --auth-supported=none "
+        CEPH_ARGS+="--mon-initial-members=a --mon-host=$MON"
+        run_mon $dir a --public-addr $MON || return 1
+    )
+
+    timeout 360 ceph --mon-host $MON mon stat || return 1
+    export CEPH_ARGS="--mon_host $MON "
+    ceph config-key put mgr/x/dashboard/server_port 7001
+    MGR_ARGS+="--mgr_module_path=${CEPH_ROOT}/src/pybind/mgr "
+    MGR_ARGS+="--mgr_modules=dashboard "
+    run_mgr $dir x ${MGR_ARGS} || return 1
+
+    tries=0
+    while [[ $tries < 30 ]] ; do
+        if [ $(ceph status -f json | jq .mgrmap.available) = "true" ]
+        then
+            break
+        fi
+        tries=$((tries+1))
+        sleep 1
+    done
+
+    tries=0
+    while [[ $tries < 30 ]] ; do
+        if [ curl -s http://127.0.0.1:7001/toplevel_data | \
+             jq '.health.overall_status' | grep HEALTH_ ]
+        then
+            break
+        fi
+        tries=$((tries+1))
+        sleep 0.5
+    done
+
+    teardown $dir || return 1
+}
+
+main mgr-dashboard-smoke "$@"
+
+# Local Variables:
+# compile-command: "cd ../.. ; make -j4 TESTS=test/mon/mon-dashboard-smoke.sh check"
+# End: