summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-29 19:29:51 +0000
committerGitHub <noreply@github.com>2020-09-29 19:29:51 +0000
commit453333a35cc791e9031e5d24e0ac5e76a2b2aa75 (patch)
treebdbc8cbcad91d0b96e5c7195628d1e94d9a89f5e
parent12f173f4732d50a85bf4875807597d2fd0e92cc0 (diff)
parent81d9ba59db28dccf98c9faad8e337135ab8b0643 (diff)
downloadpodman-453333a35cc791e9031e5d24e0ac5e76a2b2aa75.tar.gz
podman-453333a35cc791e9031e5d24e0ac5e76a2b2aa75.tar.bz2
podman-453333a35cc791e9031e5d24e0ac5e76a2b2aa75.zip
Merge pull request #7828 from edsantiago/bats
System tests: corner case for run --pull
-rw-r--r--test/system/030-run.bats17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index b3599cc17..813dd9266 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -153,8 +153,23 @@ echo $rand | 0 | $rand
run_podman run --pull=always $NONLOCAL_IMAGE true
is "$output" "Trying to pull .*" "--pull=always [with image PRESENT]: re-fetches"
+ # Very weird corner case fixed by #7770: 'podman run foo' will run 'myfoo'
+ # if it exists, because the string 'foo' appears in 'myfoo'. This test
+ # covers that, as well as making sure that our testimage (which is always
+ # tagged :YYYYMMDD, never :latest) doesn't match either.
+ run_podman tag $IMAGE my${PODMAN_TEST_IMAGE_NAME}:latest
+ run_podman 125 run --pull=never $PODMAN_TEST_IMAGE_NAME true
+ is "$output" "Error: unable to find a name and tag match for $PODMAN_TEST_IMAGE_NAME in repotags: no such image" \
+ "podman run --pull=never with shortname (and implicit :latest)"
+
+ # ...but if we add a :latest tag (without 'my'), it should now work
+ run_podman tag $IMAGE ${PODMAN_TEST_IMAGE_NAME}:latest
+ run_podman run --pull=never ${PODMAN_TEST_IMAGE_NAME} cat /home/podman/testimage-id
+ is "$output" "$PODMAN_TEST_IMAGE_TAG" \
+ "podman run --pull=never, with shortname, succeeds if img is present"
+
run_podman rm -a
- run_podman rmi $NONLOCAL_IMAGE
+ run_podman rmi $NONLOCAL_IMAGE {my,}${PODMAN_TEST_IMAGE_NAME}:latest
}
# 'run --rmi' deletes the image in the end unless it's used by another container