Skip to content

Commit

Permalink
Update vault immutability e2e test with storage account container cre…
Browse files Browse the repository at this point in the history
…ation/configuration.
  • Loading branch information
johncollinson2001 committed Oct 21, 2024
1 parent 2ba169f commit 92a3a49
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/end-to-end-tests/vault_immutability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import (
)

type TestVaultImmutabilityExternalResources struct {
ResourceGroup armresources.ResourceGroup
StorageAccount armstorage.Account
ResourceGroup armresources.ResourceGroup
StorageAccount armstorage.Account
StorageAccountContainer armstorage.BlobContainer
}

/*
Expand All @@ -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
Expand All @@ -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},
},
}

Expand Down

0 comments on commit 92a3a49

Please sign in to comment.