Index: subversion/tests/clients/cmdline/davautocheck.sh
===================================================================
--- subversion/tests/clients/cmdline/davautocheck.sh	(revision 14162)
+++ subversion/tests/clients/cmdline/davautocheck.sh	(working copy)
@@ -5,7 +5,7 @@
 # This script simplifies preparation of environment for Subversion client
 # communicating with a server via DAV protocol. The prerequisites of such
 # testing are:
-#   - Subversion built using --enable-shared --enable-dso --enable-apsx options,
+#   - Subversion built using --enable-shared --enable-dso --enable-apxs options,
 #   - Working Apache 2 HTTPD Server reachable through PATH,
 #   - Modules dav_module and log_config_module compiled as DSO or built into
 #     Apache HTTPD Server executable.
@@ -38,6 +38,7 @@
 
 SCRIPTDIR=$(dirname $0)
 SCRIPT=$(basename $0)
+APXS="apxs"
 
 function say() {
   echo "$SCRIPT: $*"
@@ -56,7 +57,8 @@
 }
 
 function get_loadmodule_config() {
-  local SO="$HTTPD_REAL_ROOT/libexec/$1.so"
+  local MD=`apxs -q LIBEXECDIR`
+  local SO="$MD/$1.so"
 
   # shared object module?
   if [ -r "$SO" ]; then
@@ -71,6 +73,16 @@
   return 1
 }
 
+function check_for_apxs() {
+  APXS=$(which apxs) \
+   || APXS=$(which apxs2) \
+   || fail "neither apxs or apxs2 found - required to run davautocheck"
+
+  say "Using apxs $APXS"
+}
+
+check_for_apxs
+
 if [ -x svn-config ]; then
   ABS_BUILDDIR=$(pwd)
 elif [ -x $SCRIPTDIR/../../../../svn-config ]; then
@@ -94,9 +106,13 @@
 "$CLIENT_CMD" --version | grep -q '^[*] ra_dav' \
   || fail "Subversion client couldn't find and/or load ra_dav library"
 
-HTTPD=$(which httpd 2>/dev/null) \
-  || fail "HTTPD executable not found"
+#HTTPD=$(which httpd 2>/dev/null) \
+#  || fail "HTTPD executable not found"
 
+HTTPD="$($APXS -q SBINDIR)/$($APXS -q TARGET)"
+[ -x $HTTPD ] ||
+   fail "HTTPD executable not found"
+
 "$HTTPD" -v 1>/dev/null 2>&1 \
   || fail "HTTPD doesn't start properly"
 
@@ -121,12 +137,17 @@
 HTTPD_LOG="$HTTPD_ROOT/log"
 HTTPD_MIME_TYPES="$HTTPD_ROOT/mime.types"
 BASE_URL="http://localhost:$HTTPD_PORT"
+HTTPD_USERS="$HTTPD_ROOT/users"
 
 mkdir "$HTTPD_ROOT" \
   || fail "couldn't create temporary directory '$HTTPD_ROOT'"
 
 say "Using directory '$HTTPD_ROOT'..."
 
+say "Adding users for lock authentication"
+htpasswd -bc $HTTPD_USERS jrandom   rayjandom
+htpasswd -b  $HTTPD_USERS jconstant rayjandom
+
 touch $HTTPD_MIME_TYPES
 
 cat > "$HTTPD_CFG" <<__EOF__
@@ -165,10 +186,18 @@
 <Location /repositories>
   DAV               svn
   SVNParentPath     "$ABS_BUILDDIR/subversion/tests/clients/cmdline/repositories"
+  AuthType          Basic
+  AuthName          "Subversion Repository"
+  AuthUserFile      $HTTPD_USERS
+  Require           valid-user
 </Location>
 <Location /local_tmp/repos>
   DAV               svn
   SVNPath           "$ABS_BUILDDIR/subversion/tests/clients/cmdline/local_tmp/repos"
+  AuthType          Basic
+  AuthName          "Subversion Repository"
+  AuthUserFile      $HTTPD_USERS
+  Require           valid-user
 </Location>
 __EOF__
 

