Skip to content

Commit 7d7a474

Browse files
authored
Merge branch 'release-2019-10-15' into feature/updateApiVersion
2 parents dc50283 + a3dc412 commit 7d7a474

File tree

23 files changed

+7409
-958
lines changed

23 files changed

+7409
-958
lines changed

src/Compute/Compute.Test/ScenarioTests/StrategiesVirtualMachineTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,12 @@ public void TestSimpleNewVmPpgId()
169169
{
170170
TestRunner.RunTestScript("Test-SimpleNewVmPpgId");
171171
}
172+
173+
[Fact]
174+
[Trait(Category.AcceptanceType, Category.CheckIn)]
175+
public void TestSimpleNewVmBilling()
176+
{
177+
TestRunner.RunTestScript("Test-SimpleNewVmBilling");
178+
}
172179
}
173180
}

src/Compute/Compute.Test/ScenarioTests/StrategiesVirtualMachineTests.ps1

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ Test Simple Paremeter Set for New Vm
5353
function Test-SimpleNewVmFromSIGImage
5454
{
5555
#This test needs to be run form the following subscription in record mode :
56-
# 9e223dbe-3399-4e19-88eb-0975f02ac87f
57-
#The vm needs to be created in the one of the following regions :
58-
# "South Central US", "East US 2" and "Central US"
59-
#To see more information on the steps to create a new SIG image go here: https://aka.ms/AA37jbt
56+
# 9e223dbe-3399-4e19-88eb-0975f02ac87f
57+
#The vm needs to be created in the one of the following regions :
58+
# "South Central US", "East US 2" and "Central US"
59+
#To see more information on the steps to create a new SIG image go here: https://aka.ms/AA37jbt
6060
# Setup
6161
$vmname = Get-ResourceName
6262

@@ -102,14 +102,14 @@ function Test-SimpleNewVmWithUltraSSD
102102
[string]$domainNameLabel = "$vmname-$vmname".tolower();
103103

104104
# Common
105-
#As of now the ultrasd feature is only supported in east us 2 and in the size Standard_D2s_v3, on the features GA the restriction will be lifted
106-
#Use the follwing command to figure out the one to use
107-
#Get-AzComputeResourceSku | where {$_.ResourceType -eq "disks" -and $_.Name -eq "UltraSSD_LRS" }
105+
#As of now the ultrasd feature is only supported in east us 2 and in the size Standard_D2s_v3, on the features GA the restriction will be lifted
106+
#Use the follwing command to figure out the one to use
107+
#Get-AzComputeResourceSku | where {$_.ResourceType -eq "disks" -and $_.Name -eq "UltraSSD_LRS" }
108108
$x = New-AzVM -Name $vmname -Credential $cred -DomainNameLabel $domainNameLabel -Location "eastus2" -EnableUltraSSD -Zone 2 -Size "Standard_D2s_v3"
109109

110110
Assert-AreEqual $vmname $x.Name;
111111
Assert-Null $x.Identity
112-
Assert-True { $x.AdditionalCapabilities.UltraSSDEnabled };
112+
Assert-True { $x.AdditionalCapabilities.UltraSSDEnabled };
113113

114114
$nic = Get-AzNetworkInterface -ResourceGroupName $vmname -Name $vmname
115115
Assert-NotNull $nic
@@ -434,7 +434,6 @@ function Test-SimpleNewVmWithAvailabilitySet2
434434
}
435435
}
436436

437-
438437
<#
439438
.SYNOPSIS
440439
Test Simple Paremeter Set for New Vm
@@ -452,9 +451,8 @@ function Test-SimpleNewVmImageName
452451
[string]$domainNameLabel = "$vmname-$vmname".tolower()
453452

454453
# Common
455-
$imgversion = Get-VMImageVersion -publisher "MicrosoftWindowsServer" `
456-
-offer "WindowsServer" -sku "2016-Datacenter"
457-
$x = New-AzVM `
454+
$imgversion = Get-VMImageVersion -publisher "MicrosoftWindowsServer" -offer "WindowsServer" -sku "2016-Datacenter"
455+
$x = New-AzVM `
458456
-Name $vmname `
459457
-Credential $cred `
460458
-DomainNameLabel $domainNameLabel `
@@ -469,7 +467,6 @@ function Test-SimpleNewVmImageName
469467
}
470468
}
471469

