Skip to content

Commit

Permalink
fix purge_protection keyvault tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed May 1, 2020
1 parent 2b9f82a commit 24e2246
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func TestAccAzureRMKeyVault_purgeProtectionEnabled(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMKeyVaultExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "purge_protection_enabled", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "soft_delete_enabled", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "soft_delete_enabled", "true"), // API rejects false if purge protection is enabled
),
},
data.ImportStep(),
Expand Down Expand Up @@ -436,7 +436,7 @@ func TestAccAzureRMKeyVault_purgeProtectionViaUpdate(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMKeyVaultExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "purge_protection_enabled", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "soft_delete_enabled", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "soft_delete_enabled", "true"), // API rejects false if purge protection is enabled
),
},
data.ImportStep(),
Expand Down Expand Up @@ -1084,9 +1084,10 @@ resource "azurerm_key_vault" "test" {
resource_group_name = azurerm_resource_group.test.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "premium"
purge_protection_enabled = %t
soft_delete_enabled = "%t"
purge_protection_enabled = "%t"
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, enabled)
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, enabled, enabled)
}

func testAccAzureRMKeyVault_softDelete(data acceptance.TestData, enabled bool) string {
Expand Down

0 comments on commit 24e2246

Please sign in to comment.