Skip to content

AzureRT PR #1044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Oct 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1cfc107
Dev code for Save-AzureRMVhd cmdlet
hyonholee Sep 21, 2015
64bfa31
Add "None" value for Disk Caching.
hyonholee Sep 21, 2015
faef27a
Fix the output of New-AzureRMVM and Update-AzureRMVM
hyonholee Sep 21, 2015
3ec24ea
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 22, 2015
d01407d
Fix AzureRT test settings
hyonholee Sep 22, 2015
dd2b55a
Add -WhatIf to Remove-AzureVM
hyonholee Sep 22, 2015
94916b9
Fix AzureRT test issues due to the storage cmdlet name changes
hyonholee Sep 22, 2015
f0a258d
Update New-AzureQuickVM
hyonholee Sep 22, 2015
6e2937f
Fix Get-AzureRemoteDesktopFile cmdlet with Launch parameter
hyonholee Sep 22, 2015
f917639
Fix Get-AzureRMRemoteDesktopFile
hyonholee Sep 25, 2015
5be0fc7
Adding BootDiagnostics feature:
hyonholee Sep 25, 2015
752dd50
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 25, 2015
e77f993
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 25, 2015
8185b5b
Fix Get-AzureRMRemoteDesktopFile cmdlet
hyonholee Sep 26, 2015
89c26d7
Add boot diagnostic feature
hyonholee Sep 26, 2015
ce5ba4b
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 26, 2015
c7659ca
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 28, 2015
22e8990
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 28, 2015
fd39b26
Merge branch 'dev' of https://github.com/hyonholee/azure-powershell i…
hyonholee Sep 28, 2015
84558c9
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 29, 2015
1a9e7bf
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 29, 2015
f895f08
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 29, 2015
ca5d5ab
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Sep 29, 2015
7c403c7
Add Save-AzureRMVhd Test
hyonholee Oct 1, 2015
2173bc4
Update New-AzureVM and Add tests for BootDiagnostics
hyonholee Oct 1, 2015
eebf8ed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Oct 1, 2015
e0ab966
Merge branch 'dev' of https://github.com/hyonholee/azure-powershell i…
hyonholee Oct 1, 2015
85d304e
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Oct 1, 2015
68888c9
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Oct 2, 2015
a8a4581
Revert skipMD5 hash parameter in Add-AzureVhd
hyonholee Oct 2, 2015
f69b0e6
Add StatusCode to PSComputeLongRunningOperation
hyonholee Oct 2, 2015
656aa0d
Re-record Compute tests
hyonholee Oct 2, 2015
326a632
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Oct 2, 2015
0525010
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Oct 3, 2015
f4c9564
Update according to PR comments
hyonholee Oct 3, 2015
e00709f
Change the method name.
hyonholee Oct 3, 2015
a649695
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
hyonholee Oct 5, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions AzurePowershell.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
</Target>

<!-- Run the scenario tests -->
<Target Name="ScenarioTest" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="ScenarioTest" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running scenario tests..." />
<MSBuild Targets="InvokeMSTest"
Properties="_testAssembly=$(ScenarioTestDebug);_testSettings=$(TestSettings);_testFilter=$(ScenarioTestFilter);_testResult=$(TestOutputDirectory)\ScenarioTestDebug.trx"
Expand Down Expand Up @@ -275,7 +275,7 @@
IncludeTraits="$(XUnitIncludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
</Target>

<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running CIT Scenario tests..." />
<Delete Files="$(TestOutputDirectory)\RunOneSDKCITDebug.trx" />
<Exec
Expand All @@ -284,47 +284,47 @@
</Target>

<!-- Run the AzureRT tests -->
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT BVT tests..." />
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:BVT /resultsfile:$(TestOutputDirectory)\RTBVTDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTOne" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTOne" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running a specific tests..." />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTRepeat" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTRepeat" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running a specific tests..." />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="for /l %%x in (1, 1, $(RepeatTimes)) do MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug%%x.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTMulti" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTMulti" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running tests:" />
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) $(TestParams) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTAll" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTAll" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTAllFast" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTAllFast" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -337,7 +337,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTSeq" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -346,7 +346,7 @@
ContinueOnError="true" />
</Target>

<Target Name="AzureRTNetwork" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTNetwork" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -355,7 +355,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTUploadSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTUploadSeq" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
Expand All @@ -364,7 +364,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTPar" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTPar" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />

<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
Expand All @@ -373,7 +373,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTFunctional" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTFunctional" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT Functional tests..." />

<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
Expand All @@ -382,7 +382,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTScenario" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTScenario" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT Scenario tests..." />

<Delete Files="$(TestOutputDirectory)\RTScenarioDebug.trx" />
Expand All @@ -391,7 +391,7 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTAddVhdDebug.trx" />
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
Expand All @@ -403,23 +403,23 @@
ContinueOnError="false" />
</Target>

