Skip to content

Commit

Permalink
Added missing variables from ARM deployment, fixed expected environme…
Browse files Browse the repository at this point in the history
…nt variable name, fixed transient test that was missing a sleep (#7352)
  • Loading branch information
alzimmermsft authored Jan 13, 2020
1 parent 409efc5 commit 14c8c1d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,12 @@ class APISpec extends Specification {
InputStream getInputStream(byte[] data) {
return new ByteArrayInputStream(data)
}

void sleepIfLive(long milliseconds) {
if (testMode == TestMode.PLAYBACK) {
return
}

sleep(milliseconds)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.azure.storage.file.share

import com.azure.storage.common.StorageSharedKeyCredential

import com.azure.storage.common.implementation.Constants
import com.azure.storage.common.sas.AccountSasPermission
import com.azure.storage.common.sas.AccountSasResourceType
Expand Down Expand Up @@ -116,8 +116,12 @@ class FileSasClientTests extends APISpec {
.setId("0000")
.setAccessPolicy(new ShareAccessPolicy().setPermissions("rcwdl")
.setExpiresOn(getUTCNow().plusDays(1)))

primaryShareClient.setAccessPolicy(Arrays.asList(identifier))

// Sleep 30 seconds if running against the live service as it may take ACLs that long to take effect.
sleepIfLive(30000)

// Check shareSASPermissions
ShareSasPermission permissions = new ShareSasPermission()
.setReadPermission(true)
Expand Down
16 changes: 16 additions & 0 deletions sdk/storage/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,26 @@
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('premiumAccountName')), variables('storageApiVersion')).keys[0].value]"
},
"AZURE_STORAGE_FILE_ACCOUNT_NAME": {
"type": "string",
"value": "[variables('primaryAccountName')]"
},
"AZURE_STORAGE_FILE_ACCOUNT_KEY": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('primaryAccountName')), variables('storageApiVersion')).keys[0].value]"
},
"AZURE_STORAGE_FILE_ENDPOINT": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Storage/storageAccounts', variables('primaryAccountName')), variables('storageApiVersion')).primaryEndpoints.file]"
},
"AZURE_STORAGE_QUEUE_ACCOUNT_NAME": {
"type": "string",
"value": "[variables('primaryAccountName')]"
},
"AZURE_STORAGE_QUEUE_ACCOUNT_KEY": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('primaryAccountName')), variables('storageApiVersion')).keys[0].value]"
},
"AZURE_STORAGE_QUEUE_ENDPOINT": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Storage/storageAccounts', variables('primaryAccountName')), variables('storageApiVersion')).primaryEndpoints.queue]"
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
STORAGE_DATA_LAKE_ACCOUNT_KEY: $(STORAGE_DATA_LAKE_ACCOUNT_KEY)
AZURE_STORAGE_FILE_ACCOUNT_NAME: $(AZURE_STORAGE_FILE_ACCOUNT_NAME)
AZURE_STORAGE_FILE_ACCOUNT_KEY: $(AZURE_STORAGE_FILE_ACCOUNT_KEY)
AZURE_STORAGE_QUEUE_ACCOUNT_NAME: $(AZURE_STORAGE_FILE_ACCOUNT_NAME)
AZURE_STORAGE_QUEUE_ACCOUNT_NAME: $(AZURE_STORAGE_QUEUE_ACCOUNT_NAME)
AZURE_STORAGE_QUEUE_ACCOUNT_KEY: $(AZURE_STORAGE_QUEUE_ACCOUNT_KEY)

0 comments on commit 14c8c1d

Please sign in to comment.