Skip to content

Commit aa1f82b

Browse files
committed
Merge pull request #1 from Azure/build
megre upstream
2 parents e053579 + 21883ff commit aa1f82b

File tree

209 files changed

+35191
-5313
lines changed

Some content is hidden

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

209 files changed

+35191
-5313
lines changed

src/Common/Commands.Common.Test/Commands.Common.Test.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@
107107
<Reference Include="Microsoft.WindowsAzure.Management">
108108
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
109109
</Reference>
110-
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
111-
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.11.2.1\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
110+
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=12.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
111+
<SpecificVersion>False</SpecificVersion>
112+
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
112113
</Reference>
113114
<Reference Include="Microsoft.WindowsAzure.Management.Storage">
114115
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>

src/Common/Commands.Common.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1717
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
1818
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
19-
<package id="Microsoft.WindowsAzure.Management.Compute" version="11.2.1" targetFramework="net45" />
19+
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.0.0" targetFramework="net45" />
2020
<package id="Microsoft.WindowsAzure.Management.Storage" version="5.1.1" targetFramework="net45" />
2121
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
2222
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@
103103
<Reference Include="Microsoft.WindowsAzure.Management">
104104
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
105105
</Reference>
106-
<Reference Include="Microsoft.WindowsAzure.Management.Compute">
107-
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.11.2.1\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
108-
<Private>True</Private>
106+
<Reference Include="Microsoft.WindowsAzure.Management.Compute, Version=12.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
107+
<SpecificVersion>False</SpecificVersion>
108+
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.0.0\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
109109
</Reference>
110110
<Reference Include="Microsoft.WindowsAzure.Management.Storage">
111111
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.Storage.5.1.1\lib\net40\Microsoft.WindowsAzure.Management.Storage.dll</HintPath>

src/Common/Commands.ScenarioTest/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1818
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
1919
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
20-
<package id="Microsoft.WindowsAzure.Management.Compute" version="11.2.1" targetFramework="net45" />
20+
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.0.0" targetFramework="net45" />
2121
<package id="Microsoft.WindowsAzure.Management.Storage" version="5.1.1" targetFramework="net45" />
2222
<package id="Microsoft.WindowsAzure.Management.WebSites" version="4.4.2-prerelease" targetFramework="net45" />
2323
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />

src/Common/Commands.ScenarioTests.Common/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class Category
3838

3939
public const string Store = "Store";
4040

41+
public const string Sql = "Sql";
42+
4143
public const string ServiceManagement = "ServiceManagement";
4244

4345
public const string Resources = "Resources";

