aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-26 20:45:30 +0200
committerGitHub <noreply@github.com>2022-09-26 20:45:30 +0200
commita0c0971e63b42031d05e82c26add5354ae69a7cf (patch)
tree902c463e0753d9549fd097abbbb001ea15704806 /test
parentaaeabb0e8cc4aca1c621677f9c73f1757df300c4 (diff)
parent7bc36602f6c407cffdc799ca1b2fc7c00bc4f93b (diff)
downloadpodman-a0c0971e63b42031d05e82c26add5354ae69a7cf.tar.gz
podman-a0c0971e63b42031d05e82c26add5354ae69a7cf.tar.bz2
podman-a0c0971e63b42031d05e82c26add5354ae69a7cf.zip
Merge pull request #15933 from vrothberg/fix-15879
auto-update: validate container image
Diffstat (limited to 'test')
-rw-r--r--test/system/255-auto-update.bats20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/system/255-auto-update.bats b/test/system/255-auto-update.bats
index 76f6b02e8..6f5113779 100644
--- a/test/system/255-auto-update.bats
+++ b/test/system/255-auto-update.bats
@@ -133,6 +133,26 @@ function _confirm_update() {
die "Timed out waiting for $cname to update; old IID=$old_iid"
}
+@test "podman auto-update - validate input" {
+ # Fully-qualified image reference is required
+ run_podman create --label io.containers.autoupdate=registry $IMAGE
+ run_podman rm -f "$output"
+
+ # Short name does not work
+ shortname="shortname:latest"
+ run_podman image tag $IMAGE $shortname
+ run_podman 125 create --label io.containers.autoupdate=registry $shortname
+ is "$output" "Error: short name: auto updates require fully-qualified image reference: \"$shortname\""
+
+ # Requires docker (or no) transport
+ archive=$PODMAN_TMPDIR/archive.tar
+ run_podman save -o $archive $IMAGE
+ run_podman 125 create --label io.containers.autoupdate=registry docker-archive:$archive
+ is "$output" ".*Error: auto updates require the docker image transport but image is of transport \"docker-archive\""
+
+ run_podman rmi $shortname
+}
+
# This test can fail in dev. environment because of SELinux.
# quick fix: chcon -t container_runtime_exec_t ./bin/podman
@test "podman auto-update - label io.containers.autoupdate=image" {