-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for podman preset
- Loading branch information
Showing
5 changed files
with
176 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package test_test | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
"runtime" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("podman preset", Label("podman-preset"), func() { | ||
|
||
Describe("basic use", func() { | ||
|
||
It("write to config", func() { | ||
Expect(RunCRCExpectSuccess("config", "set", "preset", "podman")).To(ContainSubstring("Changes to configuration property 'preset' are only applied when the CRC instance is created.")) | ||
}) | ||
|
||
It("setup CRC", func() { | ||
Expect(RunCRCExpectSuccess("setup")).To(ContainSubstring("Your system is correctly setup for using CRC")) | ||
}) | ||
|
||
It("start CRC", func() { | ||
Expect(RunCRCExpectSuccess("start")).To(ContainSubstring("podman runtime is now running")) | ||
}) | ||
|
||
It("podman-env", func() { | ||
// Do what 'eval $(crc podman-env) would do | ||
path := os.ExpandEnv("${HOME}/.crc/bin/oc:$PATH") | ||
csshk := os.ExpandEnv("${HOME}/.crc/machines/crc/id_ecdsa") | ||
dh := os.ExpandEnv("unix:///${HOME}/.crc/machines/crc/docker.sock") | ||
ch := "ssh://[email protected]:2222/run/user/1000/podman/podman.sock" | ||
if runtime.GOOS == "windows" { | ||
userHomeDir, _ := os.UserHomeDir() | ||
unexpandedPath := filepath.Join(userHomeDir, ".crc/bin/oc;${PATH}") | ||
path = os.ExpandEnv(unexpandedPath) | ||
csshk = filepath.Join(userHomeDir, ".crc/machines/crc/id_ecdsa") | ||
dh = "npipe:////./pipe/rc-podman" | ||
} | ||
if runtime.GOOS == "linux" { | ||
ch = "ssh://[email protected]:22/run/user/1000/podman/podman.sock" | ||
} | ||
|
||
os.Setenv("PATH", path) | ||
os.Setenv("CONTAINER_SSHKEY", csshk) | ||
os.Setenv("CONTAINER_HOST", ch) | ||
os.Setenv("DOCKER_HOST", dh) | ||
}) | ||
|
||
It("version", func() { | ||
Expect(RunPodmanExpectSuccess("version")).Should(MatchRegexp(`Version:[\s]*\d+\.\d+\.\d+`)) | ||
}) | ||
|
||
It("pull image", func() { | ||
RunPodmanExpectSuccess("pull", "fedora") | ||
}) | ||
|
||
It("run image", func() { | ||
RunPodmanExpectSuccess("run", "fedora") | ||
}) | ||
|
||
It("cleanup CRC", func() { | ||
Expect(RunCRCExpectSuccess("cleanup")).To(MatchRegexp("Cleanup finished")) | ||
}) | ||
|
||
It("unset preset in config", func() { | ||
Expect(RunCRCExpectSuccess("config", "unset", "preset")).To(ContainSubstring("Successfully unset configuration property 'preset'")) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters