Skip to content

Commit 04763e4

Browse files
committed
Merge pull request Azure#247 from huangpf/dev
Dev
2 parents c2ade1b + e5ce403 commit 04763e4

File tree

7 files changed

+123
-59
lines changed

7 files changed

+123
-59
lines changed

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

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
[string]$Location = 'eastus2',
99
[Parameter(Mandatory=$false, Position=3)]
1010
[string]$Vault = "",
11-
[Parameter(Mandatory=$false, Position=3)]
12-
[string]$ResourceGroup = ""
11+
[Parameter(Mandatory=$false, Position=4)]
12+
[string]$ResourceGroup = "",
13+
[Parameter(Mandatory=$false, Position=5)]
14+
[bool]$StandardVaultOnly = $false
1315
)
1416

1517
$invocationPath = Split-Path $MyInvocation.MyCommand.Definition;
@@ -32,6 +34,7 @@ $global:testns = $TestRunNameSpace
3234
$global:location = $location
3335
$global:testVault = $Vault
3436
$global:resourceGroupName = $ResourceGroup
37+
$global:standardVaultOnly = $StandardVaultOnly
3538

3639
function Run-TestProtected
3740
{
@@ -76,8 +79,11 @@ function Run-AllControlPlaneTests
7679
try
7780
{
7881
#New-AzureRmKeyVault tests
82+
if($global:standardVaultOnly -eq $false)
83+
{
84+
Run-TestProtected { Run-VaultTest { Test_CreateNewPremiumVaultEnabledForDeployment } "Test_CreateNewPremiumVaultEnabledForDeployment" } "Test_CreateNewPremiumVaultEnabledForDeployment"
85+
}
7986
Run-TestProtected { Run-VaultTest { Test_CreateNewVault } "Test_CreateNewVault" } "Test_CreateNewVault"
80-
Run-TestProtected { Run-VaultTest { Test_CreateNewPremiumVaultEnabledForDeployment } "Test_CreateNewPremiumVaultEnabledForDeployment" } "Test_CreateNewPremiumVaultEnabledForDeployment"
8187
Run-TestProtected { Run-VaultTest { Test_RecreateVaultFails } "Test_RecreateVaultFails" } "Test_RecreateVaultFails"
8288
Run-TestProtected { Run-VaultTest { Test_CreateVaultInUnknownResGrpFails } "Test_CreateVaultInUnknownResGrpFails" } "Test_CreateVaultInUnknownResGrpFails"
8389
Run-TestProtected { Run-VaultTest { Test_CreateVaultPositionalParams } "Test_CreateVaultPositionalParams" } "Test_CreateVaultPositionalParams"
@@ -130,16 +136,22 @@ function Run-AllDataPlaneTests
130136
# Add-AzureKeyVaultKey tests
131137
Run-TestProtected { Run-KeyTest {Test_CreateSoftwareKeyWithDefaultAttributes} "Test_CreateSoftwareKeyWithDefaultAttributes" } "Test_CreateSoftwareKeyWithDefaultAttributes"
132138
Run-TestProtected { Run-KeyTest {Test_CreateSoftwareKeyWithCustomAttributes} "Test_CreateSoftwareKeyWithCustomAttributes" } "Test_CreateSoftwareKeyWithCustomAttributes"
133-
Run-TestProtected { Run-KeyTest {Test_CreateHsmKeyWithDefaultAttributes} "Test_CreateHsmKeyWithDefaultAttributes" } "Test_CreateHsmKeyWithDefaultAttributes"
134-
Run-TestProtected { Run-KeyTest {Test_CreateHsmKeyWithCustomAttributes} "Test_CreateHsmKeyWithCustomAttributes" } "Test_CreateHsmKeyWithCustomAttributes"
139+
140+
# All operations involving HSM keys
141+
if($global:standardVaultOnly -eq $false)
142+
{
143+
Run-TestProtected { Run-KeyTest {Test_CreateHsmKeyWithDefaultAttributes} "Test_CreateHsmKeyWithDefaultAttributes" } "Test_CreateHsmKeyWithDefaultAttributes"
144+
Run-TestProtected { Run-KeyTest {Test_CreateHsmKeyWithCustomAttributes} "Test_CreateHsmKeyWithCustomAttributes" } "Test_CreateHsmKeyWithCustomAttributes"
145+
Run-TestProtected { Run-KeyTest {Test_ImportPfxAsHsmWithDefaultAttributes} "Test_ImportPfxAsHsmWithDefaultAttributes" } "Test_ImportPfxAsHsmWithDefaultAttributes"
146+
Run-TestProtected { Run-KeyTest {Test_ImportPfxAsHsmWithCustomAttributes} "Test_ImportPfxAsHsmWithCustomAttributes" } "Test_ImportPfxAsHsmWithCustomAttributes"
147+
Run-TestProtected { Run-KeyTest {Test_ImportByokWithDefaultAttributes} "Test_ImportByokWithDefaultAttributes" } "Test_ImportByokWithDefaultAttributes"
148+
Run-TestProtected { Run-KeyTest {Test_ImportByokWith1024BitKey} "Test_ImportByokWith1024BitKey" } "Test_ImportByokWith1024BitKey"
149+
Run-TestProtected { Run-KeyTest {Test_ImportByokWithCustomAttributes} "Test_ImportByokWithCustomAttributes" } "Test_ImportByokWithCustomAttributes"
150+
}
151+
135152
Run-TestProtected { Run-KeyTest {Test_ImportPfxWithDefaultAttributes} "Test_ImportPfxWithDefaultAttributes" } "Test_ImportPfxWithDefaultAttributes"
136153
Run-TestProtected { Run-KeyTest {Test_ImportPfxWith1024BitKey} "Test_ImportPfxWith1024BitKey" } "Test_ImportPfxWith1024BitKey"
137154
Run-TestProtected { Run-KeyTest {Test_ImportPfxWithCustomAttributes} "Test_ImportPfxWithCustomAttributes" } "Test_ImportPfxWithCustomAttributes"
138-
Run-TestProtected { Run-KeyTest {Test_ImportPfxAsHsmWithDefaultAttributes} "Test_ImportPfxAsHsmWithDefaultAttributes" } "Test_ImportPfxAsHsmWithDefaultAttributes"
139-
Run-TestProtected { Run-KeyTest {Test_ImportPfxAsHsmWithCustomAttributes} "Test_ImportPfxAsHsmWithCustomAttributes" } "Test_ImportPfxAsHsmWithCustomAttributes"
140-
Run-TestProtected { Run-KeyTest {Test_ImportByokWithDefaultAttributes} "Test_ImportByokWithDefaultAttributes" } "Test_ImportByokWithDefaultAttributes"
141-
Run-TestProtected { Run-KeyTest {Test_ImportByokWith1024BitKey} "Test_ImportByokWith1024BitKey" } "Test_ImportByokWith1024BitKey"
142-
Run-TestProtected { Run-KeyTest {Test_ImportByokWithCustomAttributes} "Test_ImportByokWithCustomAttributes" } "Test_ImportByokWithCustomAttributes"
143155
Run-TestProtected { Run-KeyTest {Test_AddKeyPositionalParameter} "Test_AddKeyPositionalParameter" } "Test_AddKeyPositionalParameter"
144156
Run-TestProtected { Run-KeyTest {Test_AddKeyAliasParameter} "Test_AddKeyAliasParameter" } "Test_AddKeyAliasParameter"
145157
Run-TestProtected { Run-KeyTest {Test_ImportNonExistPfxFile} "Test_ImportNonExistPfxFile" } "Test_ImportNonExistPfxFile"

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -418,17 +418,19 @@ function Test_UpdateAllEditableKeyAttributes
418418
# Update all attributes
419419
$key=Set-AzureKeyVaultKeyAttribute -VaultName $keyVault -Name $keyname -Expires $newexpires -NotBefore $newnbf -KeyOps $newops -Enable $true -Tags $newtags -PassThru
420420
Assert-KeyAttributes $key.Attributes 'RSA' $true $newexpires $newnbf $newops $newtags
421-
422-
# Create a hsm key for updating
423-
$keyname=Get-KeyName 'uhsm'
424-
$key=Add-AzureKeyVaultKey -VaultName $keyVault -Name $keyname -Destination 'HSM' -Expires $expires -NotBefore $nbf -KeyOps $ops -Disable -Tags $tags
425-
Assert-NotNull $key
426-
$global:createdKeys += $keyname
427-
Assert-KeyAttributes $key.Attributes 'RSA-HSM' $false $expires $nbf $ops $tags
428-
429-
# Update all attributes
430-
$key=Set-AzureKeyVaultKeyAttribute -VaultName $keyVault -Name $keyname -Expires $newexpires -NotBefore $newnbf -KeyOps $newops -Enable $true -Tags $newtags -PassThru
431-
Assert-KeyAttributes $key.Attributes 'RSA-HSM' $true $newexpires $newnbf $newops $newtags
421+
if($global:standardVaultOnly -eq $false)
422+
{
423+
# Create a hsm key for updating
424+
$keyname=Get-KeyName 'uhsm'
425+
$key=Add-AzureKeyVaultKey -VaultName $keyVault -Name $keyname -Destination 'HSM' -Expires $expires -NotBefore $nbf -KeyOps $ops -Disable -Tags $tags
426+
Assert-NotNull $key
427+
$global:createdKeys += $keyname
428+
Assert-KeyAttributes $key.Attributes 'RSA-HSM' $false $expires $nbf $ops $tags
429+
430+
# Update all attributes
431+
$key=Set-AzureKeyVaultKeyAttribute -VaultName $keyVault -Name $keyname -Expires $newexpires -NotBefore $newnbf -KeyOps $newops -Enable $true -Tags $newtags -PassThru
432+
Assert-KeyAttributes $key.Attributes 'RSA-HSM' $true $newexpires $newnbf $newops $newtags
433+
}
432434
}
433435

434436

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ function Initialize-VaultTest
264264
$tenantId = (Get-AzureRmContext).Tenant.TenantId
265265
$tagName = "testtag"
266266
$tagValue = "testvalue"
267+
$sku = "premium"
268+
if($global:standardVaultOnly)
269+
{
270+
$sku = "standard"
271+
}
267272
$vaultId = @{
268273
"ResourceType" = $KeyVaultResourceType;
269274
"ApiVersion" = $KeyVaultApiVersion;
@@ -277,7 +282,7 @@ function Initialize-VaultTest
277282

278283
"sku" = @{
279284
"family" = "A";
280-
"name" = "premium";
285+
"name" = $sku;
281286
}
282287
"accessPolicies" = @();
283288
}
@@ -306,13 +311,18 @@ function Reset-PreCreatedVault
306311
$tagName = "testtag"
307312
$tagValue = "testvalue"
308313
$tenantId = (Get-AzureRmContext).Tenant.TenantId
314+
$sku = "premium"
315+
if($global:standardVaultOnly)
316+
{
317+
$sku = "standard"
318+
}
309319
$vaultProperties = @{
310320
"enabledForDeployment" = $false;
311321
"tenantId" = $tenantId;
312322

313323
"sku" = @{
314324
"family" = "A";
315-
"name" = "premium";
325+
"name" = $sku;
316326
}
317327
"accessPolicies" = @();
318328
}

src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Test/Properties/AssemblyInfo.cs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
using System.Reflection;
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+
using System.Reflection;
216
using System.Runtime.CompilerServices;
317
using System.Runtime.InteropServices;
418
using Xunit;
519

620
// General Information about an assembly is controlled through the following
721
// set of attributes. Change these attribute values to modify the information
822
// associated with an assembly.
9-
[assembly: AssemblyTitle("Microsoft.Azure.Commands.SiteRecovery.Test")]
10-
[assembly: AssemblyDescription("")]
11-
[assembly: AssemblyConfiguration("")]
12-
[assembly: AssemblyCompany("Hewlett-Packard Company")]
13-
[assembly: AssemblyProduct("Commands.SiteRecovery.Test")]
14-
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")]
15-
[assembly: AssemblyTrademark("")]
16-
[assembly: AssemblyCulture("")]
23+
[assembly: AssemblyTitle("Microsoft Azure Powershell - RecoveryServices Tests")]
24+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
25+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
26+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
1727

1828
// Setting ComVisible to false makes the types in this assembly not visible
1929
// to COM components. If you need to access a type in this assembly from

src/ResourceManager/RecoveryServices/Commands.RecoveryServices/Properties/AssemblyInfo.cs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
using System.Reflection;
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+
using System.Reflection;
216
using System.Runtime.CompilerServices;
317
using System.Runtime.InteropServices;
418

519
// General Information about an assembly is controlled through the following
620
// set of attributes. Change these attribute values to modify the information
721
// associated with an assembly.
8-
[assembly: AssemblyTitle("Commands.RecoveryServices")]
9-
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("Hewlett-Packard Company")]
12-
[assembly: AssemblyProduct("Commands.RecoveryServices")]
13-
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")]
14-
[assembly: AssemblyTrademark("")]
15-
[assembly: AssemblyCulture("")]
22+
[assembly: AssemblyTitle("Microsoft Azure Powershell - RecoveryServices Commands")]
23+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
24+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
25+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
1626

