Files
podman/contrib/cirrus/win-podman-machine-test.ps1
Paul Holzinger 9b9c60d814 CI: use z1d instance for windows machine testing
This one has two local NVMe's attached so we should be able to use fast
local storage to hopefully speed the test up. The NVMe are not mounted
by default so we have to format and mount them. I have choosen Z as
drive letter as I guess it seems most likely that it is free.
Then we need to set the TMPDIR envs to make the machine tests use the
new location.

This speeds up hyperV tests by 20mins and wsl by 9 mins.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-03-26 15:10:04 +01:00

45 lines
1.8 KiB
PowerShell

#!/usr/bin/env powershell
. $PSScriptRoot\win-lib.ps1
Write-Host "Recovering env. vars."
Import-CLIXML "$ENV:TEMP\envars.xml" | % {
Write-Host " $($_.Name) = $($_.Value)"
Set-Item "Env:$($_.Name)" "$($_.Value)"
}
if ($Env:TEST_FLAVOR -eq "machine-wsl") {
# FIXME: Test-modes should be definitively set and positively asserted.
# Otherwise if the var. goes out-of-scope, defaults change, or definition
# fails: Suddenly assumed behavior != actual behaviorr, esp. if/when only
# quickly glancing at a green status check-mark.
$Env:CONTAINERS_MACHINE_PROVIDER = "" # IMPLIES WSL
} elseif ($Env:TEST_FLAVOR -eq "machine-hyperv") {
$Env:CONTAINERS_MACHINE_PROVIDER = "hyperv"
} else {
Write-Host "Unsupported value for `$TEST_FLAVOR '$Env:TEST_FLAVOR'"
Exit 1
}
# Make sure an observer knows the value of this critical variable (consumed by tests).
Write-Host " CONTAINERS_MACHINE_PROVIDER = $Env:CONTAINERS_MACHINE_PROVIDER"
Write-Host "`n"
# The repo.tar.zst artifact was extracted here
Set-Location "$ENV:CIRRUS_WORKING_DIR\repo"
# Tests hard-code this location for podman-remote binary, make sure it actually runs.
Run-Command ".\bin\windows\podman.exe --version"
# Add policy.json to filesystem for podman machine pulls
New-Item -ItemType "directory" -Path "$env:AppData\containers"
Copy-Item -Path pkg\machine\ocipull\policy.json -Destination "$env:AppData\containers"
# Set TMPDIR to fast storage, see cirrus.yml setup_disk_script for setup Z:\
# TMPDIR is used by the machine tests paths, while TMP and TEMP are the normal
# windows temporary dirs. Just to ensure everything uses the fast disk.
$Env:TMPDIR = 'Z:\'
$Env:TMP = 'Z:\'
$Env:TEMP = 'Z:\'
Write-Host "`nRunning podman-machine e2e tests"
Run-Command ".\winmake localmachine"