mirror of
https://github.com/containers/podman.git
synced 2025-12-03 03:39:44 +08:00
Initial framework for testing the version 2 (HTTP) API. Includes a collection of tests for some of the existing endpoints. Not all tests are currently passing. Signed-off-by: Ed Santiago <santiago@redhat.com>
37 lines
879 B
Bash
37 lines
879 B
Bash
# -*- 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
|