mirror of
https://github.com/actions/runner-images.git
synced 2025-12-31 22:43:22 +08:00
[Windows,Ubuntu] Update disk space pester test (#13128)
This commit is contained in:
committed by
GitHub
parent
ba87e27210
commit
5641ff0eb6
@@ -20,11 +20,12 @@ Describe "WindowsFeatures" {
|
||||
}
|
||||
|
||||
Describe "DiskSpace" {
|
||||
It "The image has enough disk space"{
|
||||
$availableSpaceMB = [math]::Round((Get-PSDrive -Name C).Free / 1MB)
|
||||
$minimumFreeSpaceMB = 18 * 1024
|
||||
|
||||
$availableSpaceMB | Should -BeGreaterThan $minimumFreeSpaceMB
|
||||
It "The image has enough disk space" {
|
||||
$diskInfo = Get-PSDrive -Name C
|
||||
$totalSpaceGB = [math]::Floor(($diskInfo.Used + $diskInfo.Free) / 1GB)
|
||||
$freeSpaceGB = [math]::Floor($diskInfo.Free / 1GB)
|
||||
Write-Host " [i] Disk size: ${totalSpaceGB} GB; Free space: ${freeSpaceGB} GB"
|
||||
$freeSpaceGB | Should -BeGreaterOrEqual 18
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user