Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions tests/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,6 @@ function storage_account_table_exists () {
if [ "$action" == "delete" ]; then
echo "Delete table '$t'"
az storage table delete -n $t --account-name $sa_name
total_wait_seconds=20
wait_delete_seconds=50
start=0
wait_seconds=5
while [ $start -lt $total_wait_seconds ]; do
sat_result=$(az storage table exists -n $t --account-name $sa_name)
sat_exists=$(echo $sat_result | jq '.exists | . == true')
if [ "$sat_exists" = "false" ]; then
echo "The table '$t' was marked deleted"
echo "Wait $wait_delete_seconds seconds for delete..."
sleep $wait_delete_seconds
break
fi
echo "Wait $wait_seconds seconds..."
sleep $wait_seconds
start=$((start + wait_seconds))
done
fi
else
echo "Check if $t exists"
Expand Down
18 changes: 17 additions & 1 deletion tests/introspection-validations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,23 @@ sat_onboard_name=smokedeploymentstest
subscription_id=$(az account list | jq '.[] | select(.isDefault == true) | .id' -r)
storage_account_exists $AZ_STORAGE_ACCOUNT $AZ_RESOURCE_GROUP "fail"
storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT "delete"
spk deployment onboard -s $AZ_STORAGE_ACCOUNT -t $sat_onboard_name -l $sa_location -r $AZ_RESOURCE_GROUP --subscription-id $subscription_id --service-principal-id $SP_APP_ID --service-principal-password $SP_PASS --tenant-id $SP_TENANT

wait_delete_seconds=50
start=0
wait_seconds=5
while [ $start -lt $wait_delete_seconds ]; do
onboard_result=$(spk deployment onboard -s $AZ_STORAGE_ACCOUNT -t $sat_onboard_name -l $sa_location -r $AZ_RESOURCE_GROUP --subscription-id $subscription_id --service-principal-id $SP_APP_ID --service-principal-password $SP_PASS --tenant-id $SP_TENANT)
if [[ $onboard_result == *"table is being deleted"* ]]; then
echo "Table $sat_onboard_name is still being deleted"
echo "Wait $wait_seconds seconds..."
sleep $wait_seconds
start=$((start + wait_seconds))
else
echo "onboard finished"
break
fi
done

storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT "fail"
storage_account_table_exists $sat_onboard_name $AZ_STORAGE_ACCOUNT "delete"

Expand Down