<Target Name="AzureRTPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTPreview" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT all tests..." />
<Delete Files="$(TestOutputDirectory)\RTPreviewDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:Preview /resultsfile:$(TestOutputDirectory)\RTPreviewDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;Build;BeforeRunTests">
<Message Importance="high" Text="Running AzureRT clean up tests..." />
<Delete Files="$(TestOutputDirectory)\RTCleanUpDebug.trx" />
<Exec
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:AzureRTCleanUp /resultsfile:$(TestOutputDirectory)\RTCleanUpDebug.trx"
ContinueOnError="false" />
</Target>

<Target Name="ComputeCodeCoverage" DependsOnTargets="ForceRestorePackages;Clean;BuildDebug">
<Target Name="ComputeCodeCoverage" DependsOnTargets="RestoreNugetPackages;Clean;Build">
<Message Importance="high" Text="Gathering Code Coverage data from Compute tests..." />
<Delete Files="Project.covarage" />
<Exec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
<Reference Include="Microsoft.Azure.Management.Authorization">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Compute, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.8.2.0\lib\net40\Microsoft.Azure.Management.Compute.dll</HintPath>
<Reference Include="Microsoft.Azure.Management.Compute, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Compute.9.0.0\lib\net40\Microsoft.Azure.Management.Compute.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down Expand Up @@ -157,6 +157,7 @@
<Compile Include="ScenarioTests\AddVhdTests.cs" />
<Compile Include="ScenarioTests\ComputeCloudExceptionTests.cs" />
<Compile Include="ScenarioTests\DscExtensionTests.cs" />
<Compile Include="ScenarioTests\VirtualMachineBootDiagnosticsTests.cs" />
<Compile Include="ScenarioTests\VMDynamicTests.cs" />
<Compile Include="ScenarioTests\VirtualMachineProfileTests.cs" />
<Compile Include="ScenarioTests\AvailabilitySetTests.cs" />
Expand Down Expand Up @@ -223,6 +224,9 @@
<None Include="ScenarioTests\Generated\VirtualMachineDynamicTest3.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\VirtualMachineBootDiagnosticsTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ScenarioTests\VMDynamicTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -258,6 +262,18 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DscExtensionTests\TestGetAzureRmVMDscExtension.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineBootDiagnosticsTests\TestLinuxVirtualMachineBootDiagnostics.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineBootDiagnosticsTests\TestVirtualMachineBootDiagnostics.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineBootDiagnosticsTests\TestVirtualMachineBootDiagnosticsPremium.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineBootDiagnosticsTests\TestVirtualMachineBootDiagnosticsSet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.VirtualMachineExtensionTests\TestVirtualMachineAccessExtension.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ function Test-AddVhd

$destBlobHandle = GetBlobHandle $vhdDestUri $storageKey.Key1;
Assert-True {VerifyMD5hash $destBlobHandle $testItem.md5hash};

$vhdDownloadPath = $vhdLocalPath + "-download.vhd";

$vhdDownloadContext = Save-AzureRmVhd -ResourceGroupName $rgname -SourceUri $vhdDestUri -LocalFilePath $vhdDownloadPath;
Write-Output ("Source :" +$vhdDownloadContext.Source);
Write-Output ("LocalFilePath :" +$vhdDownloadContext.LocalFilePath);
Assert-AreEqual $vhdDestUri $vhdDownloadContext.Source;
Assert-AreEqual $vhdDownloadPath $vhdDownloadContext.LocalFilePath;

$vhdDownloadContext = Save-AzureRmVhd -ResourceGroupName $rgname -SourceUri $vhdDestUri -LocalFilePath $vhdDownloadPath -Overwrite;
Assert-AreEqual $vhdDestUri $vhdDownloadContext.Source;
Assert-AreEqual $vhdDownloadPath $vhdDownloadContext.LocalFilePath;
}
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,18 @@ function Get-ComputePublisherLocation
{
Get-ResourceProviderLocation "Microsoft.Compute/locations/publishers";
}