1727
// Setting ComVisible to false makes the types in this assembly not visible
1828
// to COM components. If you need to access a type in this assembly from

src/ResourceManager/SiteRecovery/Commands.SiteRecovery.Test/Properties/AssemblyInfo.cs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
using System.Reflection;
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+
using System.Reflection;
216
using System.Runtime.CompilerServices;
317
using System.Runtime.InteropServices;
418
using Xunit;
519

620
// General Information about an assembly is controlled through the following
721
// set of attributes. Change these attribute values to modify the information
822
// associated with an assembly.
9-
[assembly: AssemblyTitle("Microsoft.Azure.Commands.SiteRecovery.Test")]
10-
[assembly: AssemblyDescription("")]
11-
[assembly: AssemblyConfiguration("")]
12-
[assembly: AssemblyCompany("Hewlett-Packard Company")]
13-
[assembly: AssemblyProduct("Commands.SiteRecovery.Test")]
14-
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard Company 2015")]
15-
[assembly: AssemblyTrademark("")]
16-
[assembly: AssemblyCulture("")]
23+
[assembly: AssemblyTitle("Microsoft Azure Powershell - SiteRecovery Tests")]
24+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
25+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
26+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
1727

1828
// Setting ComVisible to false makes the types in this assembly not visible
1929
// to COM components. If you need to access a type in this assembly from

src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Properties/AssemblyInfo.cs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
using System.Reflection;
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+
using System.Reflection;
216
using System.Runtime.CompilerServices;
317
using System.Runtime.InteropServices;
418

519
// General Information about an assembly is controlled through the following
620
// set of attributes. Change these attribute values to modify the information
721
// associated with an assembly.
8-
[assembly: AssemblyTitle("Microsoft Azure Powershell")]
9-
[assembly: AssemblyDescription("")]
10-
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("Microsoft")]
12-
[assembly: AssemblyProduct("Microsoft Azure Powershell")]
13-
[assembly: AssemblyCopyright("Copyright © Microsoft")]
14-
[assembly: AssemblyTrademark("")]
15-
[assembly: AssemblyCulture("")]
22+
[assembly: AssemblyTitle("Microsoft Azure Powershell - SiteRecovery Commands")]
23+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
24+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
25+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
1626

1727
// Setting ComVisible to false makes the types in this assembly not visible
1828
// to COM components. If you need to access a type in this assembly from

0 commit comments

Comments
 (0)