Skip to content

Commit 18b9b21

Browse files
Update Canary.Tests.ps1
1 parent ebbe527 commit 18b9b21

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

CanaryValidator/Canary.Tests.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,18 @@ while ($runCount -le $NumberOfIterations)
681681
}
682682
}
683683
}
684+
685+
Invoke-Usecase -Name 'CheckExistenceOfScreenShotForVMWithPrivateIP' -Description "Check if screen shots are available for Windows VM with private IP and store the screen shot in log folder" -UsecaseBlock `
686+
{
687+
$sa = Get-AzureRmStorageAccount -ResourceGroupName $CanaryVMRG -Name "$($CanaryVMRG)2sa"
688+
$diagSC = $sa | Get-AzureStorageContainer | Where-Object {$_.Name -like "bootdiagnostics-$CanaryVMRG*"}
689+
$screenShotBlob = $diagSC | Get-AzureStorageBlob | Where-Object {$_.Name -like "$privateVMName*screenshot.bmp"}
690+
$sa | Get-AzureStorageBlobContent -Blob $screenShotBlob.Name -Container $diagSC.Name -Destination $CanaryLogPath -Force
691+
if (-not (Get-ChildItem -Path $CanaryLogPath -File -Filter $screenShotBlob.name))
692+
{
693+
throw [System.Exception]"Unable to download screen shot for a Windows VM with private IP"
694+
}
695+
}
684696

685697
if (-not $NoCleanup)
686698
{

0 commit comments

Comments
 (0)