6 cd $FULL_PATH_BUILD_DIR
8 MGR
=2 RGW
=1 ..
/src
/vstart.sh
-n -d
11 # Create an Object Gateway User
12 .
/bin
/radosgw-admin user create
--uid=dev
--display-name=Developer
--system
14 .
/bin
/ceph dashboard set-rgw-api-user-id dev
15 # Obtain and set access and secret key for the previously created user. $() is safer than backticks `..`
16 .
/bin
/ceph dashboard set-rgw-api-access-key $
(.
/bin
/radosgw-admin user info
--uid=dev | jq
-r .keys
[0].access_key
)
17 .
/bin
/ceph dashboard set-rgw-api-secret-key $
(.
/bin
/radosgw-admin user info
--uid=dev | jq
-r .keys
[0].secret_key
)
18 # Set SSL verify to False
19 .
/bin
/ceph dashboard set-rgw-api-ssl-verify False
21 CYPRESS_BASE_URL
=$
(.
/bin
/ceph mgr services | jq
-r .dashboard
)
25 if [ "$REMOTE" == "false" ]; then
26 cd ${FULL_PATH_BUILD_DIR}
32 check_device_available
() {
35 if [ "$DEVICE" == "docker" ]; then
36 [ -x "$(command -v docker)" ] || failed
=true
43 [ -x "$(command -v chrome)" ] ||
[ -x "$(command -v google-chrome)" ] ||
44 [ -x "$(command -v google-chrome-stable)" ] || failed
=true
47 [ -x "$(command -v chromium)" ] ||
[ -x "$(command -v chromium-browser)" ] || failed
=true
52 if [ "$failed" = "true" ]; then
53 echo "ERROR: $DEVICE not found. You need to install $DEVICE or \
54 use a different device. Supported devices: chrome (default), chromium, electron or docker."
59 : ${CYPRESS_BASE_URL:=''}
60 : ${CYPRESS_LOGIN_PWD:=''}
61 : ${CYPRESS_LOGIN_USER:=''}
67 while getopts 'd:p:r:u:' flag
; do
70 p
) CYPRESS_LOGIN_PWD
=$OPTARG;;
72 CYPRESS_BASE_URL
=$OPTARG;;
73 u
) CYPRESS_LOGIN_USER
=$OPTARG;;
78 [ -z "$BUILD_DIR" ] && BUILD_DIR
=build
79 cd ..
/..
/..
/..
/${BUILD_DIR}
80 FULL_PATH_BUILD_DIR
=`pwd`
82 [[ "$(command -v npm)" == '' ]] && .
${FULL_PATH_BUILD_DIR}/src
/pybind
/mgr
/dashboard
/node-env
/bin
/activate
84 : ${CYPRESS_CACHE_FOLDER:="${FULL_PATH_BUILD_DIR}/src/pybind/mgr/dashboard/cypress"}
86 export CYPRESS_BASE_URL CYPRESS_CACHE_FOLDER CYPRESS_LOGIN_USER CYPRESS_LOGIN_PWD NO_COLOR
88 check_device_available
90 if [ "$CYPRESS_BASE_URL" == "" ]; then
102 --env CYPRESS_BASE_URL \
103 --env CYPRESS_LOGIN_USER \
104 --env CYPRESS_LOGIN_PWD \
107 cypress
/included
:4.4.0 || failed
=1
111 npx cypress run
$CYPRESS_ARGS --browser $DEVICE --headless || stop
1