aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/login_logout_test.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2019-10-25 21:16:37 -0400
committerQi Wang <qiwan@redhat.com>2019-11-05 21:32:18 -0500
commitd7c0f968ca60994306c8c76cd8e4e0a677fe9ada (patch)
tree3eff712a3fbb1c58eac9d7e43a55588a56d67892 /test/e2e/login_logout_test.go
parentb4b727256c728295e6a3fcb69593347df9e90b23 (diff)
downloadpodman-d7c0f968ca60994306c8c76cd8e4e0a677fe9ada.tar.gz
podman-d7c0f968ca60994306c8c76cd8e4e0a677fe9ada.tar.bz2
podman-d7c0f968ca60994306c8c76cd8e4e0a677fe9ada.zip
fix bug check nonexist authfile
Use GetDefaultAuthFile() from buildah. For podman command(except login), if authfile does not exist returns error. close #4328 Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'test/e2e/login_logout_test.go')
-rw-r--r--test/e2e/login_logout_test.go10
1 files changed, 10 insertions, 0 deletions
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})
})