-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9669 from edsantiago/apiv2_registry
apiv2 tests: add helpers to start/stop a local registry
- Loading branch information
Showing
2 changed files
with
138 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters