From 8d7b888e237240bcc031f7ac7cbe7047c31c13ef Mon Sep 17 00:00:00 2001 From: Yeming Liu Date: Tue, 26 Jan 2021 12:28:21 +0800 Subject: [PATCH] add live-only tests --- src/KeyVault/KeyVault.Test/PesterTests/Key.Tests.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/KeyVault/KeyVault.Test/PesterTests/Key.Tests.ps1 b/src/KeyVault/KeyVault.Test/PesterTests/Key.Tests.ps1 index 7e28e1be08e6..300737836edb 100644 --- a/src/KeyVault/KeyVault.Test/PesterTests/Key.Tests.ps1 +++ b/src/KeyVault/KeyVault.Test/PesterTests/Key.Tests.ps1 @@ -16,4 +16,15 @@ Describe "Update key" { Get-AzKeyVaultKey -VaultName $vaultName -Name $keyName -IncludeVersions | Update-AzKeyVaultKey -Enable $true Get-AzKeyVaultKey -VaultName $vaultName -Name $keyName -IncludeVersions | ForEach-Object { $_.Enabled | Should -BeTrue } } +} + +Describe "Add key" { + It "should throw when key type EC and curve name are not paired" { + { + Add-AzKeyVaultKey -VaultName veakkine-kv -Name PSECImportedKey -KeyFilePath E:\targetBlob.byok -KeyType EC -ErrorAction Stop + } | Should -Throw "CurveName" + { + Add-AzKeyVaultKey -VaultName veakkine-kv -Name PSECImportedKey -KeyFilePath E:\targetBlob.byok -CurveName P-256 -ErrorAction Stop + } | Should -Throw "KeyType" + } } \ No newline at end of file