summaryrefslogtreecommitdiff
path: root/test/apiv2/12-imagesMore.at
blob: d720ffa6521addfb88ad43c3cfcb16f77024b47b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- 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
# FIXME: this is failing:
#   "cause": "received unexpected HTTP status: 500 Internal Server Error",
#   "message": "error pushing image \"localhost:5000/myrepo:mytag\": error copying image to the remote destination: Error writing blob: Error initiating layer upload to /v2/myrepo/blobs/uploads/ in localhost:5000: received unexpected HTTP status: 500 Internal Server Error",
#   "response": 400
#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