summaryrefslogtreecommitdiff
path: root/test/apiv2/60-auth.at
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-10 10:10:48 +0100
committerGitHub <noreply@github.com>2021-03-10 10:10:48 +0100
commitd98b55f03b43701bea2398123c761d02e7c61239 (patch)
treeebcbeb5450982c89c2c36c96daf72659d8bea98f /test/apiv2/60-auth.at
parent09473d43001f5818dbb178cba81f2f61e3de1457 (diff)
parente33f523907bb37c8295d113ea516a7ef3b6ea552 (diff)
downloadpodman-d98b55f03b43701bea2398123c761d02e7c61239.tar.gz
podman-d98b55f03b43701bea2398123c761d02e7c61239.tar.bz2
podman-d98b55f03b43701bea2398123c761d02e7c61239.zip
Merge pull request #9669 from edsantiago/apiv2_registry
apiv2 tests: add helpers to start/stop a local registry
Diffstat (limited to 'test/apiv2/60-auth.at')
-rw-r--r--test/apiv2/60-auth.at29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/apiv2/60-auth.at b/test/apiv2/60-auth.at
new file mode 100644
index 000000000..378955cd7
--- /dev/null
+++ b/test/apiv2/60-auth.at
@@ -0,0 +1,29 @@
+# -*- sh -*-
+#
+# registry-related tests
+#
+
+start_registry
+
+# FIXME FIXME FIXME: remove the 'if false' for use with PR 9589
+if false; then
+
+# FIXME FIXME: please forgive the horrible POST params format; I have an
+# upcoming PR which should fix that.
+
+# Test with wrong password. Confirm bad status and appropriate error message
+t POST /v1.40/auth "\"username\":\"${REGISTRY_USERNAME}\",\"password\":\"WrOnGPassWord\",\"serveraddress\":\"localhost:$REGISTRY_PORT/\"" \
+ 400 \
+ .Status~'.* invalid username/password'
+
+# Test with the right password. Confirm status message and reasonable token
+t POST /v1.40/auth "\"username\":\"${REGISTRY_USERNAME}\",\"password\":\"${REGISTRY_PASSWORD}\",\"serveraddress\":\"localhost:$REGISTRY_PORT/\"" \
+ 200 \
+ .Status="Login Succeeded" \
+ .IdentityToken~[a-zA-Z0-9]
+
+# FIXME: now what? Try something-something using that token?
+token=$(jq -r .IdentityToken <<<"$output")
+# ...
+
+fi # FIXME FIXME FIXME: remove when working