diff --git a/pkg/machine/e2e/README.md b/pkg/machine/e2e/README.md index 9f430b1460..4b4ddf6567 100644 --- a/pkg/machine/e2e/README.md +++ b/pkg/machine/e2e/README.md @@ -12,8 +12,15 @@ ### HyperV 1. Open a powershell as admin -2. $env:CONTAINERS_MACHINE_PROVIDER="hyperv" -3. $env:MACHINE_IMAGE="https://fedorapeople.org/groups/podman/testing/hyperv/fedora-coreos-38.20230830.dev.0-hyperv.x86_64.vhdx.zip" -4. `./test/tools/build/ginkgo.exe -vv --tags "remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp remote" -timeout=90m --trace --no-color pkg/machine/e2e/. ` +1. $env:CONTAINERS_MACHINE_PROVIDER="hyperv" +1. $env:MACHINE_IMAGE="https://fedorapeople.org/groups/podman/testing/hyperv/fedora-coreos-38.20230830.dev.0-hyperv.x86_64.vhdx.zip" +1. `./test/tools/build/ginkgo.exe -vv --tags "remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp remote" -timeout=90m --trace --no-color pkg/machine/e2e/. ` + +Note: Add `--focus-file "basic_test.go" ` to only run basic test + +### WSL +1. Open a powershell as a regular user +1. Build and copy win-sshproxy into bin/ +1. `./test/tools/build/ginkgo.exe -vv --tags "remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp remote" -timeout=90m --trace --no-color pkg/machine/e2e/. ` Note: Add `--focus-file "basic_test.go" ` to only run basic test diff --git a/pkg/machine/e2e/config_unix_test.go b/pkg/machine/e2e/config_unix_test.go new file mode 100644 index 0000000000..b46b596efe --- /dev/null +++ b/pkg/machine/e2e/config_unix_test.go @@ -0,0 +1,22 @@ +//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd + +package e2e_test + +import ( + "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 +} diff --git a/pkg/machine/e2e/config_windows_test.go b/pkg/machine/e2e/config_windows_test.go index 6fa5cdd80e..5c39507140 100644 --- a/pkg/machine/e2e/config_windows_test.go +++ b/pkg/machine/e2e/config_windows_test.go @@ -1,3 +1,17 @@ package e2e_test +import ( + "github.com/containers/podman/v4/pkg/machine" + "github.com/containers/podman/v4/pkg/machine/wsl" + . "github.com/onsi/ginkgo/v2" +) + const podmanBinary = "../../../bin/windows/podman.exe" + +func getDownloadLocation(_ machine.VirtProvider) string { + fd, err := wsl.NewFedoraDownloader(machine.WSLVirt, "", defaultStream.String()) + if err != nil { + Fail("unable to get WSL virtual image") + } + return fd.Get().URL.String() +} diff --git a/pkg/machine/e2e/machine_test.go b/pkg/machine/e2e/machine_test.go index b392fb2838..af20d2f23e 100644 --- a/pkg/machine/e2e/machine_test.go +++ b/pkg/machine/e2e/machine_test.go @@ -44,6 +44,7 @@ func TestMachine(t *testing.T) { } var _ = BeforeSuite(func() { + testProvider, err := provider.Get() if err != nil { Fail("unable to create testProvider") @@ -51,17 +52,15 @@ var _ = BeforeSuite(func() { downloadLocation := os.Getenv("MACHINE_IMAGE") - dd, err := testProvider.NewDownload("") - if err != nil { - Fail("unable to create new download") - } if len(downloadLocation) < 1 { - fcd, err := dd.GetFCOSDownload(defaultStream) - if err != nil { - Fail("unable to get virtual machine image") + 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) } - downloadLocation = fcd.Location } + compressionExtension := fmt.Sprintf(".%s", testProvider.Compression().String()) suiteImageName = strings.TrimSuffix(path.Base(downloadLocation), compressionExtension) fqImageName = filepath.Join(tmpDir, suiteImageName)