3 # Copyright (C) 2014,2015,2017 Red Hat <contact@redhat.com>
4 # Copyright (C) 2018 SUSE LLC
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU Library Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Library Public License for more details.
16 source $
(dirname $0)/..
/detect-build-env-vars.sh
17 source $CEPH_ROOT/qa
/standalone
/ceph-helpers.sh
23 export CEPH_MON
=127.0.0.1:7160 # git grep '\<7160\>' : there must be only one
25 CEPH_ARGS
+="--fsid=$(uuidgen) --auth-supported=none "
26 CEPH_ARGS
+="--mon-initial-members=a --mon-host=$MON "
27 CEPH_ARGS
+="--mgr-initial-modules=dashboard "
28 CEPH_ARGS
+="--mon-host=$CEPH_MON"
30 setup
$dir ||
return 1
31 TEST_dashboard
$dir ||
return 1
32 teardown
$dir ||
return 1
35 function TEST_dashboard
() {
39 run_mon
$dir a ||
return 1
40 timeout
30 ceph mon stat ||
return 1
41 ceph config-key
set mgr
/dashboard
/x
/server_port
7161
42 MGR_ARGS
+="--mgr_module_path=${CEPH_ROOT}/src/pybind/mgr "
43 run_mgr
$dir x
${MGR_ARGS} ||
return 1
46 while [[ $tries < 30 ]] ; do
47 if [ $
(ceph status
-f json | jq .mgrmap.available
) = "true" ]
54 ceph_adm dashboard set-login-credentials admin admin
57 while [[ $tries < 30 ]] ; do
58 if curl
-c $dir/cookiefile
-X POST
-d '{"username":"admin","password":"admin"}' http
://127.0.0.1:7161/api
/auth
60 if curl
-b $dir/cookiefile
-s http
://127.0.0.1:7161/api
/summary | \
61 jq
'.health.overall_status' |
grep HEALTH_
71 main mgr-dashboard-smoke
"$@"
74 # compile-command: "cd ../.. ; make -j4 TESTS=test/mgr/mgr-dashboard-smoke.sh check"