github.com/AbhinandanKurakure/podman/v3@v3.4.10/test/apiv2/60-auth.at (about)

     1  # -*- sh -*-
     2  #
     3  # registry-related tests
     4  #
     5  
     6  start_registry
     7  
     8  # Test unreachable
     9  t POST /v1.40/auth username=$REGISTRY_USERNAME password=WrOnGPassWord serveraddress=does.not.exist.io:1234/ \
    10    500 \
    11    .message~'.*no such host.*'
    12  
    13  # Test with wrong password. Confirm bad status and appropriate error message
    14  t POST /v1.40/auth username=$REGISTRY_USERNAME password=WrOnGPassWord serveraddress=localhost:$REGISTRY_PORT/ \
    15    500 \
    16    .message~'.* 401 Unauthorized'
    17  
    18  # Test with the right password. Confirm status message
    19  t POST /v1.40/auth username=$REGISTRY_USERNAME password=$REGISTRY_PASSWORD serveraddress=localhost:$REGISTRY_PORT/ \
    20    200 \
    21    .Status="Login Succeeded" \
    22    .IdentityToken=""
    23  
    24  # Same test with url scheme provided
    25  t POST /v1.40/auth username=$REGISTRY_USERNAME password=$REGISTRY_PASSWORD serveraddress=https://localhost:$REGISTRY_PORT/ \
    26    200 \
    27    .Status="Login Succeeded" \
    28    .IdentityToken=""