summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-29 13:41:42 +0000
committerGitHub <noreply@github.com>2021-03-29 13:41:42 +0000
commitac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad (patch)
tree401c7ddec178185b6af4dc782bfbba4d20673e06 /test/system
parent259004f0a9cc18018127baec0bfcf8bc091dabb6 (diff)
parent4d5199537737b0cfef47d3d2700013a787126d21 (diff)
downloadpodman-ac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad.tar.gz
podman-ac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad.tar.bz2
podman-ac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad.zip
Merge pull request #9631 from rhatdan/pull
Fix podman build --pull-never
Diffstat (limited to 'test/system')
-rw-r--r--test/system/070-build.bats27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 8f6cdb46b..e5b68a0d8 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -668,6 +668,33 @@ EOF
run_podman image prune -f
}
+@test "podman build --pull-never" {
+ local tmpdir=$PODMAN_TMPDIR/build-test
+ mkdir -p $tmpdir
+
+ # First, confirm that --pull-never is a NOP if image exists locally
+ local random_string=$(random_string 15)
+
+ cat >$tmpdir/Containerfile <<EOF
+FROM $IMAGE
+RUN echo $random_string
+EOF
+
+ run_podman build -t build_test --pull-never $tmpdir
+ is "$output" ".*$random_string" "pull-never is OK if image already exists"
+ run_podman rmi build_test
+
+ # Now try an image that does not exist locally nor remotely
+ cat >$tmpdir/Containerfile <<EOF
+FROM quay.io/libpod/nosuchimage:nosuchtag
+RUN echo $random_string
+EOF
+
+ run_podman 125 build -t build_test --pull-never $tmpdir
+ is "$output" ".* pull policy is .never. but .* could not be found locally" \
+ "--pull-never fails with expected error message"
+}
+
@test "podman build --logfile test" {
tmpdir=$PODMAN_TMPDIR/build-test
mkdir -p $tmpdir