Skip to content

Commit 38ce520

Browse files
authored
Merge pull request #127 from KirtiWandhare/patch-13
Use case for windows VM screenshot
2 parents 754a2a1 + 18b9b21 commit 38ce520

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
@@ -685,6 +685,18 @@ while ($runCount -le $NumberOfIterations)
685685
}
686686
}
687687
}
688+
689+
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 `
690+
{
691+
$sa = Get-AzureRmStorageAccount -ResourceGroupName $CanaryVMRG -Name "$($CanaryVMRG)2sa"
692+
$diagSC = $sa | Get-AzureStorageContainer | Where-Object {$_.Name -like "bootdiagnostics-$CanaryVMRG*"}
693+
$screenShotBlob = $diagSC | Get-AzureStorageBlob | Where-Object {$_.Name -like "$privateVMName*screenshot.bmp"}
694+
$sa | Get-AzureStorageBlobContent -Blob $screenShotBlob.Name -Container $diagSC.Name -Destination $CanaryLogPath -Force
695+
if (-not (Get-ChildItem -Path $CanaryLogPath -File -Filter $screenShotBlob.name))
696+
{
697+
throw [System.Exception]"Unable to download screen shot for a Windows VM with private IP"
698+
}
699+
}
688700

689701
if (-not $NoCleanup)
690702
{

0 commit comments

Comments
 (0)