mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
Mostly fix a bad design decision I made early on, re: registry. old: registry starts once, runs to the end new: registry is brought up on demand, then stopped Reason: there are times when we need a password-controlled registry, and times when we need it open. As long as I'm in here, I've also cleaned up some confusing code and fixed things so tests can run rootless again. Signed-off-by: Ed Santiago <santiago@redhat.com>
31 lines
933 B
Bash
31 lines
933 B
Bash
# -*- sh -*-
|
|
#
|
|
# registry-related tests
|
|
#
|
|
|
|
start_registry htpasswd
|
|
|
|
# Test unreachable
|
|
t POST /v1.40/auth username=$REGISTRY_USERNAME password=WrOnGPassWord serveraddress=does.not.exist.io:1234/ \
|
|
500 \
|
|
.message~'.*no such host.*'
|
|
|
|
# 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/ \
|
|
500 \
|
|
.message~'.* 401 Unauthorized'
|
|
|
|
# Test with the right password. Confirm status message
|
|
t POST /v1.40/auth username=$REGISTRY_USERNAME password=$REGISTRY_PASSWORD serveraddress=localhost:$REGISTRY_PORT/ \
|
|
200 \
|
|
.Status="Login Succeeded" \
|
|
.IdentityToken=""
|
|
|
|
# Same test with url scheme provided
|
|
t POST /v1.40/auth username=$REGISTRY_USERNAME password=$REGISTRY_PASSWORD serveraddress=https://localhost:$REGISTRY_PORT/ \
|
|
200 \
|
|
.Status="Login Succeeded" \
|
|
.IdentityToken=""
|
|
|
|
stop_registry
|