Skip to content

Commit 4242b51

Browse files
committed
Adding Unit test
1 parent 677906e commit 4242b51

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

src/Automation/Automation.Test/ScenarioTests/UpdateManagementTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,13 @@ public void CreateLinuxIncludePackageNameMasksSUC()
175175
{
176176
TestRunner.RunTestScript("Test-CreateLinuxIncludedPackageNameMasksSoftwareUpdateConfiguration");
177177
}
178+
179+
[Fact]
180+
[Trait(Category.AcceptanceType, Category.CheckIn)]
181+
[Trait(Category.Service, Category.Automation)]
182+
public void CreateLinuxSucWithRebootSetting()
183+
{
184+
TestRunner.RunTestScript("Test-CreateLinuxSoftwareUpdateConfigurationWithRebootSetting");
185+
}
178186
}
179187
}

src/Automation/Automation.Test/ScenarioTests/UpdateManagementTests.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,38 @@ function Test-CreateLinuxIncludedPackageNameMasksSoftwareUpdateConfiguration() {
522522
WaitForProvisioningState $name "Succeeded"
523523
}
524524

525+
526+
<#
527+
Test-CreateLinuxOneTimeSoftwareUpdateConfigurationWithAllOption
528+
#>
529+
function Test-CreateLinuxSoftwareUpdateConfigurationWithRebootSetting {
530+
$name = "linx-suc-reboot"
531+
$rebootSetting = "Never"
532+
$startTime = ([DateTime]::Now).AddMinutes(10)
533+
$s = New-AzAutomationSchedule -ResourceGroupName $rg `
534+
-AutomationAccountName $aa `
535+
-Name $name `
536+
-Description linux-suc-reboot `
537+
-OneTime `
538+
-StartTime $startTime `
539+
-ForUpdate
540+
541+
$suc = New-AzAutomationSoftwareUpdateConfiguration -ResourceGroupName $rg `
542+
-AutomationAccountName $aa `
543+
-Schedule $s `
544+
-Linux `
545+
-AzureVMResourceId $azureVMIdsL `
546+
-NonAzureComputer $nonAzurecomputers `
547+
-Duration (New-TimeSpan -Hours 2) `
548+
-IncludedPackageClassification Security,Critical `
549+
-ExcludedPackageNameMask Mask01,Mask02 `
550+
-IncludedPackageNameMask Mask100 `
551+
-RebootSetting $rebootSetting
552+
553+
Assert-NotNull $suc "New-AzAutomationSoftwareUpdateConfiguration returned null"
554+
Assert-AreEqual $suc.Name $name "Name of created software update configuration didn't match given name"
555+
Assert-AreEqual $suc.RebootSetting $rebootSetting "Reboot setting failed to match"
556+
557+
WaitForProvisioningState $name "Failed"
558+
}
559+

0 commit comments

Comments
 (0)