Skip to content

Commit 5b696fd

Browse files
committed
Merge branch 'dev' of https://github.com/AzureRT/azure-powershell into dev
2 parents b0274dd + eacd4dc commit 5b696fd

File tree

7 files changed

+1485
-73
lines changed

7 files changed

+1485
-73
lines changed

ChangeLog.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
2015.03.31 version 0.8.16
2+
* Azure Data Factory:
3+
* Fixes for clean install and subscription registration issues
4+
* Azure HDInsight:
5+
* Support for creating, deleting, listing, and submitting jobs to HDInsight clusters with Linux Operating System.
6+
* Azure Compute
7+
* Fix pipeline issues with Get-AzureVM (#3047)
8+
* Fixed DateTime Overflow issue
9+
* Azure Batch
10+
* Added cmdlets
11+
* Add/Remove Batch Pools
12+
* Get-BatchTaskFileContent
13+
* Get-BatchTaskFile
14+
* Azure Insights
15+
* Added cmdlets
16+
* Add-AutoscaleSetting
17+
* Get-AutoscaleHistory
18+
* Get-AutoscaleSetting
19+
* New-AutoscaleProfile
20+
* New-AutoscaleRule
21+
* Remove-AutoscaleSetting
22+
* Get-Metrics
23+
* Get-MetricDefinitions
24+
* Format-MetricsAsTable
25+
* Azure Websites
26+
* Added cmdlet Get-AzureWebhostingPlanMetrics
27+
* Added Premium support
28+
* Renamed WebSites to WebApp
29+
* AzureProfile
30+
* Made AzureProfile serializable to support workflow scenarios
31+
132
2015.03.11 version 0.8.15.1
233
* Fixes for clean install and subscription registration issues
334

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@
201201
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AutomationTests\TestAutomationSuspendAndResumeJob.json">
202202
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
203203
</None>
204+
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.AzureVMTests\TestGetAzureVM.json">
205+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
206+
</None>
204207
<None Include="SessionRecords\Microsoft.WindowsAzure.Commands.ScenarioTest.SchedulerTests\TestSchedulerEndToEnd.json">
205208
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
206209
</None>
@@ -282,10 +285,10 @@
282285
<Compile Include="Resources\ResourceLocator.cs" />
283286
<Compile Include="Scheduler\SchedulerTests.cs" />
284287
<Compile Include="ServiceBusTests\ServiceBusAuthorizationRuleTests.cs" />
288+
<Compile Include="ServiceManagement\GetVMTests.cs" />
285289
<Compile Include="StorageTests\StorageContainerTest.cs" />
286290
<Compile Include="StorageTests\StorageContextTest.cs" />
287291
<Compile Include="StoreTests\StoreTests.cs" />
288-
<Compile Include="ServiceManagement\VMProvisionScenarioTests.cs" />
289292
<Compile Include="TrafficManagerTests\TrafficManagerTests.cs" />
290293
<Compile Include="WAPackIaaS\CloudService\CmdletTestCloudServiceBase.cs" />
291294
<Compile Include="WAPackIaaS\CloudService\GetWAPackCloudServiceTests.cs" />
@@ -406,7 +409,7 @@
406409
<None Include="Resources\CloudService\Cache\mc.tgz">
407410
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
408411
</None>
409-
<None Include="Resources\ServiceManagement\VMProvisionTests.ps1">
412+
<None Include="Resources\ServiceManagement\AzureVMTests.ps1">
410413
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
411414
</None>
412415
<None Include="Resources\ServiceManagement\Common.ps1">

src/Common/Commands.ScenarioTest/Resources/ServiceManagement/VMProvisionTests.ps1 renamed to src/Common/Commands.ScenarioTest/Resources/ServiceManagement/AzureVMTests.ps1

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,30 @@
1818
.SYNOPSIS
1919
Tests Create-AzureVM with valid information.
2020
#>
21-
function Test-CreateWindowsAzureQuickVM
21+
function Test-GetAzureVM
2222
{
2323
# Setup
24+
2425
$location = Get-DefaultLocation
26+
$imgName = Get-DefaultImage $location
27+
28+
29+
$storageName = getAssetName
30+
New-AzureStorageAccount -StorageAccountName $storageName -Location $location
31+
32+
Set-CurrentStorageAccountName $storageName
33+
34+
$vmName = "vm1"
35+
$svcName = Get-CloudServiceName
2536

2637
# Test
27-
New-AzureQuickVM -Windows -ImageName $imageName -Name $newAzureQuickVMName -ServiceName $newAzureQuickVMSvcName -Password "p@ssw0rd" -Location $location
28-
}
38+
New-AzureService -ServiceName $svcName -Location $location
39+
New-AzureQuickVM -Windows -ImageName $imgName -Name $vmName -ServiceName $svcName -AdminUsername "pstestuser" -Password "p@ssw0rd"
40+
41+
Get-AzureVM -ServiceName $svcName -Name $vmName
42+
43+
44+
# Cleanup
45+
Cleanup-CloudService $svcName
46+
}
47+

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

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,79 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15+
1516
<#
1617
.SYNOPSIS
17-
Sets
18+
Sets the default storage account
1819
#>
1920
function Set-CurrentStorageAccountName
2021
{
21-
Get-AzureSubscription -Default | Set-AzureSubscription -CurrentStorageAccountName ""
22-
}
22+
param([string] $storageAccountName)
23+
$currentSubscription = Get-AzureSubscription -Current
24+
25+
Set-AzureSubscription -SubscriptionId $currentSubscription.SubscriptionId -CurrentStorageAccountName $storageAccountName
26+
}
27+
28+
<#
29+
.SYNOPSIS
30+
Gets the default location
31+
#>
32+
function Get-DefaultLocation
33+
{
34+
return (Get-AzureLocation)[0].Name
35+
}
36+
37+
<#
38+
.SYNOPSIS
39+
Gets the default image
40+
#>
41+
function Get-DefaultImage
42+
{
43+
param([string] $loc)
44+
return (Get-AzureVMImage | where {$_.OS -eq "Windows"} | where {$_.Location.Contains($loc)})[0].ImageName
45+
}
46+
47+
48+
<#
49+
.SYNOPSIS
50+
Gets valid and available cloud service name.
51+
#>
52+
function Get-CloudServiceName
53+
{
54+
return getAssetName
55+
}
56+
57+
<#
58+
.SYNOPSIS
59+
Cleanup cloud service
60+
#>
61+
function Cleanup-CloudService
62+
{
63+
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+
}
72+
}
73+
74+
<#
75+
.SYNOPSIS
76+
Cleanup storage
77+
#>
78+
function Cleanup-Storage
79+
{
80+
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+
}
90+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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.Azure.Common.Authentication;
16+
using Microsoft.Azure.Test;
17+
using System.Collections.Generic;
18+
using System.IO;
19+
using System.Linq;
20+
using Xunit;
21+
22+
namespace Microsoft.WindowsAzure.Commands.ScenarioTest
23+
{
24+
public class AzureVMTests
25+
{
26+
private EnvironmentSetupHelper helper = new EnvironmentSetupHelper();
27+
28+
#region Get-AzureVM Scenario Tests
29+
30+
[Fact]
31+
[Trait(Category.Service, Category.ServiceManagement)]
32+
[Trait(Category.AcceptanceType, Category.CheckIn)]
33+
[Trait(Category.AcceptanceType, Category.BVT)]
34+
public void TestGetAzureVM()
35+
{
36+
this.RunPowerShellTest("Test-GetAzureVM");
37+
}
38+
#endregion
39+
40+
protected void SetupManagementClients()
41+
{
42+
helper.SetupSomeOfManagementClients();
43+
}
44+
45+
protected void RunPowerShellTest(params string[] scripts)
46+
{
47+
using (UndoContext context = UndoContext.Current)
48+
{
49+
context.Start(TestUtilities.GetCallingClass(1), TestUtilities.GetCurrentMethodName(2));
50+
51+
SetupManagementClients();
52+
53+
List<string> modules = Directory.GetFiles("Resources\\ServiceManagement", "*.ps1").ToList();
54+
modules.Add("Common.ps1");
55+
56+
helper.SetupEnvironment(AzureModule.AzureServiceManagement);
57+
helper.SetupModules(AzureModule.AzureServiceManagement, modules.ToArray());
58+
59+
helper.RunPowerShellTest(scripts);
60+
}
61+
}
62+
}
63+
}

src/Common/Commands.ScenarioTest/ServiceManagement/VMProvisionScenarioTests.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/Common/Commands.ScenarioTest/SessionRecords/Microsoft.WindowsAzure.Commands.ScenarioTest.AzureVMTests/TestGetAzureVM.json

Lines changed: 1293 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)