Skip to content

Commit 0e367c7

Browse files
Merge pull request #16257 from n1hility/win-smoke
Add Windows Smoke Testing
2 parents c772c00 + 884350d commit 0e367c7

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

.cirrus.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ env:
4545
FEDORA_CONTAINER_FQIN: "quay.io/libpod/fedora_podman:${IMAGE_SUFFIX}"
4646
#PRIOR_FEDORA_CONTAINER_FQIN: "quay.io/libpod/prior-fedora_podman:${IMAGE_SUFFIX}"
4747
UBUNTU_CONTAINER_FQIN: "quay.io/libpod/ubuntu_podman:${IMAGE_SUFFIX}"
48-
48+
WINDOWS_AMI: "win-server-wsl-c5138587457421312" # Replace with IMAGE_SUFFIX when aligned
4949
####
5050
#### Control variables that determine what to run and how to run it.
5151
#### N/B: Required ALL of these are set for every single task.
@@ -519,6 +519,26 @@ compose_test_task:
519519

520520

521521
# Execute the podman integration tests on all primary platforms and release
522+
windows_smoke_test_task:
523+
name: "Windows Smoke Test"
524+
alias: windows_smoke_test
525+
# Don't run for multiarch/container image cirrus-cron job.
526+
only_if: $CIRRUS_CRON != 'multiarch'
527+
depends_on:
528+
- alt_build
529+
ec2_instance:
530+
image: "${WINDOWS_AMI}"
531+
type: m5zn.metal
532+
region: us-east-1
533+
platform: windows
534+
env:
535+
PATH: "${PATH};C:\\ProgramData\\chocolatey\\bin"
536+
CIRRUS_SHELL: powershell
537+
# Fake version, we are only testing the installer functions, so version doesn't matter
538+
CIRRUS_WORKING_DIR: "${LOCALAPPDATA}\\Temp\\cirrus-ci-build"
539+
main_script: 'contrib/cirrus/win-podman-machine-verify.ps1'
540+
541+
522542
# versions, as root, without involving the podman-remote client.
523543
local_integration_test_task: &local_integration_test_task
524544
# Integration-test task name convention:
@@ -964,6 +984,7 @@ success_task:
964984
- alt_build
965985
- osx_alt_build
966986
- win_installer
987+
- windows_smoke_test
967988
- docker-py_test
968989
- unit_test
969990
- apiv2_test
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Powershell doesn't exit after command failures
2+
# Note, due to a bug in cirrus that does not correctly evaluate exit code,
3+
# errors conditions should always be thrown
4+
function CheckExit {
5+
if ($LASTEXITCODE -ne 0) {
6+
throw "Exit code failure = $LASTEXITCODE"
7+
}
8+
}
9+
10+
# Drop global envs which have unix paths, defaults are fine
11+
Remove-Item Env:\GOPATH
12+
Remove-Item Env:\GOSRC
13+
Remove-Item Env:\GOCACHE
14+
15+
mkdir tmp
16+
Set-Location tmp
17+
18+
# Download and extract alt_build win release zip
19+
$url = "${ENV:ART_URL}/Windows%20Cross/repo/repo.tbz"
20+
Write-Output "URL: $url"
21+
# Arc requires extension to be "tbz2"
22+
curl.exe -L -o repo.tbz2 "$url"; CheckExit
23+
arc unarchive repo.tbz2 .; CheckExit
24+
Set-Location repo
25+
Expand-Archive -Path "podman-remote-release-windows_amd64.zip" -DestinationPath extracted
26+
Set-Location extracted
27+
$x = Get-ChildItem -Path bin -Recurse
28+
Set-Location $x
29+
30+
# Verify extracted podman binary
31+
Write-Output "Starting init..."
32+
.\podman machine init; CheckExit
33+
Write-Output "Starting podman machine..."
34+
.\podman machine start; CheckExit
35+
for ($i =0; $i -lt 60; $i++) {
36+
.\podman info
37+
if ($LASTEXITCODE -eq 0) {
38+
break
39+
}
40+
Start-Sleep -Seconds 2
41+
}
42+
Write-Output "Running container..."
43+
.\podman run ubi8-micro sh -c "exit 123"
44+
if ($LASTEXITCODE -ne 123) {
45+
throw "Expected 123, got $LASTEXITCODE"
46+
}
47+
Exit 0

0 commit comments

Comments
 (0)