You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: tests/functions.sh
-38
Original file line number
Diff line number
Diff line change
@@ -235,44 +235,6 @@ function storage_account_table_exists () {
235
235
fi
236
236
}
237
237
238
-
functionstorage_account_cors_enabled () {
239
-
sa_name=$1
240
-
action=$2
241
-
cors_enabled_result=$(az storage cors list --services t --account-name $sa_name| jq '.[] | select((.Service=="table") and (.AllowedMethods=="GET") and (.AllowedOrigins=="http://localhost:4040")) != null')
242
-
243
-
if [ "$cors_enabled_result"="true" ];then
244
-
echo"The storage account '$sa_name' has cors enabled"
245
-
else
246
-
echo"The storage account '$sa_name' does not have cors enabled"
247
-
if [ "$action"=="fail" ];then
248
-
exit 1
249
-
fi
250
-
if [ "$action"=="enable" ];then
251
-
echo"Enable cors in storage account '$sa_name'"
252
-
az storage cors add --methods "GET" --origins "http://localhost:4040" --services t --allowed-headers "*" --exposed-headers "*" --account-name $sa_name
253
-
fi
254
-
if [ "$action"=="wait" ];then
255
-
total_wait_seconds=25
256
-
start=0
257
-
wait_seconds=5
258
-
while [ $start-lt$total_wait_seconds ];do
259
-
cors_enabled_result=$(az storage cors list --services t --account-name $sa_name| jq '.[] | select((.Service=="table") and (.AllowedMethods=="GET") and (.AllowedOrigins=="http://localhost:4040")) != null')
260
-
if [ "$cors_enabled_result"="true" ];then
261
-
echo"The storage account '$sa_name' has cors enabled"
262
-
break
263
-
fi
264
-
echo"Wait $wait_seconds seconds..."
265
-
sleep $wait_seconds
266
-
start=$((start + wait_seconds))
267
-
done
268
-
if [ "$cors_enabled_result"!="true" ];then
269
-
echo"The storage account '$sa_name' does not have cors enabled"
270
-
exit 1
271
-
fi
272
-
fi
273
-
fi
274
-
}
275
-
276
238
functionpipeline_exists () {
277
239
echo"Checking if pipeline: ${3} already exists."
278
240
pipeline_results=$(az pipelines list --org $1 --p $2)
0 commit comments