Skip to content

Commit

Permalink
Fix duplicate provider configuration in storage tests (#6748)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrxtom2 authored May 14, 2020
1 parent 0e33974 commit 38d4961
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,35 @@ resource "azurerm_storage_container" "test" {
}

func testAccAzureRMStorageContainer_basicAzureADAuth(data acceptance.TestData) string {
template := testAccAzureRMStorageContainer_basic(data)
return fmt.Sprintf(`
provider "azurerm" {
storage_use_azuread = true
features {}
}
%s
`, template)
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
}
resource "azurerm_storage_account" "test" {
name = "acctestacc%s"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = "staging"
}
}
resource "azurerm_storage_container" "test" {
name = "vhds"
storage_account_name = azurerm_storage_account.test.name
container_access_type = "private"
}
`, data.RandomInteger, data.Locations.Primary, data.RandomString)
}

func testAccAzureRMStorageContainer_requiresImport(data acceptance.TestData) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,34 @@ resource "azurerm_storage_queue" "test" {
}

func testAccAzureRMStorageQueue_basicAzureADAuth(data acceptance.TestData) string {
template := testAccAzureRMStorageQueue_basic(data)
return fmt.Sprintf(`
provider "azurerm" {
storage_use_azuread = true
features {}
}
%s
`, template)
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
}
resource "azurerm_storage_account" "test" {
name = "acctestacc%s"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = "staging"
}
}
resource "azurerm_storage_queue" "test" {
name = "mysamplequeue-%d"
storage_account_name = azurerm_storage_account.test.name
}
`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger)
}

func testAccAzureRMStorageQueue_requiresImport(data acceptance.TestData) string {
Expand Down

0 comments on commit 38d4961

Please sign in to comment.