472-
473470
<#
474471
.SYNOPSIS
475472
Test Simple Paremeter Set for New Vm
@@ -571,4 +568,35 @@ function Test-SimpleNewVmPpgId
571568
Clean-ResourceGroup $rgname
572569
Clean-ResourceGroup $vmname
573570
}
574-
}
571+
}
572+
573+
<#
574+
.SYNOPSIS
575+
Test Simple Paremeter Set for New VM with eviction policy, priority and max price.
576+
#>
577+
function Test-SimpleNewVmBilling
578+
{
579+
# Setup
580+
$vmname = Get-ResourceName
581+
582+
try
583+
{
584+
$username = "admin01"
585+
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
586+
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
587+
[string]$domainNameLabel = "$vmname-$vmname".tolower();
588+
589+
# Common
590+
$vm = New-AzVM -Name $vmname -Credential $cred -DomainNameLabel $domainNameLabel -EvictionPolicy 'Deallocate' -Priority 'Low' -MaxPrice 0.2;
591+
592+
Assert-AreEqual $vmname $vm.Name;
593+
Assert-AreEqual 'Deallocate' $vm.EvictionPolicy;
594+
Assert-AreEqual 'Low' $vm.Priority;
595+
Assert-AreEqual 0.2 $vm.BillingProfile.MaxPrice;
596+
}
597+
finally
598+
{
599+
# Cleanup
600+
Clean-ResourceGroup $vmname
601+
}
602+
}

src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,12 @@ public void TestSimpleNewVmssPpg()
109109
{
110110
TestRunner.RunTestScript("Test-SimpleNewVmssPpg");
111111
}
112+
113+
[Fact]
114+
[Trait(Category.AcceptanceType, Category.CheckIn)]
115+
public void TestSimpleNewVmssBilling()
116+
{
117+
TestRunner.RunTestScript("Test-SimpleNewVmssBilling");
118+
}
112119
}
113120
}

src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.ps1

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Test Simple Paremeter Set for New Vm
6363
function Test-SimpleNewVmssFromSIGImage
6464
{
6565
#This test needs to be run form the following subscription in record mode :
66-
# 9e223dbe-3399-4e19-88eb-0975f02ac87f
67-
#The vm needs to be created in the one of the following regions :
68-
# "South Central US", "East US 2" and "Central US"
69-
#To see more information on the steps to create a new SIG image go here: https://aka.ms/AA37jbt
66+
# 9e223dbe-3399-4e19-88eb-0975f02ac87f
67+
#The vm needs to be created in the one of the following regions :
68+
# "South Central US", "East US 2" and "Central US"
69+
#To see more information on the steps to create a new SIG image go here: https://aka.ms/AA37jbt
7070
# Setup
7171
$vmssname = Get-ResourceName
7272

@@ -124,9 +124,9 @@ function Test-SimpleNewVmssWithUltraSSD
124124
[string]$domainNameLabel = "$vmssname$vmssname".tolower();
125125

126126
# Common
127-
#As of now the ultrasd feature is only supported in east us 2 and in the size Standard_D2s_v3, on the features GA the restriction will be lifted
128-
#Use the follwing command to figure out the one to use
129-
#Get-AzComputeResourceSku | where {$_.ResourceType -eq "disks" -and $_.Name -eq "UltraSSD_LRS" }
127+
#As of now the ultrasd feature is only supported in east us 2 and in the size Standard_D2s_v3, on the features GA the restriction will be lifted
128+
#Use the follwing command to figure out the one to use
129+
#Get-AzComputeResourceSku | where {$_.ResourceType -eq "disks" -and $_.Name -eq "UltraSSD_LRS" }
130130
$x = New-AzVmss -Name $vmssname -Credential $cred -DomainNameLabel $domainNameLabel -LoadBalancerName $lbName -Location "east us 2" -EnableUltraSSD -Zone 3 -VmSize "Standard_D2s_v3"
131131

132132
Assert-AreEqual $vmssname $x.Name;
@@ -403,4 +403,35 @@ function Test-SimpleNewVmssPpg
403403
# Cleanup
404404
Clean-ResourceGroup $rgname
405405
}
406+
}
407+
408+
<#
409+
.SYNOPSIS
410+
Test Simple Paremeter Set for New Vmss with eviction policy, priority, and max price.
411+
#>
412+
function Test-SimpleNewVmssBilling
413+
{
414+
# Setup
415+
$vmssname = Get-ResourceName
416+
417+
try
418+
{
419+
$username = "admin01"
420+
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
421+
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
422+
[string]$domainNameLabel = "$vmssname$vmssname".tolower();
423+
424+
# Common
425+
$x = New-AzVmss -Name $vmssname -Location "westus2" -Credential $cred -DomainNameLabel $domainNameLabel `
426+
-EvictionPolicy 'Deallocate' -Priority 'Low' -MaxPrice 0.2;
427+
}
428+
catch
429+
{
430+
Assert-True { $Error[0].ToString().Contains("OS provisioning failure"); }
431+
}
432+
finally
433+
{
434+
# Cleanup
435+
Clean-ResourceGroup $vmssname
436+
}
406437
}

src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.StrategiesVirtualMachineTests/TestSimpleNewVmBilling.json

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

0 commit comments

Comments
 (0)