src/ResourceManager/Compute/Commands.Compute.Test/Commands.Compute.Test.csproj

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@
6666
<SpecificVersion>False</SpecificVersion>
6767
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.18.2-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6868
</Reference>
69-
<Reference Include="Microsoft.Azure.Management.Compute">
70-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.3.4.0-preview\lib\net40\Microsoft.Azure.Management.Compute.dll</HintPath>
69+
<Reference Include="Microsoft.Azure.Management.Compute, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70+
<SpecificVersion>False</SpecificVersion>
71+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.4.0.0-preview\lib\net40\Microsoft.Azure.Management.Compute.dll</HintPath>
7172
</Reference>
7273
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7374
<SpecificVersion>False</SpecificVersion>
@@ -142,12 +143,15 @@
142143
</Reference>
143144
</ItemGroup>
144145
<ItemGroup>
145-
<Compile Include="ScenarioTests\ComputeTestController.cs" />
146+
<Compile Include="Common\ComputeTestController.cs" />
146147
<Compile Include="ScenarioTests\StorageAccountTests.cs" />
148+
<Compile Include="ScenarioTests\TestVirtualMachineImageList.cs" />
149+
<Compile Include="ScenarioTests\TestVirtualMachineList.cs" />
147150
<Compile Include="ScenarioTests\VirtualMachineProfileTests.cs" />
148151
<Compile Include="ScenarioTests\AvailabilitySetTests.cs" />
149152
<Compile Include="ScenarioTests\VirtualMachineExtensionTests.cs" />
150153
<Compile Include="ScenarioTests\VirtualMachineNetworkInterfaceTests.cs" />
154+
<Compile Include="ScenarioTests\TestVirtualMachineSizeAndUsage.cs" />
151155
<Compile Include="ScenarioTests\VirtualMachineTests.cs" />
152156
<Compile Include="Properties\Resources.Designer.cs">
153157
<AutoGen>True</AutoGen>
@@ -259,6 +263,15 @@
259263
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineProfileTests\TestVirtualMachineProfile.json">
260264
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
261265
</None>
266+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineImageList.json">
267+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
268+
</None>
269+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineList.json">
270+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
271+
</None>
272+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineSizeAndUsage.json">
273+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
274+
</None>
262275
</ItemGroup>
263276
<ItemGroup>
264277
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/ComputeTestController.cs renamed to src/ResourceManager/Compute/Commands.Compute.Test/Common/ComputeTestController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void RunPsTestWorkflow(
114114
.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries)
115115
.Last();
116116
helper.SetupModules(
117-
AzureModule.AzureResourceManager,
117+
AzureModule.AzureResourceManager,
118118
"ScenarioTests\\Common.ps1",
119119
"ScenarioTests\\ComputeTestCommon.ps1",
120120
"ScenarioTests\\" + callingClassName + ".ps1");

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/AvailabilitySetTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Test Availability Set
1919
function Test-AvailabilitySet
2020
{
2121
# Setup
22-
$rgname = Get-ComputeTestResourceGroupName
22+
$rgname = Get-ComputeTestResourceName
2323

2424
try
2525
{

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/ComputeTestCommon.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414

1515
<#
1616
.SYNOPSIS
17-
Gets valid resource group name for compute management test
17+
Gets valid resource name for compute test
1818
#>
19-
function Get-ComputeTestResourceGroupName
19+
function Get-ComputeTestResourceName
2020
{
2121
$stack = Get-PSCallStack
2222
$testName = $null;
2323
foreach ($frame in $stack)
2424
{
2525
if ($frame.Command.StartsWith("Test-", "CurrentCultureIgnoreCase"))
2626
{
27-
$testName = $frame.Command
27+
$testName = $frame.Command;
2828
}
2929
}
3030

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/StorageAccountTests.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Test StorageAccount
1919
function Test-StorageAccount
2020
{
2121
# Setup
22-
$rgname = Get-ComputeTestResourceGroupName;
22+
$rgname = Get-ComputeTestResourceName;
2323

2424
try
2525
{
@@ -97,7 +97,7 @@ Test New-AzureStorageAccount
9797
function Test-NewAzureStorageAccount
9898
{
9999
# Setup
100-
$rgname = Get-ComputeTestResourceGroupName;
100+
$rgname = Get-ComputeTestResourceName;
101101

102102
try
103103
{
@@ -126,7 +126,7 @@ Test Get-AzureStorageAccount
126126
function Test-GetAzureStorageAccount
127127
{
128128
# Setup
129-
$rgname = Get-ComputeTestResourceGroupName;
129+
$rgname = Get-ComputeTestResourceName;
130130

131131
try
132132
{
@@ -166,7 +166,7 @@ Test Set-AzureStorageAccount
166166
function Test-SetAzureStorageAccount
167167
{
168168
# Setup
169-
$rgname = Get-ComputeTestResourceGroupName;
169+
$rgname = Get-ComputeTestResourceName;
170170

171171
try
172172
{
@@ -217,7 +217,7 @@ Test Remove-AzureStorageAccount
217217
function Test-RemoveAzureStorageAccount
218218
{
219219
# Setup
220-
$rgname = Get-ComputeTestResourceGroupName;
220+
$rgname = Get-ComputeTestResourceName;
221221

222222
try
223223
{
@@ -246,7 +246,7 @@ Test Get-AzureStorageAccountKey
246246
function Test-GetAzureStorageAccountKey
247247
{
248248
# Setup
249-
$rgname = Get-ComputeTestResourceGroupName;
249+
$rgname = Get-ComputeTestResourceName;
250250

251251
try
252252
{
@@ -278,7 +278,7 @@ Test New-AzureStorageAccountKey
278278
function Test-NewAzureStorageAccountKey
279279
{
280280
# Setup
281-
$rgname = Get-ComputeTestResourceGroupName;
281+
$rgname = Get-ComputeTestResourceName;
282282

283283
try
284284
{
@@ -322,7 +322,7 @@ Test Get-AzureStorageAccount | Get-AzureStorageAccountKey
322322
function Test-PipingGetAccountToGetKey
323323
{
324324
# Setup
325-
$rgname = Get-ComputeTestResourceGroupName;
325+
$rgname = Get-ComputeTestResourceName;
326326

327327
try
328328
{

src/ResourceManager/Sql/Commands.Sql/SqlDatabaseCmdletBase.cs renamed to src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/TestVirtualMachineImageList.cs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,18 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.Commands.Sql.Services;
16-
using Microsoft.WindowsAzure.Commands.Utilities.Common;
15+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
16+
using Xunit;
1717

18-
namespace Microsoft.Azure.Commands.Sql
18+
namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
1919
{
20-
/// <summary>
21-
/// The base class for all Azure Sql Database Management Cmdlets
22-
/// </summary>
23-
public abstract class SqlDatabaseCmdletBase : AzurePSCmdlet
20+
public partial class VirtualMachineTests
2421
{
25-
/// <summary>
26-
/// Stores the per request session Id for all request made in this cmdlet call.
27-
/// </summary>
28-
protected string clientRequestId { get; set; }
29-
30-
internal SqlDatabaseCmdletBase()
22+
[Fact]
23+
[Trait(Category.AcceptanceType, Category.CheckIn)]
24+
public void TestVirtualMachineImageList()
3125
{
32-
this.clientRequestId = Util.GenerateTracingId();
26+
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineImageList");
3327
}
3428
}
35-
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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;
16+
using Xunit;
17+
18+
namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
19+
{
20+
public partial class VirtualMachineTests
21+
{
22+
[Fact]
23+
[Trait(Category.AcceptanceType, Category.CheckIn)]
24+
public void TestVirtualMachineList()
25+
{
26+
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineList");
27+
}
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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;
16+
using Xunit;
17+
18+
namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
19+
{
20+
public partial class VirtualMachineTests
21+
{
22+
[Fact]
23+
[Trait(Category.AcceptanceType, Category.CheckIn)]
24+
public void TestVirtualMachineSizeAndUsage()
25+
{
26+
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineSizeAndUsage");
27+
}
28+
}
29+
}

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Test Virtual Machine Extensions
1919
function Test-VirtualMachineExtension
2020
{
2121
# Setup
22-
$rgname = Get-ComputeTestResourceGroupName
22+
$rgname = Get-ComputeTestResourceName
2323

2424
try
2525
{
@@ -175,13 +175,13 @@ function Test-VirtualMachineExtension
175175
Assert-AreEqual $vm1.HardwareProfile.VirtualMachineSize $vmsize;
176176

177177
# Check Extensions in VM
178-
Assert-AreEqual $vm1.Resources.Extensions.Count 1;
179-
Assert-AreEqual $vm1.Resources.Extensions[0].Name $extname;
180-
Assert-AreEqual $vm1.Resources.Extensions[0].Type 'Microsoft.Compute/virtualMachines/extensions';
181-
Assert-AreEqual $vm1.Resources.Extensions[0].Publisher $publisher;
182-
Assert-AreEqual $vm1.Resources.Extensions[0].ExtensionType $exttype;
183-
Assert-AreEqual $vm1.Resources.Extensions[0].TypeHandlerVersion $extver;
184-
Assert-NotNull $vm1.Resources.Extensions[0].Settings;
178+
Assert-AreEqual $vm1.Extensions.Count 1;
179+
Assert-AreEqual $vm1.Extensions[0].Name $extname;
180+
Assert-AreEqual $vm1.Extensions[0].Type 'Microsoft.Compute/virtualMachines/extensions';
181+
Assert-AreEqual $vm1.Extensions[0].Publisher $publisher;
182+
Assert-AreEqual $vm1.Extensions[0].ExtensionType $exttype;
183+
Assert-AreEqual $vm1.Extensions[0].TypeHandlerVersion $extver;
184+
Assert-NotNull $vm1.Extensions[0].Settings;
185185

186186
<# *** TODO: The removal call did not return. 12/12/2014.
187187

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineNetworkInterfaceTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Test Virtual Machines with single NetworkInterface
1919
function Test-SingleNetworkInterface
2020
{
2121
# Setup
22-
$rgname = Get-ComputeTestResourceGroupName
22+
$rgname = Get-ComputeTestResourceName
2323

2424
try
2525
{
@@ -140,7 +140,7 @@ Test Virtual Machines with a NetworkInterface with DnsSettings
140140
function Test-SingleNetworkInterfaceDnsSettings
141141
{
142142
# Setup
143-
$rgname = Get-ComputeTestResourceGroupName
143+
$rgname = Get-ComputeTestResourceName
144144

145145
try
146146
{
@@ -235,7 +235,7 @@ Test Virtual Machines with multiple NetworkInterface
235235
function Test-MultipleNetworkInterface
236236
{
237237
# Setup
238-
$rgname = Get-ComputeTestResourceGroupName
238+
$rgname = Get-ComputeTestResourceName
239239

240240
try
241241
{

src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests
1919
{
20-
public class VirtualMachineTests
20+
public partial class VirtualMachineTests
2121
{
2222
[Fact]
2323
[Trait(Category.AcceptanceType, Category.CheckIn)]

0 commit comments

Comments
 (0)