Skip to content

Commit 4e0e3d0

Browse files
author
Samuel Anudeep
committed
Merge pull request #143 from MabOneSdk/release
RI from release into dev1
2 parents a3a87ce + bd0101f commit 4e0e3d0

File tree

93 files changed

+48109
-40970
lines changed

Some content is hidden

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

93 files changed

+48109
-40970
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2015.09.03 version 0.9.8
2+
13
## 2015.08.17 version 0.9.7
24
* Azure Profile cmdlets
35
* New-AzureProfile

setup/azurecmdfiles.wxi

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

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@
290290
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineDataDisk.json">
291291
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
292292
</None>
293+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineDataDiskNegative.json">
294+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
295+
</None>
293296
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineTests\TestVirtualMachineImageList.json">
294297
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
295298
</None>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function Test-AvailabilitySet
2424
try
2525
{
2626
# Common
27-
$loc = 'West US';
27+
$loc = Get-ComputeVMLocation;
2828
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
2929

3030
$asetName = 'avs' + $rgname;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function Run-ComputeCloudExceptionTests
2020
try
2121
{
2222
# Common
23-
$loc = 'West US';
23+
$loc = Get-ComputeVMLocation;
2424
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
2525

2626
$compare = "Resource*NotFound*OperationID : `'*`'";

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

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,75 @@ function Get-SasUri
394394

395395
return $uri;
396396
}
397+
398+
# Get a Location according to resource provider.
399+
function Get-ResourceProviderLocation
400+
{
401+
param ([string] $name, [string] $default = "westus", [bool] $canonical = $true)
402+
403+
$loc = Get-AzureLocation | where { $_.Name.Equals($name) };
404+
405+
if ($loc -eq $null)
406+
{
407+
throw 'There is no available locations with given parameters';
408+
}
409+
410+
if ($loc.LocationsString.ToLowerInvariant().Replace(" ", "").Contains($default.ToLowerInvariant().Replace(" ","")))
411+
{
412+
return $default;
413+
}
414+
415+
if ($canonical)
416+
{
417+
return $loc.Locations[0].ToLowerInvariant().Replace(" ", "");
418+
}
419+
else
420+
{
421+
return $loc.Locations[0];
422+
}
423+
}
424+
425+
function Get-ComputeVMLocation
426+
{
427+
Get-ResourceProviderLocation "Microsoft.Compute/virtualMachines";
428+
}
429+
430+
function Get-ComputeAvailabilitySetLocation
431+
{
432+
Get-ResourceProviderLocation "Microsoft.Compute/availabilitySets";
433+
}
434+
435+
function Get-ComputeVMExtensionLocation
436+
{
437+
Get-ResourceProviderLocation "Microsoft.Compute/virtualMachines/extensions";
438+
}
439+
440+
function Get-ComputeVMDiagnosticSettingLocation
441+
{
442+
Get-ResourceProviderLocation "Microsoft.Compute/virtualMachines/diagnosticSettings";
443+
}
444+
445+
function Get-ComputeVMMetricDefinitionLocation
446+
{
447+
Get-ResourceProviderLocation "Microsoft.Compute/virtualMachines/metricDefinitions";
448+
}
449+
450+
function Get-ComputeOperationLocation
451+
{
452+
Get-ResourceProviderLocation "Microsoft.Compute/locations/operations";
453+
}
454+
455+
function Get-ComputeVMSizeLocation
456+
{
457+
Get-ResourceProviderLocation "Microsoft.Compute/locations/vmSizes";
458+
}
459+
460+
function Get-ComputeUsageLocation
461+
{
462+
Get-ResourceProviderLocation "Microsoft.Compute/locations/usages";
463+
}
464+
465+
function Get-ComputePublisherLocation
466+
{
467+
Get-ResourceProviderLocation "Microsoft.Compute/locations/publishers";
468+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function Test-VirtualMachineExtension
2424
try
2525
{
2626
# Common
27-
$loc = 'westus';
27+
$loc = Get-ComputeVMLocation;
2828
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
2929

3030
# VM Profile & Hardware
@@ -163,7 +163,7 @@ function Test-VirtualMachineExtensionUsingHashTable
163163
try
164164
{
165165
# Common
166-
$loc = 'westus';
166+
$loc = Get-ComputeVMLocation;
167167
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
168168

169169
# VM Profile & Hardware
@@ -325,7 +325,7 @@ function Test-VirtualMachineCustomScriptExtension
325325
try
326326
{
327327
# Common
328-
$loc = 'westus';
328+
$loc = Get-ComputeVMLocation;
329329
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
330330

331331
# VM Profile & Hardware
@@ -494,7 +494,7 @@ function Test-VirtualMachineCustomScriptExtensionFileUri
494494
try
495495
{
496496
# Common
497-
$loc = 'westus';
497+
$loc = Get-ComputeVMLocation;
498498
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
499499

500500
# VM Profile & Hardware
@@ -652,7 +652,7 @@ function Test-VirtualMachineAccessExtension
652652
try
653653
{
654654
# Common
655-
$loc = 'westus';
655+
$loc = Get-ComputeVMLocation;
656656
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
657657

658658
# VM Profile & Hardware

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function Test-SingleNetworkInterface
2424
try
2525
{
2626
# Common
27-
$loc = 'westus';
27+
$loc = Get-ComputeVMLocation;
2828
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
2929

3030
# VM Profile & Hardware
@@ -146,7 +146,7 @@ function Test-SingleNetworkInterfaceDnsSettings
146146
try
147147
{
148148
# Common
149-
$loc = 'westus';
149+
$loc = Get-ComputeVMLocation;
150150
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
151151

152152
# VM Profile & Hardware
@@ -252,7 +252,7 @@ function Test-MultipleNetworkInterface
252252
try
253253
{
254254
# Common
255-
$loc = 'westus';
255+
$loc = Get-ComputeVMLocation;
256256
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
257257

258258
# VM Profile & Hardware
@@ -366,7 +366,7 @@ function Test-AddNetworkInterface
366366
try
367367
{
368368
# Common
369-
$loc = 'westus';
369+
$loc = Get-ComputeVMLocation;
370370
New-AzureResourceGroup -Name $rgname -Location $loc -Force;
371371

372372
# VM Profile & Hardware

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ public void TestVirtualMachineDataDisk()
7575
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineDataDisk");
7676
}
7777

78+
[Fact]
79+
[Trait(Category.AcceptanceType, Category.CheckIn)]
80+
public void TestVirtualMachineDataDiskNegative()
81+
{
82+
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineDataDiskNegative");
83+
}
84+
7885
[Fact]
7986
[Trait(Category.AcceptanceType, Category.CheckIn)]
8087
public void TestVirtualMachinePIRv2()

0 commit comments

Comments
 (0)