Skip to content

Commit 2afe8b3

Browse files
committed
Merge pull request #603 from huangpf/dev
AzureRT S51 - Fix Start/Stop-AzureVM
2 parents 1cef2c3 + 9eac154 commit 2afe8b3

File tree

5 files changed

+3568
-622
lines changed

5 files changed

+3568
-622
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ function Run-StartAndStopMultipleVirtualMachinesTest
123123
Start-AzureVM -ServiceName $svcName -VM $vmList[0];
124124
Start-AzureVM -ServiceName $svcName -VM $vmList[0],$vmList[1];
125125
Start-AzureVM -ServiceName $svcName -VM $vmList;
126-
}
127-
catch
128-
{
129-
130126
}
131127
finally
132128
{

src/Common/Commands.ScenarioTest/SessionRecords/Microsoft.WindowsAzure.Commands.ScenarioTest.ServiceManagementTests/RunStartAndStopMultipleVirtualMachinesTest.json

Lines changed: 3561 additions & 613 deletions
Large diffs are not rendered by default.

src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/ServiceManagementTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ public static void SetTestSettings()
294294

295295
protected void StartTest(string testname, DateTime testStartTime)
296296
{
297-
Console.WriteLine("{0} test starts at {1}", testname, testStartTime);
297+
string subId = defaultAzureSubscription.SubscriptionId;
298+
string endPoint = defaultAzureSubscription.ServiceEndpoint;
299+
Console.WriteLine("{0} test starts at {1} for subscription {2} and endpoint {3}", testname, testStartTime, subId, endPoint);
298300
}
299301

300302
private static void Retry(string cmdlet, string message, int maxTry = 1, int intervalSecond = 10)

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/StartAzureVM.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class StartAzureVMCommand : IaaSDeploymentManagementCmdletBase
3434
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Virtual Machine to restart.", ParameterSetName = "Input")]
3535
[ValidateNotNullOrEmpty]
3636
[Alias("InputObject")]
37-
public PersistentVM[] VM { get; set; }
37+
public IPersistentVM[] VM { get; set; }
3838

3939
protected override void ExecuteCommand()
4040
{
@@ -47,7 +47,7 @@ protected override void ExecuteCommand()
4747
return;
4848
}
4949

50-
string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.RoleName).ToArray();
50+
string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.GetInstance().RoleName).ToArray();
5151

5252
// Generate a list of role names matching wildcard patterns or
5353
// the exact name specified in the -Name parameter.

src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/PersistentVMs/StopAzureVM.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class StopAzureVMCommand : IaaSDeploymentManagementCmdletBase
3636
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The Virtual Machine to restart.", ParameterSetName = "Input")]
3737
[ValidateNotNullOrEmpty]
3838
[Alias("InputObject")]
39-
public Model.PersistentVM[] VM { get; set; }
39+
public Model.IPersistentVM[] VM { get; set; }
4040

4141
[Parameter(Position = 2, HelpMessage = "Keeps the VM provisioned")]
4242
public SwitchParameter StayProvisioned { get; set; }
@@ -54,7 +54,7 @@ protected override void ExecuteCommand()
5454
return;
5555
}
5656

57-
string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.RoleName).ToArray();
57+
string[] inputRoleNames = (this.ParameterSetName == "ByName") ? this.Name : this.VM.Select(vm => vm.GetInstance().RoleName).ToArray();
5858

5959
// Generate a list of role names matching regular expressions or
6060
// the exact name specified in the -Name parameter.

0 commit comments

Comments
 (0)