Skip to content

Commit 5c84f5d

Browse files
hyonholeeHovsep
authored andcommitted
[Release 1.6.0] [AzureRT] Sprint 61 (#2564)
* Update Name and version for extensions to optional as before. * Fix typo for help message * New-AzureRMVM should be able to get license type from VM object * Fix NullReferenceException error when there is no data disk or network interfaces * Update Compute library to 13.0.4-prelease and re-generate cmdlets. * Add ADDomain extension cmdlets and tests. * Update Compute help file * Add ShouldProcess to new, update, and set cmdlets * Updated package and assembly versions for release 1.6.0 * Upgraded Microsoft.Azure.Test.Framework to version 1.0.6026.28191-prerelease for ADAL 2.27 reference fix. * Re-record ADDomain extension tests * Add SupportsShouldProcess attribute.
1 parent 93359a5 commit 5c84f5d

File tree

87 files changed

+11370
-751
lines changed

Some content is hidden

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

87 files changed

+11370
-751
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6565
</Reference>
6666
<Reference Include="Microsoft.Azure.Management.Compute">
67-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.13.0.1-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
67+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.13.0.4-prerelease\lib\net45\Microsoft.Azure.Management.Compute.dll</HintPath>
6868
<Private>True</Private>
6969
</Reference>
7070
<Reference Include="Microsoft.Azure.Management.Network, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -353,6 +353,12 @@
353353
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineAccessExtension.json">
354354
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
355355
</None>
356+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineADDomainExtension.json">
357+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
358+
</None>
359+
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineADDomainExtensionDomainJoin.json">
360+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
361+
</None>
356362
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineBginfoExtension.json">
357363
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
358364
</None>

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15+
$PLACEHOLDER = "PLACEHOLDER"
16+
1517
<#
1618
.SYNOPSIS
1719
Gets valid resource name for compute test
@@ -113,7 +115,7 @@ function Create-VirtualMachine($rgname, $vmname, $loc)
113115
$rgname = if ([string]::IsNullOrEmpty($rgname)) { Get-ComputeTestResourceName } else { $rgname }
114116
$vmname = if ([string]::IsNullOrEmpty($vmname)) { 'vm' + $rgname } else { $vmname }
115117
$loc = if ([string]::IsNullOrEmpty($loc)) { Get-ComputeVMLocation } else { $loc }
116-
Write-Host $vmname
118+
Write-Host $vmname
117119

118120
# Common
119121
$g = New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
@@ -479,17 +481,17 @@ function Get-SasUri
479481
{
480482
param ([string] $storageAccount, [string] $storageKey, [string] $container, [string] $file, [TimeSpan] $duration, [Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPermissions] $type)
481483

482-
$uri = [string]::Format("https://{0}.blob.core.windows.net/{1}/{2}", $storageAccount, $container, $file);
484+
$uri = [string]::Format("https://{0}.blob.core.windows.net/{1}/{2}", $storageAccount, $container, $file);
483485

484-
$destUri = New-Object -TypeName System.Uri($uri);
485-
$cred = New-Object -TypeName Microsoft.WindowsAzure.Storage.Auth.StorageCredentials($storageAccount, $storageKey);
486-
$destBlob = New-Object -TypeName Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob($destUri, $cred);
487-
$policy = New-Object Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPolicy;
488-
$policy.Permissions = $type;
489-
$policy.SharedAccessExpiryTime = [DateTime]::UtcNow.Add($duration);
490-
$uri += $destBlob.GetSharedAccessSignature($policy);
486+
$destUri = New-Object -TypeName System.Uri($uri);
487+
$cred = New-Object -TypeName Microsoft.WindowsAzure.Storage.Auth.StorageCredentials($storageAccount, $storageKey);
488+
$destBlob = New-Object -TypeName Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob($destUri, $cred);
489+
$policy = New-Object Microsoft.WindowsAzure.Storage.Blob.SharedAccessBlobPolicy;
490+
$policy.Permissions = $type;
491+
$policy.SharedAccessExpiryTime = [DateTime]::UtcNow.Add($duration);
492+
$uri += $destBlob.GetSharedAccessSignature($policy);
491493

492-
return $uri;
494+
return $uri;
493495
}
494496

495497
# Get a Location according to resource provider.
@@ -564,13 +566,13 @@ function Get-SubscriptionIdFromResourceGroup
564566
{
565567
param ([string] $rgname)
566568

567-
$rg = Get-AzureRmResourceGroup -ResourceGroupName $rgname;
569+
$rg = Get-AzureRmResourceGroup -ResourceGroupName $rgname;
568570

569-
$rgid = $rg.ResourceId;
571+
$rgid = $rg.ResourceId;
570572

571-
# ResouceId is a form of "/subscriptions/<subId>/resourceGroups/<resourgGroupName>"
572-
# So return the second part to get subscription Id
573-
$first = $rgid.IndexOf('/', 1);
574-
$last = $rgid.IndexOf('/', $first + 1);
575-
return $rgid.Substring($first + 1, $last - $first - 1);
573+
# ResouceId is a form of "/subscriptions/<subId>/resourceGroups/<resourgGroupName>"
574+
# So return the second part to get subscription Id
575+
$first = $rgid.IndexOf('/', 1);
576+
$last = $rgid.IndexOf('/', $first + 1);
577+
return $rgid.Substring($first + 1, $last - $first - 1);
576578
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,19 @@ public void TestVirtualMachineExtensionWithSwitch()
8686
{
8787
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineExtensionWithSwitch");
8888
}
89+
90+
[Fact]
91+
[Trait(Category.AcceptanceType, Category.CheckIn)]
92+
public void TestVirtualMachineADDomainExtension()
93+
{
94+
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineADDomainExtension");
95+
}
96+
97+
[Fact]
98+
[Trait(Category.AcceptanceType, Category.CheckIn)]
99+
public void TestVirtualMachineADDomainExtensionDomainJoin()
100+
{
101+
ComputeTestController.NewInstance.RunPsTest("Test-VirtualMachineADDomainExtensionDomainJoin");
102+
}
89103
}
90104
}

0 commit comments

Comments
 (0)