function Get-SubscriptionIdFromResourceGroup
{
param ([string] $rgname)

$rg = Get-AzureRmResourceGroup -ResourceGroupName $rgname;

$rgid = $rg.ResourceId;

# ResouceId is a form of "/subscriptions/<subId>/resourceGroups/<resourgGroupName>"
# So return the second part to get subscription Id
$first = $rgid.IndexOf('/', 1);
$last = $rgid.IndexOf('/', $first + 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a comment for the resource ID format? It would make the code more clear.

return $rgid.Substring($first + 1, $last - $first - 1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
# code is regenerated.


$global:ps_test_tag_name = 'crptestps6050'


function get_vm_config_object
{
param ([string] $rgname, [string] $vmsize)

$st = Write-Verbose "Creating VM Config Object - Start";

$vmname = 'vm' + $rgname;
$vmname = $rgname + 'vm';
$p = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize;

$st = Write-Verbose "Creating VM Config Object - End";
Expand All @@ -39,12 +42,13 @@ function get_created_storage_account_name

$st = Write-Verbose "Creating and getting storage account for '${loc}' and '${rgname}' - Start";

$stoname = 'sto' + $rgname;
$stoname = $rgname + 'sto';
$stotype = 'Standard_GRS';

$st = Write-Verbose "Creating and getting storage account for '${loc}' and '${rgname}' - '${stotype}' & '${stoname}'";

$st = New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype;
$st = Set-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname -Tags (Get-ComputeTestTag $global:ps_test_tag_name);
$st = Get-AzureRmStorageAccount -ResourceGroupName $rgname -Name $stoname;

$st = Write-Verbose "Creating and getting storage account for '${loc}' and '${rgname}' - End";
Expand All @@ -59,14 +63,14 @@ function create_and_setup_nic_ids

$st = Write-Verbose "Creating and getting NICs for '${loc}' and '${rgname}' - Start";

$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24";
$vnet = New-AzureRmVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $subnet;
$vnet = Get-AzureRmVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname;
$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name ($rgname + 'subnet') -AddressPrefix "10.0.0.0/24";
$vnet = New-AzureRmVirtualNetwork -Force -Name ($rgname + 'vnet') -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -DnsServer "10.1.1.1" -Subnet $subnet -Tag (Get-ComputeTestTag $global:ps_test_tag_name);
$vnet = Get-AzureRmVirtualNetwork -Name ($rgname + 'vnet') -ResourceGroupName $rgname;
$subnetId = $vnet.Subnets[0].Id;
$nic_ids = @($null) * 1;
$nic0 = New-AzureRmNetworkInterface -Force -Name ('nic0' + $rgname) -ResourceGroupName $rgname -Location $loc -SubnetId $subnetId;
$nic0 = New-AzureRmNetworkInterface -Force -Name ($rgname + 'nic0') -ResourceGroupName $rgname -Location $loc -SubnetId $subnetId -Tag (Get-ComputeTestTag $global:ps_test_tag_name);
$nic_ids[0] = $nic0.Id;
$vmconfig = Add-AzureRmVMNetworkInterface -VM $vmconfig -Id $nic0.Id -Primary;
$vmconfig = Add-AzureRmVMNetworkInterface -VM $vmconfig -Id $nic0.Id;
$st = Write-Verbose "Creating and getting NICs for '${loc}' and '${rgname}' - End";

return $nic_ids;
Expand All @@ -81,10 +85,10 @@ function create_and_setup_vm_config_object
$vmconfig = get_vm_config_object $rgname $vmsize

$user = "Foo12";
$password = "BaR#123" + $rgname;
$password = $rgname + "BaR#123";
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force;
$cred = New-Object System.Management.Automation.PSCredential ($user, $securePassword);
$computerName = "cn" + $rgname;
$computerName = $rgname + "cn";
$vmconfig = Set-AzureRmVMOperatingSystem -VM $vmconfig -Windows -ComputerName $computerName -Credential $cred;

$st = Write-Verbose "Creating and setting up the VM config object for '${loc}', '${rgname}' and '${vmsize}' - End";
Expand Down Expand Up @@ -118,20 +122,20 @@ function setup_image_and_disks
}


function ps_vm_dynamic_test_func_1_pstestrg592
function ps_vm_dynamic_test_func_1_crptestps5352
{
# Setup
$rgname = 'pstestrg592';
$rgname = 'crptestps5352';

try
{
$loc = 'Japan East';
$vmsize = 'Standard_A2';
$loc = 'East US 2';
$vmsize = 'Standard_A1';

$st = Write-Verbose "Running Test ps_vm_dynamic_test_func_1_pstestrg592 - Start ${rgname}, ${loc} & ${vmsize}";
$st = Write-Verbose "Running Test ps_vm_dynamic_test_func_1_crptestps5352 - Start ${rgname}, ${loc} & ${vmsize}";

$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_pstestrg592 - Creating Resource Group';
$st = New-AzureRmResourceGroup -Location $loc -Name $rgname -Force;
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_crptestps5352 - Creating Resource Group';
$st = New-AzureRmResourceGroup -Location $loc -Name $rgname -Tag (Get-ComputeTestTag $global:ps_test_tag_name) -Force;

$vmconfig = create_and_setup_vm_config_object $loc $rgname $vmsize;

Expand All @@ -145,20 +149,21 @@ function ps_vm_dynamic_test_func_1_pstestrg592
$st = setup_image_and_disks $loc $rgname $stoname $vmconfig;

# Virtual Machine
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_pstestrg592 - Creating VM';
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_crptestps5352 - Creating VM';

$vmname = 'vm' + $rgname;
$st = New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $vmconfig;
$vmname = $rgname + 'vm';

$st = New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $vmconfig -Tags (Get-ComputeTestTag $global:ps_test_tag_name);

# Get VM
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_pstestrg592 - Getting VM';
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_crptestps5352 - Getting VM';
$vm1 = Get-AzureRmVM -Name $vmname -ResourceGroupName $rgname;

# Remove
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_pstestrg592 - Removing VM';
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_crptestps5352 - Removing VM';
$st = Remove-AzureRmVM -Name $vmname -ResourceGroupName $rgname -Force;

$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_pstestrg592 - End';
$st = Write-Verbose 'Running Test ps_vm_dynamic_test_func_1_crptestps5352 - End';
}
finally
{
Expand Down
Loading