Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more APIv2 tests for images. #7690

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions test/apiv2/12-imagesMore.at
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please stop/rm this when finished

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After use it will be removed in line 38 - t DELETE libpod/containers/registry?force=true 204


# 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