Skip to content

Commit

Permalink
Merge pull request containers#20914 from baude/machinehypervregression
Browse files Browse the repository at this point in the history
Fix regression in e2e machine test suite
  • Loading branch information
openshift-merge-bot[bot] authored Dec 8, 2023
2 parents 0a9914f + 1ebd507 commit d513749
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ env:
DEBIAN_NAME: "debian-13"

# Image identifiers
IMAGE_SUFFIX: "c20231116t174419z-f39f38d13"
IMAGE_SUFFIX: "c20231206t225809z-f39f38d13"


# EC2 images
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
Expand Down
7 changes: 7 additions & 0 deletions contrib/cirrus/win-podman-machine-main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

Set-Location "$ENV:CIRRUS_WORKING_DIR\repo"

$GvTargetDir = "C:\Program Files\Redhat\Podman\"

#Expand-Archive -Path "podman-remote-release-windows_amd64.zip" -DestinationPath $GvTargetDir

New-Item -Path $GvTargetDir -ItemType "directory"
Copy-Item "bin/windows/gvproxy.exe" -Destination $GvTargetDir

Write-Host "Saving selection of CI env. vars."
# Env. vars will not pass through win-sess-launch.ps1
Get-ChildItem -Path "Env:\*" -include @("PATH", "Chocolatey*", "CIRRUS*", "TEST_*", "CI_*") `
Expand Down
14 changes: 14 additions & 0 deletions pkg/machine/e2e/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,17 @@ func isVmtype(vmType machine.VMType) bool {
func isWSL() bool {
return isVmtype(machine.WSLVirt)
}

func getFCOSDownloadLocation(p machine.VirtProvider) string {
dd, err := p.NewDownload("")
if err != nil {
Fail("unable to create new download")
}

fcd, err := dd.GetFCOSDownload(defaultStream)
if err != nil {
Fail("unable to get virtual machine image")
}

return fcd.Location
}
13 changes: 1 addition & 12 deletions pkg/machine/e2e/config_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,10 @@ import (
"os/exec"

"github.com/containers/podman/v4/pkg/machine"
. "github.com/onsi/ginkgo/v2"
)

func getDownloadLocation(p machine.VirtProvider) string {
dd, err := p.NewDownload("")
if err != nil {
Fail("unable to create new download")
}

fcd, err := dd.GetFCOSDownload(defaultStream)
if err != nil {
Fail("unable to get virtual machine image")
}

return fcd.Location
return getFCOSDownloadLocation(p)
}

func pgrep(n string) (string, error) {
Expand Down
5 changes: 4 additions & 1 deletion pkg/machine/e2e/config_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import (

const podmanBinary = "../../../bin/windows/podman.exe"

func getDownloadLocation(_ machine.VirtProvider) string {
func getDownloadLocation(p machine.VirtProvider) string {
if p.VMType() == machine.HyperVVirt {
return getFCOSDownloadLocation(p)
}
fd, err := wsl.NewFedoraDownloader(machine.WSLVirt, "", defaultStream.String())
if err != nil {
Fail("unable to get WSL virtual image")
Expand Down
3 changes: 0 additions & 3 deletions pkg/machine/e2e/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ var _ = BeforeSuite(func() {
downloadLocation = getDownloadLocation(testProvider)
// we cannot simply use OS here because hyperv uses fcos; so WSL is just
// special here
if testProvider.VMType() != machine.WSLVirt {
downloadLocation = getDownloadLocation(testProvider)
}
}

compressionExtension := fmt.Sprintf(".%s", testProvider.Compression().String())
Expand Down

0 comments on commit d513749

Please sign in to comment.