summaryrefslogtreecommitdiff
path: root/test/apiv2/12-imagesMore.at
diff options
context:
space:
mode:
authorEdward Shen <weshen@redhat.com>2020-09-18 08:56:44 -0400
committerEdward Shen <weshen@redhat.com>2020-10-09 22:19:04 -0400
commiteb11e12f3516817f87a4b75abc13779d7fc9298b (patch)
tree58533168c6753cedc8c3db2525ecccf65c270ffa /test/apiv2/12-imagesMore.at
parentcec240375d6dceb09c705d6d55e67aeff037327f (diff)
downloadpodman-eb11e12f3516817f87a4b75abc13779d7fc9298b.tar.gz
podman-eb11e12f3516817f87a4b75abc13779d7fc9298b.tar.bz2
podman-eb11e12f3516817f87a4b75abc13779d7fc9298b.zip
Add more APIv2 tests for images: push, tag, untag, rmi and image tree.
Signed-off-by: Edward Shen <weshen@redhat.com>
Diffstat (limited to 'test/apiv2/12-imagesMore.at')
-rw-r--r--test/apiv2/12-imagesMore.at44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at
new file mode 100644
index 000000000..30ccf0cfc
--- /dev/null
+++ b/test/apiv2/12-imagesMore.at
@@ -0,0 +1,44 @@
+# -*- sh -*-
+#
+# Tests for more image-related endpoints
+#
+
+podman pull -q $IMAGE
+
+t GET libpod/images/json 200 \
+ .[0].Id~[0-9a-f]\\{64\\}
+iid=$(jq -r '.[0].Id' <<<"$output")
+
+# Retrieve the image tree
+t GET libpod/images/$IMAGE/tree 200 \
+ .Tree~^Image
+
+# Tag nonesuch image
+t POST "libpod/images/nonesuch/tag?repo=myrepo&tag=mytag" '' 404
+
+# Tag the image
+t POST "libpod/images/$IMAGE/tag?repo=localhost:5000/myrepo&tag=mytag" '' 201
+
+t GET libpod/images/$IMAGE/json 200 \
+ .RepoTags[1]=localhost:5000/myrepo:mytag
+
+# Run registry container
+podman run -d --name registry -p 5000:5000 docker.io/library/registry:2.6 /entrypoint.sh /etc/docker/registry/config.yml
+
+# Push to local registry
+t POST libpod/images/localhost:5000/myrepo:mytag/push\?tlsVerify\=false '' 200
+
+# Untag the image
+t POST "libpod/images/$iid/untag?repo=localhost:5000/myrepo&tag=mytag" '' 201
+
+t GET libpod/images/$IMAGE/json 200 \
+ .RepoTags[-1]=$IMAGE
+
+# Remove the registry container
+t DELETE libpod/containers/registry?force=true 204
+
+# Remove images
+t DELETE libpod/images/$IMAGE 200 \
+ .ExitCode=0
+t DELETE libpod/images/docker.io/library/registry:2.6 200 \
+ .ExitCode=0