From 933fb30a19f46e108a4da908707efa5ff263312e Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 15 Jul 2009 23:30:50 +1200 Subject: [PATCH] TestBed: Truely make distcheck work for all configure levels Thanks to Alex Rousskov for identifying the necessary environment setting. --- src/auth/Acl.cc | 19 +++++++++---------- src/auth/UserRequest.cc | 10 ++++++---- test-suite/buildtests/layer-00-default.opts | 5 ++++- test-suite/buildtests/layer-01-minimal.opts | 5 ++++- test-suite/buildtests/layer-02-maximus.opts | 9 +++++++-- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/auth/Acl.cc b/src/auth/Acl.cc index dddea7d0d4..affaffafae 100644 --- a/src/auth/Acl.cc +++ b/src/auth/Acl.cc @@ -6,9 +6,11 @@ #include "auth/AclProxyAuth.h" #include "HttpRequest.h" -/** retval -1 user not authenticated (authentication error?) - retval 0 user not authorized OR user authentication is in pgrogress - retval +1 user authenticated and authorized */ +/** + * \retval -1 user not authenticated (authentication error?) + * \retval 0 user not authorized OR user authentication is in progress + * \retval +1 user authenticated and authorized + */ int AuthenticateAcl(ACLChecklist *ch) { @@ -38,19 +40,16 @@ AuthenticateAcl(ACLChecklist *ch) * unlock auth_user_request on our behalf, but it was too * ugly and hard to follow. Now we do our own locking here. * - * I'm not sure what tryToAuthenticateAndSetAuthUser does when - * auth_user_request is set before calling. I'm tempted to - * unlock and set it to NULL, but it seems safer to save the - * pointer before calling and unlock it afterwards. If the - * pointer doesn't change then its a no-op. + * AYJ 2009-07-15: + * tryToAuthenticateAndSetAuthUser now only produces the auth_user_request object + * for use here. Will try to authenticate if missing. And fix-up request pointer if unset. */ - AuthUserRequest *old_auth_user_request = checklist->auth_user_request; const auth_acl_t result = AuthUserRequest::tryToAuthenticateAndSetAuthUser( &checklist->auth_user_request, headertype, request, checklist->conn(), checklist->src_addr); if (checklist->auth_user_request) AUTHUSERREQUESTLOCK(checklist->auth_user_request, "ACLAuth::authenticated"); - AUTHUSERREQUESTUNLOCK(old_auth_user_request, "old ACLAuth"); + switch (result) { case AUTH_ACL_CANNOT_AUTHENTICATE: diff --git a/src/auth/UserRequest.cc b/src/auth/UserRequest.cc index 285e19c706..6aa57f2e01 100644 --- a/src/auth/UserRequest.cc +++ b/src/auth/UserRequest.cc @@ -502,11 +502,10 @@ AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_typ } auth_acl_t - AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr) { /* If we have already been called, return the cached value */ - AuthUserRequest *t = authTryGetUser (auth_user_request, conn, request); + AuthUserRequest *t = authTryGetUser(auth_user_request, conn, request); if (t && t->lastReply != AUTH_ACL_CANNOT_AUTHENTICATE && t->lastReply != AUTH_ACL_HELPER) { @@ -523,11 +522,14 @@ AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_re /* ok, call the actual authenticator routine. */ auth_acl_t result = authenticate(auth_user_request, headertype, request, conn, src_addr); - t = authTryGetUser (auth_user_request, conn, request); + t = authTryGetUser(auth_user_request, conn, request); if (t && result != AUTH_ACL_CANNOT_AUTHENTICATE && - result != AUTH_ACL_HELPER) + result != AUTH_ACL_HELPER) { t->lastReply = result; + if (!*auth_user_request) + *auth_user_request = t; + } return result; } diff --git a/test-suite/buildtests/layer-00-default.opts b/test-suite/buildtests/layer-00-default.opts index 74779fcfc7..fa83cf001a 100644 --- a/test-suite/buildtests/layer-00-default.opts +++ b/test-suite/buildtests/layer-00-default.opts @@ -6,4 +6,7 @@ MAKETEST="distcheck" # Default configuration options. # - Nothing special configured. Just whatever is found by "./configure" # -OPTS="" +OPTS="--disable-loadable-modules" + +# Fix the distclean testing. +export DISTCHECK_CONFIGURE_FLAGS="${OPTS}" diff --git a/test-suite/buildtests/layer-01-minimal.opts b/test-suite/buildtests/layer-01-minimal.opts index 10756db62b..07ab7b0b1c 100644 --- a/test-suite/buildtests/layer-01-minimal.opts +++ b/test-suite/buildtests/layer-01-minimal.opts @@ -6,7 +6,7 @@ # # Check - everything MUST work at this level # distcheck is not possible here since it drops our configure options... -MAKETEST="check" +MAKETEST="distcheck" # # # The options for this level can be easily generated semi-automatically from configure.in by: @@ -97,3 +97,6 @@ OPTS=" \ --without-dns-cname \ --without-po2html \ " + +# Fix the distclean testing. +export DISTCHECK_CONFIGURE_FLAGS="${OPTS}" diff --git a/test-suite/buildtests/layer-02-maximus.opts b/test-suite/buildtests/layer-02-maximus.opts index ba8a9b580f..e85113e0bd 100644 --- a/test-suite/buildtests/layer-02-maximus.opts +++ b/test-suite/buildtests/layer-02-maximus.opts @@ -6,7 +6,7 @@ # # Complete Check - everything is supposed to work at this level # distcheck is not possible since it drops our configure options... -MAKETEST="check" +MAKETEST="distcheck" # # # The options for this level can be easily generated semi-automatically from configure.in by: @@ -41,7 +41,7 @@ MAKETEST="check" # # OPTS=" \ - --enable-loadable-modules \ + --disable-loadable-modules \ --enable-gnuregex \ --enable-optimizations \ --enable-inline \ @@ -108,3 +108,8 @@ OPTS=" \ --with-pthreads \ --with-valgrind-debug \ " + +# Fix the distclean testing. +export DISTCHECK_CONFIGURE_FLAGS="${OPTS}" + + -- 2.47.3