Skip to content

Commit 422520e

Browse files
committed
Merge pull request #34 from Azure/dev
.
2 parents e68d101 + 85ec2b7 commit 422520e

File tree

7 files changed

+589
-127
lines changed

7 files changed

+589
-127
lines changed

src/ResourceManager/KeyVault/Commands.KeyVault.Test/Commands.KeyVault.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
<None Include="ScenarioTests\Common.ps1">
168168
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
169169
</None>
170-
<None Include="ScenarioTests\KeyVaultManagementTests.ps1">
170+
<None Include="Scripts\ControlPlane\KeyVaultManagementTests.ps1">
171+
<Link>ScenarioTests\KeyVaultManagementTests.ps1</Link>
171172
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
172173
</None>
173174
<None Include="SessionRecords\Microsoft.Azure.Commands.KeyVault.Test.ScenarioTests.KeyVaultManagementTests\TestCreateDeleteVaultWithPiping.json">

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Get test secret name
5656
#>
5757
function Get-SecretName([string]$suffix)
5858
{
59-
return 'pshts-' + $global:testns+ '-' + $suffix
59+
return 'pshts-' + $global:testns + '-' + $suffix
6060
}
6161

6262

@@ -240,6 +240,18 @@ function Run-SecretTest ([ScriptBlock] $test, [string] $testName)
240240
}
241241
}
242242

243+
function Run-VaultTest ([ScriptBlock] $test, [string] $testName)
244+
{
245+
try
246+
{
247+
Run-Test $test $testName *>> "$testName.debug_log"
248+
}
249+
finally
250+
{
251+
252+
}
253+
}
254+
243255
function Write-FileReport
244256
{
245257
$fileName = "$global:testEnv"+"$global:testns"+"Summary.debug_log"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.SYNOPSIS
17+
Gets the location for the Website. Default to West US if none found.
18+
#>
19+
function Get-Location
20+
{
21+
$location = Get-AzureLocation | where {$_.Name -eq "Microsoft.KeyVault/vaults"}
22+
if ($location -eq $null)
23+
{
24+
return "East US"
25+
}
26+
else
27+
{
28+
$location.Locations[0]
29+
}
30+
}
31+
32+
<#
33+
.SYNOPSIS
34+
Gets the default location for a provider
35+
#>
36+
function Get-ProviderLocation($provider)
37+
{
38+
$location = Get-AzureLocation | where {$_.Name -eq $provider}
39+
if ($location -eq $null) {
40+
"East US"
41+
} else {
42+
$location.Locations[0]
43+
}
44+
}

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

Lines changed: 210 additions & 125 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)