File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 22# If the test is running on the ADO pipeline or on the GitHub actions, the test will be skipped
33Describe " Disk free space" - Skip:(-not [String ]::IsNullOrEmpty($env: AGENT_NAME ) -or -not [String ]::IsNullOrEmpty($env: RUNNER_NAME )) {
44 It " Image has enough free space" {
5- $freeSpace = (Get-PSDrive " /" ).Free
6- $freeSpace | Should - BeGreaterOrEqual 17 GB
5+ $diskInfo = Get-PSDrive " /"
6+ $totalSpaceGB = [math ]::Floor(($diskInfo.Used + $diskInfo.Free ) / 1 GB )
7+ $freeSpaceGB = [math ]::Floor($diskInfo.Free / 1 GB )
8+ Write-Host " [i] Disk size: ${totalSpaceGB} GB; Free space: ${freeSpaceGB} GB"
9+ $freeSpaceGB | Should - BeGreaterOrEqual 17
710 }
811}
912
Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ Describe "WindowsFeatures" {
2020}
2121
2222Describe " DiskSpace" {
23- It " The image has enough disk space" {
24- $availableSpaceMB = [math ]::Round((Get-PSDrive - Name C).Free / 1 MB )
25- $minimumFreeSpaceMB = 18 * 1024
26-
27- $availableSpaceMB | Should - BeGreaterThan $minimumFreeSpaceMB
23+ It " The image has enough disk space" {
24+ $diskInfo = Get-PSDrive - Name C
25+ $totalSpaceGB = [math ]::Floor(($diskInfo.Used + $diskInfo.Free ) / 1 GB )
26+ $freeSpaceGB = [math ]::Floor($diskInfo.Free / 1 GB )
27+ Write-Host " [i] Disk size: ${totalSpaceGB} GB; Free space: ${freeSpaceGB} GB"
28+ $freeSpaceGB | Should - BeGreaterOrEqual 18
2829 }
2930}
3031
You can’t perform that action at this time.
0 commit comments