diff options
author | Vladimir Kochnev <hashtable@yandex.ru> | 2022-06-03 19:42:21 +0300 |
---|---|---|
committer | Vladimir Kochnev <hashtable@yandex.ru> | 2022-06-07 14:20:46 +0300 |
commit | e41d4a24713e606d24807012e021c7aac924011e (patch) | |
tree | 4e54bc5c157a13f6e3a68ce3536e1eb924fb1fc7 /test/apiv2/12-imagesMore.at | |
parent | 8f79604864412a05d5d1b8614cb356f5b481306b (diff) | |
download | podman-e41d4a24713e606d24807012e021c7aac924011e.tar.gz podman-e41d4a24713e606d24807012e021c7aac924011e.tar.bz2 podman-e41d4a24713e606d24807012e021c7aac924011e.zip |
Add missing tests for manifests API
Also:
- It fixes a regression in parsing "images" parameter in
ManifestAddV3 handler.
- Refactors 12-imagesMore.at to use start_registry helper.
- Removes some unsafe "exit 1" statements which skip clean up.
Signed-off-by: Vladimir Kochnev <hashtable@yandex.ru>
Diffstat (limited to 'test/apiv2/12-imagesMore.at')
-rw-r--r-- | test/apiv2/12-imagesMore.at | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at index 67b4f1c79..98f396a17 100644 --- a/test/apiv2/12-imagesMore.at +++ b/test/apiv2/12-imagesMore.at @@ -6,6 +6,8 @@ red='\e[31m' nc='\e[0m' +start_registry + podman pull -q $IMAGE t GET libpod/images/json 200 \ @@ -20,15 +22,10 @@ t GET libpod/images/$IMAGE/tree 200 \ 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 POST "libpod/images/$IMAGE/tag?repo=localhost:$REGISTRY_PORT/myrepo&tag=mytag" 201 t GET libpod/images/$IMAGE/json 200 \ - .RepoTags[1]=localhost:5000/myrepo:mytag - -# Run registry container -# FIXME this fails if python tests have been run first... -podman run -d --name registry -p 5000:5000 quay.io/libpod/registry:2.7 /entrypoint.sh /etc/docker/registry/config.yml -wait_for_port localhost 5000 + .RepoTags[1]=localhost:$REGISTRY_PORT/myrepo:mytag # Push to local registry and check output while read -r LINE @@ -36,32 +33,23 @@ do if echo "${LINE}" | jq --exit-status 'select( .status != null) | select ( .status | contains("digest: sha256:"))' &>/dev/null; then GOT_DIGEST="1" fi -done < <(curl -sL "http://$HOST:$PORT/images/localhost:5000/myrepo/push?tlsVerify=false&tag=mytag" -XPOST) +done < <(curl -sL "http://$HOST:$PORT/images/localhost:$REGISTRY_PORT/myrepo/push?tlsVerify=false&tag=mytag" -XPOST -H "X-Registry-Config: $REGISTRY_CONFIG_HEADER") if [ -z "${GOT_DIGEST}" ] ; then echo -e "${red}not ok: did not found digest in output${nc}" 1>&2; fi # Push to local registry -t POST "images/localhost:5000/myrepo/push?tlsVerify=false&tag=mytag" 200 +t POST "images/localhost:$REGISTRY_PORT/myrepo/push?tlsVerify=false&tag=mytag" 200 # Untag the image -t POST "libpod/images/$iid/untag?repo=localhost:5000/myrepo&tag=mytag" 201 +t POST "libpod/images/$iid/untag?repo=localhost:$REGISTRY_PORT/myrepo&tag=mytag" 201 # Try to push non-existing image -t POST "images/localhost:5000/idonotexist/push?tlsVerify=false" 404 +t POST "images/localhost:$REGISTRY_PORT/idonotexist/push?tlsVerify=false" 404 t GET libpod/images/$IMAGE/json 200 \ .RepoTags[-1]=$IMAGE -# Remove the registry container -t DELETE libpod/containers/registry?force=true 200 - -# Remove images +# Remove image t DELETE libpod/images/$IMAGE 200 \ .ExitCode=0 -t DELETE libpod/images/quay.io/libpod/registry:2.7 200 \ - .ExitCode=0 - -if [ -z "${GOT_DIGEST}" ] ; then - exit 1; -fi |