Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit 694a7da

Browse files
authored
Remove CORS integration test function which is no longer needed (#447)
* Remove cors validation test * Remove the extra character
1 parent 74c82ab commit 694a7da

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

tests/functions.sh

-38
Original file line numberDiff line numberDiff line change
@@ -235,44 +235,6 @@ function storage_account_table_exists () {
235235
fi
236236
}
237237

238-
function storage_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-
276238
function pipeline_exists () {
277239
echo "Checking if pipeline: ${3} already exists."
278240
pipeline_results=$(az pipelines list --org $1 --p $2)

tests/validations.sh

-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ variable_group_exists $AZDO_ORG_URL $AZDO_PROJECT $vg_name "fail"
203203

204204
# Introspection Storage Account Setup
205205
storage_account_exists $AZ_STORAGE_ACCOUNT $AZ_RESOURCE_GROUP "fail"
206-
storage_account_cors_enabled $AZ_STORAGE_ACCOUNT "enable"
207-
storage_account_cors_enabled $AZ_STORAGE_ACCOUNT "wait"
208206
storage_account_table_exists $sat_name $AZ_STORAGE_ACCOUNT "create"
209207
storage_account_table_exists $sat_name $AZ_STORAGE_ACCOUNT "fail"
210208
sa_access_key=$(az storage account keys list -n $AZ_STORAGE_ACCOUNT -g $AZ_RESOURCE_GROUP | jq '.[0].value')

0 commit comments

Comments
 (0)