summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/create_test.go7
-rw-r--r--test/e2e/info_test.go6
-rw-r--r--test/e2e/login_logout_test.go10
-rw-r--r--test/e2e/play_kube_test.go10
-rw-r--r--test/e2e/pull_test.go11
-rw-r--r--test/e2e/run_test.go7
-rw-r--r--test/e2e/runlabel_test.go15
-rw-r--r--test/e2e/search_test.go8
8 files changed, 70 insertions, 4 deletions
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index f5dca321c..7d977f4e3 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -297,4 +297,11 @@ var _ = Describe("Podman create", func() {
Expect(session.ExitCode()).To((Equal(0)))
Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
})
+
+ It("podman create --authfile with nonexist authfile", func() {
+ SkipIfRemote()
+ session := podmanTest.PodmanNoCache([]string{"create", "--authfile", "/tmp/nonexist", "--name=foo", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session).To(Not(Equal(0)))
+ })
})
diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go
index c960fb311..d3b1b974e 100644
--- a/test/e2e/info_test.go
+++ b/test/e2e/info_test.go
@@ -45,4 +45,10 @@ var _ = Describe("Podman Info", func() {
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman info --format GO template", func() {
+ session := podmanTest.Podman([]string{"info", "--format", "{{ json .}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.IsJSONOutputValid()).To(BeTrue())
+ })
})
diff --git a/test/e2e/login_logout_test.go b/test/e2e/login_logout_test.go
index 14cfed5db..c3df10f5e 100644
--- a/test/e2e/login_logout_test.go
+++ b/test/e2e/login_logout_test.go
@@ -123,6 +123,11 @@ var _ = Describe("Podman login and logout", func() {
json.Unmarshal(authInfo, &info)
fmt.Println(info)
+ // push should fail with nonexist authfile
+ session = podmanTest.Podman([]string{"push", "--authfile", "/tmp/nonexist", ALPINE, testImg})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+
session = podmanTest.Podman([]string{"push", "--authfile", authFile, ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -131,6 +136,11 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+ // logout should fail with nonexist authfile
+ session = podmanTest.Podman([]string{"logout", "--authfile", "/tmp/nonexist", server})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+
session = podmanTest.Podman([]string{"logout", "--authfile", authFile, server})
})
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 7069e049d..416c64b5a 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -209,6 +209,16 @@ var _ = Describe("Podman generate kube", func() {
processTestResult(f)
})
+ It("podman play kube fail with nonexist authfile", func() {
+ err := generateKubeYaml(getPod(), kubeYaml)
+ Expect(err).To(BeNil())
+
+ kube := podmanTest.Podman([]string{"play", "kube", "--authfile", "/tmp/nonexist", kubeYaml})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube.ExitCode()).To(Not(Equal(0)))
+
+ })
+
It("podman play kube test correct command", func() {
err := generateKubeYaml(getPod(), kubeYaml)
Expect(err).To(BeNil())
diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go
index 5152409af..96340ef30 100644
--- a/test/e2e/pull_test.go
+++ b/test/e2e/pull_test.go
@@ -339,7 +339,7 @@ var _ = Describe("Podman pull", func() {
})
It("podman pull check all tags", func() {
- session := podmanTest.PodmanNoCache([]string{"pull", "--all-tags", "alpine"})
+ session := podmanTest.PodmanNoCache([]string{"pull", "--all-tags", "k8s.gcr.io/pause"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.LineInOuputStartsWith("Pulled Images:")).To(BeTrue())
@@ -348,9 +348,12 @@ var _ = Describe("Podman pull", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 4))
+ })
- rmi := podmanTest.PodmanNoCache([]string{"rmi", "-a", "-f"})
- rmi.WaitWithDefaultTimeout()
- Expect(rmi.ExitCode()).To(Equal(0))
+ It("podman pull from docker with nonexist --authfile", func() {
+ SkipIfRemote()
+ session := podmanTest.PodmanNoCache([]string{"pull", "--authfile", "/tmp/nonexist", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
})
})
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 874aa498e..7fc85c9ce 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -992,4 +992,11 @@ USER mail`
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
})
+
+ It("podman run should fail with nonexist authfile", func() {
+ SkipIfRemote()
+ session := podmanTest.Podman([]string{"run", "--authfile", "/tmp/nonexist", ALPINE, "ls"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ })
})
diff --git a/test/e2e/runlabel_test.go b/test/e2e/runlabel_test.go
index 52a011efb..41d61e9d9 100644
--- a/test/e2e/runlabel_test.go
+++ b/test/e2e/runlabel_test.go
@@ -98,4 +98,19 @@ var _ = Describe("podman container runlabel", func() {
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
})
+
+ It("runlabel should fail with nonexist authfile", func() {
+ SkipIfRemote()
+ image := "podman-runlabel-test:podman"
+ podmanTest.BuildImage(PodmanDockerfile, image, "false")
+
+ // runlabel should fail with nonexist authfile
+ result := podmanTest.Podman([]string{"container", "runlabel", "--authfile", "/tmp/nonexist", "RUN", image})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Not(Equal(0)))
+
+ result = podmanTest.Podman([]string{"rmi", image})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ })
})
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go
index 9c28849f0..d88231510 100644
--- a/test/e2e/search_test.go
+++ b/test/e2e/search_test.go
@@ -391,4 +391,12 @@ registries = ['{{.Host}}:{{.Port}}']`
// cleanup
resetRegistriesConfigEnv()
})
+
+ // search should fail with nonexist authfile
+ It("podman search fail with nonexist --authfile", func() {
+ SkipIfRemote()
+ search := podmanTest.Podman([]string{"search", "--authfile", "/tmp/nonexist", ALPINE})
+ search.WaitWithDefaultTimeout()
+ Expect(search.ExitCode()).To(Not(Equal(0)))
+ })
})