Skip to content

Commit 546240b

Browse files
committed
Merge pull request #6 from Azure/build
update
2 parents 435aa93 + 9340028 commit 546240b

File tree

237 files changed

+25229
-16188
lines changed

Some content is hidden

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

237 files changed

+25229
-16188
lines changed

AzurePowershell.Test.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<XUnitTests Include=".\src\ServiceManagement\RemoteApp\Commands.RemoteApp.Test\bin\Debug\Microsoft.Azure.Commands.RemoteApp.Tests.dll"/>
5555
<XUnitTests Include=".\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll"/>
5656
<XUnitTests Include=".\src\ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\bin\Debug\Microsoft.Azure.Commands.RecoveryServices.Test.dll"/>
57+
<XUnitTests Include=".\src\ResourceManager\TrafficManager\Commands.TrafficManager2.Test\bin\Debug\Microsoft.Azure.Commands.TrafficManager.Test.ScenarioTests.dll"/>
5758
</ItemGroup>
5859

5960
<Target Name="InvokeMSTest">

ChangeLog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Added cmdlets
44
* New-AzureBatchVMUser
55
* Remove-AzureBatchVMUser
6+
* Get-AzureBatchRDPFile
7+
* Get-AzureBatchVMFileContents
68

79
2015.03.31 version 0.8.16
810
* Azure Data Factory:

