From 92a3a49325cf500076b6898211ddb5a3a5720390 Mon Sep 17 00:00:00 2001 From: John Collinson <13622412+johncollinson2001@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:18:00 +0100 Subject: [PATCH] Update vault immutability e2e test with storage account container creation/configuration. --- .../vault_immutability_test.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/end-to-end-tests/vault_immutability_test.go b/tests/end-to-end-tests/vault_immutability_test.go index b3b34b3..461a8bf 100644 --- a/tests/end-to-end-tests/vault_immutability_test.go +++ b/tests/end-to-end-tests/vault_immutability_test.go @@ -14,8 +14,9 @@ import ( ) type TestVaultImmutabilityExternalResources struct { - ResourceGroup armresources.ResourceGroup - StorageAccount armstorage.Account + ResourceGroup armresources.ResourceGroup + StorageAccount armstorage.Account + StorageAccountContainer armstorage.BlobContainer } /* @@ -28,10 +29,12 @@ func setupExternalResourcesForVaultImmutabilityTest(t *testing.T, credential *az storageAccountName := fmt.Sprintf("sa%sexternal", strings.ToLower(uniqueId)) storageAccount := CreateStorageAccount(t, credential, subscriptionID, externalResourceGroupName, storageAccountName, resourceGroupLocation) + storageAccountContainer := CreateStorageAccountContainer(t, credential, subscriptionID, externalResourceGroupName, storageAccountName, "test-container") externalResources := &TestVaultImmutabilityExternalResources{ - ResourceGroup: resourceGroup, - StorageAccount: storageAccount, + ResourceGroup: resourceGroup, + StorageAccount: storageAccount, + StorageAccountContainer: storageAccountContainer, } return externalResources @@ -58,9 +61,10 @@ func TestVaultImmutability(t *testing.T) { // policies have been created correctly blobStorageBackups := map[string]map[string]interface{}{ "backup1": { - "backup_name": "blob1", - "retention_period": "P7D", - "storage_account_id": *externalResources.StorageAccount.ID, + "backup_name": "blob1", + "retention_period": "P7D", + "storage_account_id": *externalResources.StorageAccount.ID, + "storage_account_containers": []string{*externalResources.StorageAccountContainer.Name}, }, }