mirror of
https://github.com/ceph/ceph
synced 2025-01-11 21:50:26 +00:00
Merge pull request #35585 from tchaikov/wip-test-mgr-dashboard-smoke-random-port
test/mgr/mgr-dashboard-smoke: listen on random ports Reviewed-by: Laura Paduano <lpaduano@suse.com>
This commit is contained in:
commit
e3cad286a1
@ -16,11 +16,14 @@
|
||||
source $(dirname $0)/../detect-build-env-vars.sh
|
||||
source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
|
||||
|
||||
mon_port=$(get_unused_port)
|
||||
dashboard_port=$((mon_port+1))
|
||||
|
||||
function run() {
|
||||
local dir=$1
|
||||
shift
|
||||
|
||||
export CEPH_MON=127.0.0.1:7160 # git grep '\<7160\>' : there must be only one
|
||||
export CEPH_MON=127.0.0.1:$mon_port
|
||||
export CEPH_ARGS
|
||||
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
|
||||
CEPH_ARGS+="--mon-initial-members=a --mon-host=$MON "
|
||||
@ -38,7 +41,7 @@ function TEST_dashboard() {
|
||||
|
||||
run_mon $dir a || return 1
|
||||
timeout 30 ceph mon stat || return 1
|
||||
ceph config-key set mgr/dashboard/x/server_port 7161
|
||||
ceph config-key set mgr/dashboard/x/server_port $dashboard_port
|
||||
MGR_ARGS+="--mgr_module_path=${CEPH_ROOT}/src/pybind/mgr "
|
||||
run_mgr $dir x ${MGR_ARGS} || return 1
|
||||
|
||||
@ -55,9 +58,9 @@ function TEST_dashboard() {
|
||||
|
||||
tries=0
|
||||
while [[ $tries < 30 ]] ; do
|
||||
if curl -c $dir/cookiefile -X POST -d '{"username":"admin","password":"admin"}' http://127.0.0.1:7161/api/auth
|
||||
if curl -c $dir/cookiefile -X POST -d '{"username":"admin","password":"admin"}' http://127.0.0.1:$dashboard_port/api/auth
|
||||
then
|
||||
if curl -b $dir/cookiefile -s http://127.0.0.1:7161/api/summary | \
|
||||
if curl -b $dir/cookiefile -s http://127.0.0.1:$dashboard_port/api/summary | \
|
||||
jq '.health.overall_status' | grep HEALTH_
|
||||
then
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user