From d7c0f968ca60994306c8c76cd8e4e0a677fe9ada Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 25 Oct 2019 21:16:37 -0400 Subject: 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 --- test/e2e/runlabel_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/e2e/runlabel_test.go') 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)) + }) }) -- cgit v1.2.3-54-g00ecf