summaryrefslogtreecommitdiff
path: root/test/apiv2/10-images.at
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-27 07:14:16 -0800
committerGitHub <noreply@github.com>2020-01-27 07:14:16 -0800
commit094baa5366a3f41df2511ff2d749a773f2eed03f (patch)
treea24c88ec5804eb42aa9e015a4ab2351cf1584040 /test/apiv2/10-images.at
parent7794fafdadd1c416164d5bca0964ae13b1bb3cc2 (diff)
parentc2f50499c9e344a4bff56719fe66fa846ae3064d (diff)
downloadpodman-094baa5366a3f41df2511ff2d749a773f2eed03f.tar.gz
podman-094baa5366a3f41df2511ff2d749a773f2eed03f.tar.bz2
podman-094baa5366a3f41df2511ff2d749a773f2eed03f.zip
Merge pull request #4894 from edsantiago/test_apiv2
Tests for API v2
Diffstat (limited to 'test/apiv2/10-images.at')
-rw-r--r--test/apiv2/10-images.at36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at
new file mode 100644
index 000000000..243b35e9f
--- /dev/null
+++ b/test/apiv2/10-images.at
@@ -0,0 +1,36 @@
+# -*- sh -*-
+#
+# Tests for image-related endpoints
+#
+
+# FIXME: API doesn't support pull yet, so use podman
+podman pull -q $IMAGE
+
+# We want the SHA without the "sha256:" prefix
+full_iid=$(podman images --no-trunc --format '{{.ID}}' $IMAGE)
+iid=${full_iid##sha256:}
+
+t GET libpod/images/$iid/exists 204
+t GET libpod/images/$PODMAN_TEST_IMAGE_NAME/exists 204
+
+# FIXME: compare to actual podman info
+t GET libpod/images/json 200 \
+ .[0].Id=${iid}
+
+t GET libpod/images/$iid/json 200 \
+ .Id=$iid \
+ .RepoTags[0]=$IMAGE
+
+# Same thing, but with abbreviated image id
+t GET libpod/images/${iid:0:12}/json 200 \
+ .Id=$iid \
+ .RepoTags[0]=$IMAGE
+
+# FIXME: docker API incompatibility: libpod returns 'id', docker 'sha256:id'
+t GET images/$iid/json 200 \
+ .Id=sha256:$iid \
+ .RepoTags[0]=$IMAGE
+
+#t POST images/create fromImage=alpine 201 foo
+
+# vim: filetype=sh