Skip to content

Commit 1ab4f03

Browse files
authored
Merge pull request Azure#10109 from assing/rebootSettingFix
Fixed New-AzureAutomationSoftwareUpdateConfiguration cmdlet for Linux reboot setting parameter
2 parents 5db7ab1 + 5b012ec commit 1ab4f03

File tree

5 files changed

+577
-1
lines changed

5 files changed

+577
-1
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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,43 @@ function Test-CreateLinuxIncludedPackageNameMasksSoftwareUpdateConfiguration() {
522522
WaitForProvisioningState $name "Succeeded"
523523
}
524524

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

0 commit comments

Comments
 (0)