Skip to content

Commit f9fee87

Browse files
Merge remote-tracking branch 'azure-powershell/dev' into dev
Conflicts: ChangeLog.txt
2 parents 31811ed + aa8cfc7 commit f9fee87

File tree

164 files changed

+22166
-21643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+22166
-21643
lines changed

AzurePowershell.Test.targets

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ScenarioTestDebug>.\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll</ScenarioTestDebug>
99
<CommonTestDebug>.\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll</CommonTestDebug>
1010
<SqlTestDebug>.\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll</SqlTestDebug>
11+
<ComputeDebug>.\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.dll</ComputeDebug>
1112
<ComputeTestDebug>.\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll</ComputeTestDebug>
1213
<NetworkTestDebug>.\src\ResourceManager\Network\Commands.Network.Test\bin\Debug\Microsoft.Azure.Commands.Network.Test.dll</NetworkTestDebug>
1314
<AzureRTTestSettings>.\src\AzureRT.testsettings</AzureRTTestSettings>
@@ -393,6 +394,14 @@
393394
ContinueOnError="false" />
394395
</Target>
395396

397+
<Target Name="ComputeCodeCoverage" DependsOnTargets="ForceRestorePackages;Clean;BuildDebug">
398+
<Message Importance="high" Text="Gathering Code Coverage data from Compute tests..." />
399+
<Delete Files="Project.covarage" />
400+
<Exec
401+
Command="C:\cc\ComputeCodeCoverage.cmd $(ComputeDebug) $(ComputeTestDebug)"
402+
ContinueOnError="false" />
403+
</Target>
404+
396405
<!-- DSC extension related targets -->
397406
<Target Name="TestDSCExtension_x64">
398407
<Message Importance="high" Text="Running DSC extension BVT x64 tests..." />

ChangeLog.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@
99
* Get-AzureSqlDatabaseRestorePoints
1010
* Changed cmdlets:
1111
* New-AzureSqlDatabase - Can now create Azure Sql Data Warehouse databases
12-
12+
* RedisCache cmdlets
13+
* Set-AzureRedisCache - Added support for scaling, using RedisConfiguration instead of MaxMemoryPolicy #513
14+
* New-AzureRedisCache - Using RedisConfiguration instead of MaxMemoryPolicy #513
15+
* Azure Key Vault cmdlets
16+
* Updated Key Vault package versions
17+
* Fixed bugs related to secrets
18+
* Azure Resource Manager
19+
* Added Test-AzureResourceGroup and Test-AzureResource cmdlets
20+
* Refactored Resource Lock cmdlets
21+
* Removed unnecessary code when getting a resource
22+
1323
2015.06.05 version 0.9.3
1424
* Fixed bug in Websites cmdlets related to slots #454
1525
* Fix bug in Set-AzureResource cmdlet #456

src/Common/Commands.ScenarioTest/AutomationTests/AutomationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected void RunPowerShellTest(params string[] scripts)
100100
modules.Add("Common.ps1");
101101

102102
helper.SetupEnvironment(AzureModule.AzureServiceManagement);
103-
helper.SetupModules(AzureModule.AzureServiceManagement, modules.ToArray());
103+
helper.SetupModulesFromCommon(AzureModule.AzureServiceManagement, modules.ToArray());
104104

105105
helper.RunPowerShellTest(scripts);
106106
}

