summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2022-06-09 12:17:17 -0600
committerEd Santiago <santiago@redhat.com>2022-06-09 12:17:17 -0600
commit2b97795c19bb95eda50f1c6b97bc4b8433b57009 (patch)
tree4045dfe6451bf8e3cb760c53161a84d27f45d571
parent874ca426eb51e2b1c9fd1d0c052de2e21f4afd2d (diff)
downloadpodman-2b97795c19bb95eda50f1c6b97bc4b8433b57009.tar.gz
podman-2b97795c19bb95eda50f1c6b97bc4b8433b57009.tar.bz2
podman-2b97795c19bb95eda50f1c6b97bc4b8433b57009.zip
APIv2 tests: (try to) fix flaky registry panic
APIv2 tests are flaky after this morning's merge of #14543. Symptom: test-apiv2: Timed out (10s) waiting for service (/dev/tcp/localhost/5564) journal shows: registry[7421]: panic: unable to configure authorization (htpasswd): no access controller registered with name: none Possible cause: Mix of REGISTRY_AUTH=none with REGISTRY_AUTH_HTPASSWD_* vars. https://github.com/distribution/distribution/issues/1168 Solution: only set _HTPASSWD_* vars when AUTH=htpasswd Signed-off-by: Ed Santiago <santiago@redhat.com>
-rwxr-xr-xtest/apiv2/test-apiv210
1 files changed, 7 insertions, 3 deletions
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2
index 6151b7672..8ecc2aa2d 100755
--- a/test/apiv2/test-apiv2
+++ b/test/apiv2/test-apiv2
@@ -443,12 +443,18 @@ function start_registry() {
# If invoked with auth=htpasswd, create credentials
REGISTRY_USERNAME=
REGISTRY_PASSWORD=
+ declare -a registry_auth_params=(-e "REGISTRY_AUTH=$auth")
if [[ "$auth" = "htpasswd" ]]; then
REGISTRY_USERNAME=u$(random_string 7)
REGISTRY_PASSWORD=p$(random_string 7)
htpasswd -Bbn ${REGISTRY_USERNAME} ${REGISTRY_PASSWORD} \
> $AUTHDIR/htpasswd
+
+ registry_auth_params+=(
+ -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm"
+ -e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd"
+ )
fi
# Run the registry, and wait for it to come up
@@ -456,9 +462,7 @@ function start_registry() {
-p ${REGISTRY_PORT}:5000 \
--name registry \
-v $AUTHDIR:/auth:Z \
- -e "REGISTRY_AUTH=$auth" \
- -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
- -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
+ "${registry_auth_params[@]}" \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt \
-e REGISTRY_HTTP_TLS_KEY=/auth/domain.key \
${REGISTRY_IMAGE}