8 ${FULL_PATH_BUILD_DIR}/..
/src
/mrun
1 ceph $@
12 ${FULL_PATH_BUILD_DIR}/..
/src
/mrun
2 ceph $@
21 cd $FULL_PATH_BUILD_DIR
23 for cluster
in ${CLUSTERS[@]}; do
24 export CEPH_OUT_CLIENT_DIR
=${FULL_PATH_BUILD_DIR}/run
/${cluster}/out
/client
25 MGR
=2 RGW
=1 ..
/src
/mstart.sh
$cluster -n -d
30 # Create an Object Gateway User
31 ceph_all dashboard set-rgw-credentials
33 # Set SSL verify to False
34 ceph_all dashboard set-rgw-api-ssl-verify False
36 CYPRESS_BASE_URL
=$
(ceph mgr services | jq
-r .dashboard
)
37 CYPRESS_CEPH2_URL
=$
(ceph2 mgr services | jq
-r .dashboard
)
39 # start rbd-mirror daemon in the cluster
40 KEY
=$
(ceph auth get client.admin
--format=json | jq
-r .
[0].key
)
41 MON_CLUSTER_1
=$
(grep "mon host" ${FULL_PATH_BUILD_DIR}/run
/1/ceph.conf |
awk '{print $4}')
42 ${FULL_PATH_BUILD_DIR}/bin
/rbd-mirror
--mon_host $MON_CLUSTER_1 --key $KEY -c ${FULL_PATH_BUILD_DIR}/run
/1/ceph.conf
48 if [ "$REMOTE" == "false" ]; then
49 cd ${FULL_PATH_BUILD_DIR}
50 for cluster
in ${CLUSTERS[@]}; do
51 ..
/src
/mstop.sh
$cluster
53 pids
=$
(pgrep rbd-mirror
)
54 if [ -n "$pids" ]; then
55 echo Killing rbd-mirror processes
: $pids
62 check_device_available
() {
65 if [ "$DEVICE" == "docker" ]; then
66 [ -x "$(command -v docker)" ] || failed
=true
73 [ -x "$(command -v chrome)" ] ||
[ -x "$(command -v google-chrome)" ] ||
74 [ -x "$(command -v google-chrome-stable)" ] || failed
=true
77 [ -x "$(command -v chromium)" ] ||
[ -x "$(command -v chromium-browser)" ] || failed
=true
82 if [ "$failed" = "true" ]; then
83 echo "ERROR: $DEVICE not found. You need to install $DEVICE or \
84 use a different device. Supported devices: chrome (default), chromium, electron or docker."
89 : ${CYPRESS_BASE_URL:=''}
90 : ${CYPRESS_CEPH2_URL:=''}
91 : ${CYPRESS_LOGIN_PWD:=''}
92 : ${CYPRESS_LOGIN_USER:=''}
98 while getopts 'd:p:r:u:' flag
; do
101 p
) CYPRESS_LOGIN_PWD
=$OPTARG;;
103 CYPRESS_BASE_URL
=$OPTARG;;
104 u
) CYPRESS_LOGIN_USER
=$OPTARG;;
109 [ -z "$BUILD_DIR" ] && BUILD_DIR
=build
110 cd ..
/..
/..
/..
/${BUILD_DIR}
111 FULL_PATH_BUILD_DIR
=`pwd`
113 [[ "$(command -v npm)" == '' ]] && .
${FULL_PATH_BUILD_DIR}/src
/pybind
/mgr
/dashboard
/frontend
/node-env
/bin
/activate
115 : ${CYPRESS_CACHE_FOLDER:="${FULL_PATH_BUILD_DIR}/src/pybind/mgr/dashboard/cypress"}
117 export CYPRESS_BASE_URL CYPRESS_CACHE_FOLDER CYPRESS_LOGIN_USER CYPRESS_LOGIN_PWD NO_COLOR CYPRESS_CEPH2_URL
119 check_device_available
121 if [ "$CYPRESS_BASE_URL" == "" ]; then
125 cd $DASH_DIR/frontend
127 # Remove existing XML results
128 rm -f cypress
/reports
/results-
*.xml || true
133 CYPRESS_VERSION
=$
(cat package.json |
grep '"cypress"' |
grep -o "[0-9]\.[0-9]\.[0-9]")
137 --env CYPRESS_BASE_URL \
138 --env CYPRESS_LOGIN_USER \
139 --env CYPRESS_LOGIN_PWD \
140 --env CYPRESS_CEPH2_URL \
143 cypress
/included
:${CYPRESS_VERSION} || failed
=1
147 npx cypress run
$CYPRESS_ARGS --browser $DEVICE --headless || stop
1