@@ -522,3 +522,43 @@ function Test-CreateLinuxIncludedPackageNameMasksSoftwareUpdateConfiguration() {
522
522
WaitForProvisioningState $name " Succeeded"
523
523
}
524
524
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