diff options
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/containers_conf_test.go | 32 | ||||
-rw-r--r-- | test/e2e/play_kube_test.go | 10 | ||||
-rw-r--r-- | test/e2e/pull_test.go | 8 |
3 files changed, 41 insertions, 9 deletions
diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go index 2a6f177f2..838221dd5 100644 --- a/test/e2e/containers_conf_test.go +++ b/test/e2e/containers_conf_test.go @@ -452,4 +452,36 @@ var _ = Describe("Podman run", func() { Expect(result).Should(Exit(0)) Expect(result.OutputToString()).To(ContainSubstring("(default 1234)")) }) + + It("podman bad infra_image name in containers.conf", func() { + infra1 := "i.do/not/exist:image" + infra2 := "i.still.do/not/exist:image" + errorString := "initializing source docker://" + infra1 + error2String := "initializing source docker://" + infra2 + configPath := filepath.Join(podmanTest.TempDir, "containers.conf") + os.Setenv("CONTAINERS_CONF", configPath) + + containersConf := []byte("[engine]\ninfra_image=\"" + infra1 + "\"") + err = ioutil.WriteFile(configPath, containersConf, os.ModePerm) + Expect(err).To(BeNil()) + + if IsRemote() { + podmanTest.RestartRemoteService() + } + + result := podmanTest.Podman([]string{"pod", "create", "--infra-image", infra2}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(125)) + Expect(result.ErrorToString()).To(ContainSubstring(error2String)) + + result = podmanTest.Podman([]string{"pod", "create"}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(125)) + Expect(result.ErrorToString()).To(ContainSubstring(errorString)) + + result = podmanTest.Podman([]string{"create", "--pod", "new:pod1", ALPINE}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(125)) + Expect(result.ErrorToString()).To(ContainSubstring(errorString)) + }) }) diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 1c7eb09a4..71bfd1e99 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -1659,7 +1659,7 @@ var _ = Describe("Podman play kube", func() { inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod), "--format", "'{{ range .Config.Env }}[{{ . }}]{{end}}'"}) inspect.WaitWithDefaultTimeout() Expect(inspect).Should(Exit(0)) - Expect(inspect.OutputToString()).To(ContainSubstring(`[FOO=]`)) + Expect(inspect.OutputToString()).To(Not(ContainSubstring(`[FOO=]`))) }) It("podman play kube test optional env value from missing configmap", func() { @@ -1674,7 +1674,7 @@ var _ = Describe("Podman play kube", func() { inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod), "--format", "'{{ range .Config.Env }}[{{ . }}]{{end}}'"}) inspect.WaitWithDefaultTimeout() Expect(inspect).Should(Exit(0)) - Expect(inspect.OutputToString()).To(ContainSubstring(`[FOO=]`)) + Expect(inspect.OutputToString()).To(Not(ContainSubstring(`[FOO=]`))) }) It("podman play kube test get all key-value pairs from configmap as envs", func() { @@ -1768,7 +1768,7 @@ var _ = Describe("Podman play kube", func() { inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod), "--format", "'{{ range .Config.Env }}[{{ . }}]{{end}}'"}) inspect.WaitWithDefaultTimeout() Expect(inspect).Should(Exit(0)) - Expect(inspect.OutputToString()).To(ContainSubstring(`[FOO=]`)) + Expect(inspect.OutputToString()).To(Not(ContainSubstring(`[FOO=]`))) }) It("podman play kube test optional env value from secret with missing key", func() { @@ -1784,7 +1784,7 @@ var _ = Describe("Podman play kube", func() { inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod), "--format", "'{{ range .Config.Env }}[{{ . }}]{{end}}'"}) inspect.WaitWithDefaultTimeout() Expect(inspect).Should(Exit(0)) - Expect(inspect.OutputToString()).To(ContainSubstring(`[FOO=]`)) + Expect(inspect.OutputToString()).To(Not(ContainSubstring(`[FOO=]`))) }) It("podman play kube test get all key-value pairs from secret as envs", func() { @@ -3212,7 +3212,7 @@ ENV OPENJ9_JAVA_OPTIONS=%q inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(pod), "--format", "'{{ range .Config.Env }}[{{ . }}]{{end}}'"}) inspect.WaitWithDefaultTimeout() Expect(inspect).Should(Exit(0)) - Expect(inspect.OutputToString()).To(ContainSubstring(`[FOO=]`)) + Expect(inspect.OutputToString()).To(Not(ContainSubstring(`[FOO=]`))) }) It("podman play kube uses all key-value pairs as envs", func() { diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go index f22acca6e..38afff9bd 100644 --- a/test/e2e/pull_test.go +++ b/test/e2e/pull_test.go @@ -354,13 +354,13 @@ var _ = Describe("Podman pull", func() { session = podmanTest.Podman([]string{"rmi", "cirros"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session = podmanTest.Podman([]string{"pull", imgPath}) + session = podmanTest.Podman([]string{"run", imgPath, "ls"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session = podmanTest.Podman([]string{"images"}) + // Note that reference is not preserved in dir. + session = podmanTest.Podman([]string{"image", "exists", "cirros"}) session.WaitWithDefaultTimeout() - Expect(session).Should(Exit(0)) - Expect(session.LineInOutputContainsTag(filepath.Join("localhost", dirpath), "latest")).To(BeTrue()) + Expect(session).Should(Exit(1)) }) It("podman pull from local OCI directory", func() { |