src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -183,94 +183,97 @@
183183
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
184184
</None>
185185
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationConfigureRunbook.json">
186-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
186+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
187187
</None>
188188
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationPublishAndEditRunbook.json">
189-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
189+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
190190
</None>
191191
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationRunbookWithParameter.json">
192-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
192+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
193193
</None>
194194
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationStartAndStopRunbook.json">
195-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
195+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
196196
</None>
197197
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationStartRunbookOnASchedule.json">
198-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
198+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
199199
</None>
200200
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationStartUnpublishedRunbook.json">
201-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
201+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
202202
</None>
203203
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationSuspendAndResumeJob.json">
204-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
204+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
205+
</None>
206+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AzureVMTests\TestGetAzureLocation.json">
207+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
205208
</None>
206209
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AzureVMTests\TestGetAzureVM.json">
207210
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
208211
</None>
209212
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.SchedulerTests\TestSchedulerEndToEnd.json">
210-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
213+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
211214
</None>
212215
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestAddAzureTrafficManagerEndpoint.json">
213-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
216+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
214217
</None>
215218
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestAddAzureTrafficManagerEndpointNoWeightLocation.json">
216-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
219+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
217220
</None>
218221
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestAddMultipleAzureTrafficManagerEndpoint.json">
219-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
222+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
220223
</None>
221224
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestCreateAndRemoveProfile.json">
222-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
225+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
223226
</None>
224227
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestDisableProfile.json">
225-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
228+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
226229
</None>
227230
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestDisableProfileWithInvalidCredentials.json">
228-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
231+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
229232
</None>
230233
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestEnableProfile.json">
231-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
234+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
232235
</None>
233236
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestEnableProfileWithInvalidCredentials.json">
234-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
237+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
235238
</None>
236239
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestGetMultipleProfiles.json">
237-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
240+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
238241
</None>
239242
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestGetProfile.json">
240-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
243+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
241244
</None>
242245
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestGetProfileWithInvalidCredentials.json">
243-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
246+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
244247
</None>
245248
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestNewProfile.json">
246-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
249+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
247250
</None>
248251
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestNewProfileInvalidParameters.json">
249-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
252+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
250253
</None>
251254
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestRemoveAzureTrafficManagerEndpoint.json">
252-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
255+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
253256
</None>
254257
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestRemoveProfileWithInvalidCredentials.json">
255-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
258+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
256259
</None>
257260
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestRemoveProfileWithNonExistingName.json">
258-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
261+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
259262
</None>
260263
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestSetAzureTrafficManagerEndpoint.json">
261-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
264+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
262265
</None>
263266
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestSetAzureTrafficManagerEndpointAdds.json">
264-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
267+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
265268
</None>
266269
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestSetAzureTrafficManagerEndpointUpdateWeightLocation.json">
267-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
270+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
268271
</None>
269272
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestSetProfileProperty.json">
270-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
273+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
271274
</None>
272275
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.TrafficManagerTests\TestTestAzureTrafficManagerDomainName.json">
273-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
276+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
274277
</None>
275278
<None Include="Resources\Storage\StorageContext.ps1">
276279
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -287,6 +290,7 @@
287290
<Compile Include="Resources\ResourceLocator.cs" />
288291
<Compile Include="Scheduler\SchedulerTests.cs" />
289292
<Compile Include="ServiceBusTests\ServiceBusAuthorizationRuleTests.cs" />
293+
<Compile Include="ServiceManagement\GetLocationTests.cs" />
290294
<Compile Include="ServiceManagement\GetVMTests.cs" />
291295
<Compile Include="StorageTests\StorageContainerTest.cs" />
292296
<Compile Include="StorageTests\StorageContextTest.cs" />

src/Common/Commands.ScenarioTest/Resources/ServiceManagement/AzureVMTests.ps1

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,52 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15-
########################################################################### Create-AzureVM Scenario Tests ###########################################################################
16-
1715
<#
1816
.SYNOPSIS
1917
Tests Create-AzureVM with valid information.
2018
#>
2119
function Test-GetAzureVM
2220
{
23-
# Setup
21+
# Setup
2422

25-
$location = Get-DefaultLocation
26-
$imgName = Get-DefaultImage $location
23+
$location = Get-DefaultLocation
24+
$imgName = Get-DefaultImage $location
2725

2826

29-
$storageName = getAssetName
30-
New-AzureStorageAccount -StorageAccountName $storageName -Location $location
27+
$storageName = getAssetName
28+
New-AzureStorageAccount -StorageAccountName $storageName -Location $location
3129

32-
Set-CurrentStorageAccountName $storageName
30+
Set-CurrentStorageAccountName $storageName
3331

34-
$vmName = "vm1"
35-
$svcName = Get-CloudServiceName
32+
$vmName = "vm1"
33+
$svcName = Get-CloudServiceName
3634

37-
# Test
38-
New-AzureService -ServiceName $svcName -Location $location
39-
New-AzureQuickVM -Windows -ImageName $imgName -Name $vmName -ServiceName $svcName -AdminUsername "pstestuser" -Password "p@ssw0rd"
35+
# Test
36+
New-AzureService -ServiceName $svcName -Location $location
37+
New-AzureQuickVM -Windows -ImageName $imgName -Name $vmName -ServiceName $svcName -AdminUsername "pstestuser" -Password "p@ssw0rd"
4038

41-
Get-AzureVM -ServiceName $svcName -Name $vmName
39+
Get-AzureVM -ServiceName $svcName -Name $vmName
4240

4341

44-
# Cleanup
45-
Cleanup-CloudService $svcName
42+
# Cleanup
43+
Cleanup-CloudService $svcName
4644
}
4745

