-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also fixes an issue where the Key Vault Secret Import Tests weren't running properly
- Loading branch information
1 parent
2506354
commit 742605a
Showing
10 changed files
with
951 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package azurerm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/acctest" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccAzureRMKeyVaultKey_importBasicEC(t *testing.T) { | ||
resourceName := "azurerm_key_vault_key.test" | ||
|
||
rs := acctest.RandString(6) | ||
config := testAccAzureRMKeyVaultKey_basicEC(rs, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMKeyVaultKeyDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"key_size"}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMKeyVaultKey_importBasicRSA(t *testing.T) { | ||
resourceName := "azurerm_key_vault_key.test" | ||
|
||
rs := acctest.RandString(6) | ||
config := testAccAzureRMKeyVaultKey_basicRSA(rs, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMKeyVaultKeyDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"key_size"}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMKeyVaultKey_importBasicRSAHSM(t *testing.T) { | ||
resourceName := "azurerm_key_vault_key.test" | ||
|
||
rs := acctest.RandString(6) | ||
config := testAccAzureRMKeyVaultKey_basicRSAHSM(rs, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMKeyVaultKeyDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"key_size"}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMKeyVaultKey_importComplete(t *testing.T) { | ||
resourceName := "azurerm_key_vault_key.test" | ||
|
||
rs := acctest.RandString(6) | ||
config := testAccAzureRMKeyVaultKey_complete(rs, testLocation()) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMKeyVaultKeyDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"key_size"}, | ||
}, | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.