diff --git a/test/e2e/testsuite/testsuite.go b/test/e2e/testsuite/testsuite.go index e65cb978a4..517adcd493 100644 --- a/test/e2e/testsuite/testsuite.go +++ b/test/e2e/testsuite/testsuite.go @@ -879,7 +879,11 @@ func EnsureUserIsLoggedIntoClusterSucceedsOrFails(expected string) error { } func EnsureOCCommandIsAvailable() error { - return setOcEnv() + err := setOcEnv() + if err != nil { + return err + } + return setPodmanEnv() } func setOcEnv() error { @@ -889,6 +893,13 @@ func setOcEnv() error { return util.ExecuteCommandSucceedsOrFails("eval $(crc oc-env)", "succeeds") } +func setPodmanEnv() error { + if runtime.GOOS == "windows" { + return util.ExecuteCommandSucceedsOrFails("crc podman-env | Invoke-Expression", "succeeds") + } + return util.ExecuteCommandSucceedsOrFails("eval $(crc podman-env)", "succeeds") +} + func SetConfigPropertyToValueSucceedsOrFails(property string, value string, expected string) error { // Since network-mode is only supported on Linux, we skip this property test for non-linux platforms if property == "network-mode" && runtime.GOOS != "linux" { @@ -937,13 +948,13 @@ func DeletingPodSucceedsOrFails(expected string) error { func PodmanCommandIsAvailable() error { // Do what 'eval $(crc podman-env) would do - path := os.ExpandEnv("${HOME}/.crc/bin/oc:$PATH") + path := os.ExpandEnv("${HOME}/.crc/bin/podman:$PATH") csshk := os.ExpandEnv("${HOME}/.crc/machines/crc/id_ecdsa") dh := os.ExpandEnv("unix:///${HOME}/.crc/machines/crc/docker.sock") ch := "ssh://core@127.0.0.1:2222/run/user/1000/podman/podman.sock" if runtime.GOOS == "windows" { userHomeDir, _ := os.UserHomeDir() - unexpandedPath := filepath.Join(userHomeDir, ".crc/bin/oc;${PATH}") + unexpandedPath := filepath.Join(userHomeDir, ".crc/bin/podman;${PATH}") path = os.ExpandEnv(unexpandedPath) csshk = filepath.Join(userHomeDir, ".crc/machines/crc/id_ecdsa") dh = "npipe:////./pipe/crc-podman"