46+
47+
<#
48+
.SYNOPSIS
49+
Test Get-AzureLocation
50+
#>
51+
function Test-GetAzureLocation
52+
{
53+
$locations = Get-AzureLocation;
54+
55+
foreach ($loc in $locations)
56+
{
57+
$svcName = getAssetName;
58+
$st = New-AzureService -ServiceName $svcName -Location $loc.Name;
59+
60+
# Cleanup
61+
Cleanup-CloudService $svcName
62+
}
63+
}

src/Common/Commands.ScenarioTest/Resources/ServiceManagement/Common.ps1

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Sets the default storage account
2020
function Set-CurrentStorageAccountName
2121
{
2222
param([string] $storageAccountName)
23-
$currentSubscription = Get-AzureSubscription -Current
23+
$currentSubscription = Get-AzureSubscription -Current
2424

25-
Set-AzureSubscription -SubscriptionId $currentSubscription.SubscriptionId -CurrentStorageAccountName $storageAccountName
25+
Set-AzureSubscription -SubscriptionId $currentSubscription.SubscriptionId -CurrentStorageAccountName $storageAccountName
2626
}
2727

2828
<#
@@ -31,7 +31,7 @@ Gets the default location
3131
#>
3232
function Get-DefaultLocation
3333
{
34-
return (Get-AzureLocation)[0].Name
34+
return (Get-AzureLocation)[0].Name
3535
}
3636

3737
<#
@@ -41,7 +41,7 @@ Gets the default image
4141
function Get-DefaultImage
4242
{
4343
param([string] $loc)
44-
return (Get-AzureVMImage | where {$_.OS -eq "Windows"} | where {$_.Location.Contains($loc)})[0].ImageName
44+
return (Get-AzureVMImage | where {$_.OS -eq "Windows"} | where {$_.Location.Contains($loc)})[0].ImageName
4545
}
4646

4747

@@ -51,7 +51,7 @@ Gets valid and available cloud service name.
5151
#>
5252
function Get-CloudServiceName
5353
{
54-
return getAssetName
54+
return getAssetName
5555
}
5656

5757
<#
@@ -61,14 +61,14 @@ Cleanup cloud service
6161
function Cleanup-CloudService
6262
{
6363
param([string] $name)
64-
try
65-
{
66-
Remove-AzureService -ServiceName $name -Force
67-
}
68-
catch
69-
{
70-
Write-Warning "Cannot Remove the Cloud Service"
71-
}
64+
try
65+
{
66+
Remove-AzureService -ServiceName $name -Force
67+
}
68+
catch
69+
{
70+
Write-Warning "Cannot Remove the Cloud Service"
71+
}
7272
}
7373

7474
<#
@@ -78,13 +78,13 @@ Cleanup storage
7878
function Cleanup-Storage
7979
{
8080
param([string] $name)
81-
Remove-AzureStorageAccount -StorageAccountName $name
82-
try
83-
{
84-
Remove-AzureStorageAccount -StorageAccountName $name
85-
}
86-
catch
87-
{
88-
Write-Warning "Cannot Remove the Storage Account"
89-
}
81+
Remove-AzureStorageAccount -StorageAccountName $name
82+
try
83+
{
84+
Remove-AzureStorageAccount -StorageAccountName $name
85+
}
86+
catch
87+
{
88+
Write-Warning "Cannot Remove the Storage Account"
89+
}
9090
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 Microsoft.WindowsAzure.Commands.ScenarioTest.Common;
16+
using Xunit;
17+
18+
namespace Microsoft.WindowsAzure.Commands.ScenarioTest
19+
{
20+
public partial class AzureVMTests
21+
{
22+
[Fact]
23+
[Trait(Category.Service, Category.ServiceManagement)]
24+
[Trait(Category.AcceptanceType, Category.CheckIn)]
25+
[Trait(Category.AcceptanceType, Category.BVT)]
26+
public void TestGetAzureLocation()
27+
{
28+
this.RunPowerShellTest("Test-GetAzureLocation");
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)