summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-10 08:52:36 -0500
committerGitHub <noreply@github.com>2021-02-10 08:52:36 -0500
commitb4ca924365869d73aecd10bb99656b99ab8bf0ae (patch)
tree669426a9466d274cc4618484f9014902656357a1 /test
parent629a9796e5be3f239928600613170e430c3e17b7 (diff)
parentf4ece018b468e97e693d94628d3aa82acbcb6dc4 (diff)
downloadpodman-b4ca924365869d73aecd10bb99656b99ab8bf0ae.tar.gz
podman-b4ca924365869d73aecd10bb99656b99ab8bf0ae.tar.bz2
podman-b4ca924365869d73aecd10bb99656b99ab8bf0ae.zip
Merge pull request #9297 from matejvasek/apiv2_push_get_digest
Docker [APIv2] push sends digest in response body
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/12-imagesMore.at18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/apiv2/12-imagesMore.at b/test/apiv2/12-imagesMore.at
index fe6a271ce..4f3ddf925 100644
--- a/test/apiv2/12-imagesMore.at
+++ b/test/apiv2/12-imagesMore.at
@@ -3,6 +3,9 @@
# Tests for more image-related endpoints
#
+red='\e[31m'
+nc='\e[0m'
+
podman pull -q $IMAGE
t GET libpod/images/json 200 \
@@ -26,6 +29,17 @@ t GET libpod/images/$IMAGE/json 200 \
podman run -d --name registry -p 5000:5000 quay.io/libpod/registry:2.6 /entrypoint.sh /etc/docker/registry/config.yml
wait_for_port localhost 5000
+# Push to local registry and check output
+while read -r LINE
+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)
+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
@@ -43,3 +57,7 @@ t DELETE libpod/images/$IMAGE 200 \
.ExitCode=0
t DELETE libpod/images/quay.io/libpod/registry:2.6 200 \
.ExitCode=0
+
+if [ -z "${GOT_DIGEST}" ] ; then
+ exit 1;
+fi