File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
src/Compute/Compute.Test/ScenarioTests Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -206,5 +206,11 @@ public void TestDiskCreateImportSecure()
206206 TestRunner . RunTestScript ( "Test-ConfVMImportSecure" ) ;
207207 }
208208
209+ [ Fact ]
210+ [ Trait ( Category . AcceptanceType , Category . LiveOnly ) ]
211+ public void TestDiskSupportedSecurityOption ( )
212+ {
213+ TestRunner . RunTestScript ( "Test-SupportedSecurityOption" ) ;
214+ }
209215 }
210216}
Original file line number Diff line number Diff line change @@ -1905,3 +1905,36 @@ function Test-ConfVMImportSecure
19051905 Clean - ResourceGroup $rgname ;
19061906 }
19071907}
1908+
1909+ <#
1910+ . SYNOPSIS
1911+ Test SupportedSecurityOption Parameter during creation of managed disk using CreateOption of Import
1912+ #>
1913+ function Test-SupportedSecurityOption
1914+ {
1915+ $rgname = Get-ComputeTestResourceName ;
1916+ $loc = " eastus2euap" ;
1917+
1918+ try {
1919+ New-AzResourceGroup - Name $rgname - Location $loc - Force;
1920+ $sourceUri = " https://teststorage.blob.core.windows.net/vhds/test.vhd"
1921+ $subId = Get-SubscriptionIdFromResourceGroup $rgname ;
1922+ $storageAccountId = " /subscriptions/$subId /resourceGroups/$rgname /providers/Microsoft.Storage/storageAccounts/teststorage"
1923+
1924+ $diskConfig = New-AzDiskConfig - Location $loc - AccountType ' Premium_LRS' - CreateOption Import - SourceUri $sourceUri - StorageAccountId $storageAccountId - SupportedSecurityOption " TrustedLaunchSupported"
1925+ $diskname = " disk" + $rgname ;
1926+ New-AzDisk - ResourceGroupName $rgname - DiskName $diskname - Disk $diskConfig ;
1927+ $disk = Get-AzDisk - ResourceGroupName $rgname - DiskName $diskname ;
1928+ Assert-AreEqual $disk.SupportedSecurityOption " TrustedLaunchSupported" ;
1929+
1930+ $updateconfig = New-AzDiskUpdateConfig - SupportedSecurityOption " TrustedLaunchAndConfidentialVMSupported" ;
1931+ $disk = Update-AzDisk - ResourceGroupName $rgname - DiskName $diskname - DiskUpdate $updateconfig ;
1932+ Assert-AreEqual $disk.SupportedSecurityOption " TrustedLaunchAndConfidentialVMSupported" ;
1933+ }
1934+
1935+ finally
1936+ {
1937+ # Cleanup
1938+ Clean - ResourceGroup $rgname
1939+ }
1940+ }
You can’t perform that action at this time.
0 commit comments