Skip to content

Commit d966df6

Browse files
author
Karl Augsten
committed
Add optional vault parameter to keyvault test scripts.
Add ability to specify which vault to test against.
1 parent f119641 commit d966df6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/ResourceManager/KeyVault/Commands.KeyVault.Test/Scripts/Common.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ Get test key name
2323
#>
2424
function Get-KeyVault([bool] $haspermission=$true)
2525
{
26-
if ($global:testEnv -eq 'BVT' -and $haspermission)
26+
if ($global:testVault -ne "" -and $haspermission)
27+
{
28+
return $global:testVault
29+
}
30+
elseif ($global:testEnv -eq 'BVT' -and $haspermission)
2731
{
2832
return 'powershellbvt'
2933
}

src/ResourceManager/KeyVault/Commands.KeyVault.Test/Scripts/RunKeyVaultTests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
[ValidateSet('BVT','PROD')]
99
[string]$TestEnvironment = 'PROD',
1010
[Parameter(Mandatory=$false,Position=2, ParameterSetName="CPTests")]
11-
[string]$Location = 'eastus2'
11+
[string]$Location = 'eastus2',
12+
[Parameter(Mandatory=$false, Position=3)]
13+
[string]$Vault = ""
1214
)
1315

1416
$invocationPath = Split-Path $MyInvocation.MyCommand.Definition;
@@ -29,6 +31,7 @@ $global:times = @{}
2931
$global:testEnv = $TestEnvironment.ToUpperInvariant()
3032
$global:testns = $TestRunNameSpace
3133
$global:location = $location
34+
$global:testVault = $Vault
3235

3336
function Run-TestProtected
3437
{

0 commit comments

Comments
 (0)