From 0141de75f8915ed479238e3d09490d3522d4d713 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 16 Jun 2020 16:28:01 +0800 Subject: [PATCH] test/mgr/mgr-dashboard-smoke: listen on random ports in hope to reduce the chance to listen an already used port while running multiple "make check" instances in parallel. See-also: http://tracker.ceph.com/issues/36737 Signed-off-by: Kefu Chai --- src/test/mgr/mgr-dashboard-smoke.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/mgr/mgr-dashboard-smoke.sh b/src/test/mgr/mgr-dashboard-smoke.sh index 3a4bbff3fe8..5ad7877c8b1 100755 --- a/src/test/mgr/mgr-dashboard-smoke.sh +++ b/src/test/mgr/mgr-dashboard-smoke.sh @@ -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