src/AzurePowershell.sln

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.31101.0
3+
VisualStudioVersion = 12.0.21005.1
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
66
ProjectSection(SolutionItems) = preProject
@@ -192,6 +192,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network.Test", "Re
192192
EndProject
193193
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network", "ResourceManager\Network\Commands.Network\Commands.Network.csproj", "{98CFD96B-A6BC-4F15-AE2C-603FC2B58981}"
194194
EndProject
195+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.TrafficManager2", "ResourceManager\TrafficManager\Commands.TrafficManager2\Commands.TrafficManager2.csproj", "{270CBB5F-BB8A-4E33-B35B-95698E607D97}"
196+
EndProject
197+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.TrafficManager2.Test", "ResourceManager\TrafficManager\Commands.TrafficManager2.Test\Commands.TrafficManager2.Test.csproj", "{5764A3A4-586C-4536-8481-13007CAC111B}"
198+
EndProject
195199
Global
196200
GlobalSection(SolutionConfigurationPlatforms) = preSolution
197201
Debug|Any CPU = Debug|Any CPU
@@ -458,12 +462,19 @@ Global
458462
{98CFD96B-A6BC-4F15-AE2C-603FC2B58981}.Debug|Any CPU.Build.0 = Debug|Any CPU
459463
{98CFD96B-A6BC-4F15-AE2C-603FC2B58981}.Release|Any CPU.ActiveCfg = Release|Any CPU
460464
{98CFD96B-A6BC-4F15-AE2C-603FC2B58981}.Release|Any CPU.Build.0 = Release|Any CPU
465+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
466+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Debug|Any CPU.Build.0 = Debug|Any CPU
467+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Release|Any CPU.ActiveCfg = Release|Any CPU
468+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Release|Any CPU.Build.0 = Release|Any CPU
469+
{5764A3A4-586C-4536-8481-13007CAC111B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
470+
{5764A3A4-586C-4536-8481-13007CAC111B}.Debug|Any CPU.Build.0 = Debug|Any CPU
471+
{5764A3A4-586C-4536-8481-13007CAC111B}.Release|Any CPU.ActiveCfg = Release|Any CPU
472+
{5764A3A4-586C-4536-8481-13007CAC111B}.Release|Any CPU.Build.0 = Release|Any CPU
461473
EndGlobalSection
462474
GlobalSection(SolutionProperties) = preSolution
463475
HideSolutionNode = FALSE
464476
EndGlobalSection
465477
GlobalSection(NestedProjects) = preSolution
466-
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
467478
{37455286-D8A7-4E0C-8B4D-C517D20C641A} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
468479
{D6F470A6-7395-4B8B-9D29-44DF0EC8F624} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
469480
{A3965B66-5A3E-4B8C-9574-28E5958D4828} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
@@ -474,6 +485,7 @@ Global
474485
{4BC0E3D3-6EDD-43AA-8F15-DCFED8ACC93D} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
475486
{9D5A40CA-5594-4F5C-8230-7ADF7CC0558E} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
476487
{3B48A77B-5956-4A62-9081-92BA04B02B27} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
488+
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
477489
{4C2FE49A-09E1-4979-AD46-CD64FD04C8F7} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
478490
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
479491
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
@@ -496,5 +508,6 @@ Global
496508
{CA82D500-1940-4068-A076-D7A8AD459FB0} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
497509
{37C44181-3F1B-4ABD-8089-26DFAB4B6BA8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
498510
{A2DF4FE5-46EE-43E2-B246-E5CDDD47B752} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
511+
{5764A3A4-586C-4536-8481-13007CAC111B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
499512
EndGlobalSection
500513
EndGlobal

src/ResourceManager.sln

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights", "Resour
5151
EndProject
5252
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites", "ResourceManager\Websites\Commands.Websites\Commands.Websites.csproj", "{80A92297-7C92-456B-8EE7-9FB6CE30149D}"
5353
EndProject
54-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites.Test", "ResourceManager\Websites\Commands.Websites.Test\Commands.Websites.Test.csproj", "{F4ABAD68-64A5-4B23-B09C-42559A7524DE}"
54+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites.Test", "ResourceManager\Websites\Commands.Websites.Test\Commands.Websites.Test.csproj", "{13E031E4-8A43-4B87-9D72-D70180C31C11}"
5555
EndProject
5656
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights.Test", "ResourceManager\Insights\Commands.Insights.Test\Commands.Insights.Test.csproj", "{469F20E0-9D40-41AD-94C3-B47AD15A4C00}"
5757
EndProject
58+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.TrafficManager2.Test", "ResourceManager\TrafficManager\Commands.TrafficManager2.Test\Commands.TrafficManager2.Test.csproj", "{5764A3A4-586C-4536-8481-13007CAC111B}"
59+
EndProject
60+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.TrafficManager2", "ResourceManager\TrafficManager\Commands.TrafficManager2\Commands.TrafficManager2.csproj", "{270CBB5F-BB8A-4E33-B35B-95698E607D97}"
61+
EndProject
5862
Global
5963
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6064
Debug|Any CPU = Debug|Any CPU
@@ -141,14 +145,22 @@ Global
141145
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.Build.0 = Debug|Any CPU
142146
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.ActiveCfg = Release|Any CPU
143147
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.Build.0 = Release|Any CPU
144-
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
145-
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
146-
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
147-
{F4ABAD68-64A5-4B23-B09C-42559A7524DE}.Release|Any CPU.Build.0 = Release|Any CPU
148+
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
149+
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Debug|Any CPU.Build.0 = Debug|Any CPU
150+
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Release|Any CPU.ActiveCfg = Release|Any CPU
151+
{13E031E4-8A43-4B87-9D72-D70180C31C11}.Release|Any CPU.Build.0 = Release|Any CPU
148152
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
149153
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Debug|Any CPU.Build.0 = Debug|Any CPU
150154
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.ActiveCfg = Release|Any CPU
151155
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.Build.0 = Release|Any CPU
156+
{5764A3A4-586C-4536-8481-13007CAC111B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
157+
{5764A3A4-586C-4536-8481-13007CAC111B}.Debug|Any CPU.Build.0 = Debug|Any CPU
158+
{5764A3A4-586C-4536-8481-13007CAC111B}.Release|Any CPU.ActiveCfg = Release|Any CPU
159+
{5764A3A4-586C-4536-8481-13007CAC111B}.Release|Any CPU.Build.0 = Release|Any CPU
160+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
161+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Debug|Any CPU.Build.0 = Debug|Any CPU
162+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Release|Any CPU.ActiveCfg = Release|Any CPU
163+
{270CBB5F-BB8A-4E33-B35B-95698E607D97}.Release|Any CPU.Build.0 = Release|Any CPU
152164
EndGlobalSection
153165
GlobalSection(SolutionProperties) = preSolution
154166
HideSolutionNode = FALSE
@@ -162,7 +174,8 @@ Global
162174
{080B0477-7E52-4455-90AB-23BD13D1B1CE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
163175
{56ED8C97-53B9-4DF6-ACB5-7E6800105BF8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
164176
{7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
177+
{13E031E4-8A43-4B87-9D72-D70180C31C11} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
165178
{469F20E0-9D40-41AD-94C3-B47AD15A4C00} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
166-
{F4ABAD68-64A5-4B23-B09C-42559A7524DE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
179+
{5764A3A4-586C-4536-8481-13007CAC111B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
167180
EndGlobalSection
168181
EndGlobal

src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,11 @@
154154
<Compile Include="Accounts\RemoveBatchAccountCommandTests.cs" />
155155
<Compile Include="Accounts\SetBatchAccountCommandTests.cs" />
156156
<Compile Include="BatchTestHelpers.cs" />
157+
<Compile Include="Files\GetBatchRDPFileCommandTests.cs" />
157158
<Compile Include="Files\GetBatchTaskFileCommandTests.cs" />
158159
<Compile Include="Files\GetBatchTaskFileContentCommandTests.cs" />
159160
<Compile Include="Files\GetBatchVMFileCommandTests.cs" />
161+
<Compile Include="Files\GetBatchVMFileContentCommandTests.cs" />
160162
<Compile Include="Jobs\GetBatchJobCommandTests.cs" />
161163
<Compile Include="Jobs\RemoveBatchJobCommandTests.cs" />
162164
<Compile Include="Models\BatchAccountContextTest.cs" />
@@ -237,6 +239,12 @@
237239
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests\TestUpdatesExistingBatchAccount.json">
238240
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
239241
</None>
242+
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.FileTests\TestGetRDPFileByName.json">
243+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
244+
</None>
245+
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.FileTests\TestGetRDPFilePipeline.json">
246+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
247+
</None>
240248
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.FileTests\TestGetTaskFileByName.json">
241249
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
242250
</None>
@@ -249,6 +257,12 @@
249257
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.FileTests\TestGetVMFileByName.json">
250258
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
251259
</None>
260+
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.FileTests\TestGetVMFileContentByName.json">
261+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
262+
</None>
263+
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.FileTests\TestGetVMFileContentPipeline.json">
264+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
265+
</None>
252266
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.FileTests\TestListAllTaskFiles.json">
253267
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
254268
</None>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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;
16+
using System.IO;
17+
using Microsoft.Azure.Batch;
18+
using Microsoft.Azure.Batch.Common;
19+
using Microsoft.Azure.Batch.Protocol;
20+
using Microsoft.Azure.Batch.Protocol.Entities;
21+
using Microsoft.Azure.Commands.Batch.Models;
22+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
23+
using Moq;
24+
using System.Collections.Generic;
25+
using System.Linq;
26+
using System.Management.Automation;
27+
using System.Threading.Tasks;
28+
using Xunit;
29+
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;
30+
31+
namespace Microsoft.Azure.Commands.Batch.Test.Files
32+
{
33+
public class GetBatchRDPFileCommandTests
34+
{
35+
private GetBatchRDPFileCommand cmdlet;
36+
private Mock<BatchClient> batchClientMock;
37+
private Mock<ICommandRuntime> commandRuntimeMock;
38+
39+
public GetBatchRDPFileCommandTests()
40+
{
41+
batchClientMock = new Mock<BatchClient>();
42+
commandRuntimeMock = new Mock<ICommandRuntime>();
43+
cmdlet = new GetBatchRDPFileCommand()
44+
{
45+
CommandRuntime = commandRuntimeMock.Object,
46+
BatchClient = batchClientMock.Object,
47+
};
48+
}
49+
50+
[Fact]
51+
[Trait(Category.AcceptanceType, Category.CheckIn)]
52+
public void GetBatchRDPFileParametersTest()
53+
{
54+
// Setup cmdlet without required parameters
55+
BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys();
56+
cmdlet.BatchContext = context;
57+
cmdlet.PoolName = null;
58+
cmdlet.VMName = null;
59+
cmdlet.VM = null;
60+
cmdlet.DestinationPath = null;
61+
62+
// Don't go to the service on a GetTVMRDPFile call
63+
YieldInjectionInterceptor interceptor = new YieldInjectionInterceptor((opContext, request) =>
64+
{
65+
if (request is GetTVMRDPFileRequest)
66+
{
67+
GetTVMRDPFileResponse response = new GetTVMRDPFileResponse();
68+
Task<object> task = Task<object>.Factory.StartNew(() => { return response; });
69+
return task;
70+
}
71+
return null;
72+
});
73+
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
74+
75+
using (MemoryStream memStream = new MemoryStream())
76+
{
77+
// Don't hit the file system during unit tests
78+
cmdlet.DestinationStream = memStream;
79+
80+
Assert.Throws<ArgumentNullException>(() => cmdlet.ExecuteCmdlet());
81+
82+
// Fill required Task file details
83+
cmdlet.PoolName = "pool";
84+
cmdlet.VMName = "vm1";
85+
86+
// Verify no exceptions occur
87+
cmdlet.ExecuteCmdlet();
88+
}
89+
}
90+
}
91+
}

src/ResourceManager/Batch/Commands.Batch.Test/Files/GetBatchTaskFileContentCommandTests.cs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public void GetBatchTaskFileParametersTest()
6363

6464
string fileName = "stdout.txt";
6565

66-
// Don't hit the file system during unit tests
67-
cmdlet.Stream = new MemoryStream();
68-
6966
// Don't go to the service on a GetTaskFile call or GetTaskFileProperties call
7067
YieldInjectionInterceptor interceptor = new YieldInjectionInterceptor((opContext, request) =>
7168
{
@@ -85,23 +82,22 @@ public void GetBatchTaskFileParametersTest()
8582
});
8683
cmdlet.AdditionalBehaviors = new List<BatchClientBehavior>() { interceptor };
8784

88-
Assert.Throws<ArgumentNullException>(() => cmdlet.ExecuteCmdlet());
85+
using (MemoryStream memStream = new MemoryStream())
86+
{
87+
// Don't hit the file system during unit tests
88+
cmdlet.DestinationStream = memStream;
8989

90-
// Fill required Task file details
91-
cmdlet.WorkItemName = "workItem";
92-
cmdlet.JobName = "job-0000000001";
93-
cmdlet.TaskName = "task";
94-
cmdlet.Name = fileName;
90+
Assert.Throws<ArgumentNullException>(() => cmdlet.ExecuteCmdlet());
91+
92+
// Fill required Task file details
93+
cmdlet.WorkItemName = "workItem";
94+
cmdlet.JobName = "job-0000000001";
95+
cmdlet.TaskName = "task";
96+
cmdlet.Name = fileName;
9597

96-
try
97-
{
9898
// Verify no exceptions occur
9999
cmdlet.ExecuteCmdlet();
100100
}
101-
finally
102-
{
103-
cmdlet.Stream.Dispose();
104-
}
105101
}
106102
}
107103
}

0 commit comments

Comments
 (0)