Skip to content

Commit

Permalink
Update tests for a c/common error message change
Browse files Browse the repository at this point in the history
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Nov 17, 2023
1 parent ced07a5 commit a3d5814
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/buildah-bud/apply-podman-deltas
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ errmsg "no contents in .*" \
"Error: context must be a directory: .*" \
"bud with specified context should fail if context contains empty Dockerfile"

errmsg "checking authfile: stat /tmp/nonexistent: no such file or directory" \
"Error: checking authfile: stat /tmp/nonexistent: no such file or directory" \
errmsg "credential file is not accessible: stat /tmp/nonexistent: no such file or directory" \
"Error: credential file is not accessible: stat /tmp/nonexistent: no such file or directory" \
"bud with Containerfile should fail with nonexistent authfile"

errmsg "cannot find Containerfile or Dockerfile" \
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/login_logout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"push", "-q", "--authfile", "/tmp/nonexistent", ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
Expect(session.ErrorToString()).To(Equal("Error: checking authfile: stat /tmp/nonexistent: no such file or directory"))
Expect(session.ErrorToString()).To(Equal("Error: credential file is not accessible: stat /tmp/nonexistent: no such file or directory"))

session = podmanTest.Podman([]string{"push", "-q", "--authfile", authFile, ALPINE, testImg})
session.WaitWithDefaultTimeout()
Expand All @@ -182,7 +182,7 @@ var _ = Describe("Podman login and logout", func() {
session = podmanTest.Podman([]string{"logout", "--authfile", "/tmp/nonexistent", server})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
Expect(session.ErrorToString()).To(Equal("Error: checking authfile: stat /tmp/nonexistent: no such file or directory"))
Expect(session.ErrorToString()).To(Equal("Error: credential file is not accessible: stat /tmp/nonexistent: no such file or directory"))

session = podmanTest.Podman([]string{"logout", "--authfile", authFile, server})
session.WaitWithDefaultTimeout()
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ var _ = Describe("Podman pull", func() {
session := podmanTest.Podman([]string{"pull", "-q", "--authfile", "/tmp/nonexistent", ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
Expect(session.ErrorToString()).To(Equal("Error: checking authfile: stat /tmp/nonexistent: no such file or directory"))
Expect(session.ErrorToString()).To(Equal("Error: credential file is not accessible: stat /tmp/nonexistent: no such file or directory"))
})

It("podman pull by digest (image list)", func() {
Expand Down
4 changes: 2 additions & 2 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1297,12 +1297,12 @@ search | $IMAGE |
if [[ "$args" = "''" ]]; then args=;fi

run_podman 125 $command --authfile=$bogus $args
assert "$output" = "Error: checking authfile: stat $bogus: no such file or directory" \
assert "$output" = "Error: credential file is not accessible: stat $bogus: no such file or directory" \
"$command --authfile=nonexistent-path"

if [[ "$command" != "logout" ]]; then
REGISTRY_AUTH_FILE=$bogus run_podman ? $command $args
assert "$output" !~ "checking authfile" \
assert "$output" !~ "credential file is not accessible" \
"$command REGISTRY_AUTH_FILE=nonexistent-path"
fi
done < <(parse_table "$tests")
Expand Down
2 changes: 1 addition & 1 deletion test/system/700-play.bats
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ spec:
bogus=$PODMAN_TMPDIR/bogus-authfile

run_podman 125 kube play --authfile=$bogus - < $PODMAN_TMPDIR/test.yaml
is "$output" "Error: checking authfile: stat $bogus: no such file or directory" "$command should fail with not such file"
is "$output" "Error: credential file is not accessible: stat $bogus: no such file or directory" "$command should fail with not such file"
}

@test "podman kube play with umask from containers.conf" {
Expand Down

0 comments on commit a3d5814

Please sign in to comment.