Index: subversion/tests/clients/cmdline/davautocheck.sh
===================================================================
--- subversion/tests/clients/cmdline/davautocheck.sh (revision 14176)
+++ 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.
@@ -56,7 +56,7 @@
}
function get_loadmodule_config() {
- local SO="$HTTPD_REAL_ROOT/libexec/$1.so"
+ local SO="$($APXS -q LIBEXECDIR)/$1.so"
# shared object module?
if [ -r "$SO" ]; then
@@ -71,6 +71,16 @@
return 1
}
+# Pick up value from Makefile or PATH (also try apxs2 (Debian))
+[ ${APXS:+set} ] \
+ || APXS=$(which apxs) \
+ || APXS=$(which apxs2) \
+ || fail "neither apxs or apxs2 found - required to run davautocheck"
+
+[ -x $APXS ] || fail "Can't execute apxs executable $APXS"
+
+say "Using apxs $APXS"
+
if [ -x svn-config ]; then
ABS_BUILDDIR=$(pwd)
elif [ -x $SCRIPTDIR/../../../../svn-config ]; then
@@ -94,20 +104,19 @@
"$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="$($APXS -q SBINDIR)/$($APXS -q PROGNAME)"
+[ -x $HTTPD ] ||
+ fail "HTTPD executable not found"
+HTPASSWD="$($APXS -q SBINDIR)/htpasswd"
+[ -x $HTPASSWD ] ||
+ fail "HTPASSWD executable not found"
+
"$HTTPD" -v 1>/dev/null 2>&1 \
|| fail "HTTPD doesn't start properly"
say "Using '$HTTPD'..."
-# need to remove quotes from whatevere 'cut' extracts
-root=$("$HTTPD" -V | grep HTTPD_ROOT | cut -d '=' -f 2)
-HTTPD_REAL_ROOT=${root//\"/}
-[ -d "$HTTPD_REAL_ROOT" ] \
- || fail "HTTPD real root not found"
-
LOAD_MOD_DAV=$(get_loadmodule_config mod_dav) \
|| fail "DAV module not found"
@@ -121,12 +130,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 +179,18 @@
DAV svn
SVNParentPath "$ABS_BUILDDIR/subversion/tests/clients/cmdline/repositories"
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ Require valid-user
DAV svn
SVNPath "$ABS_BUILDDIR/subversion/tests/clients/cmdline/local_tmp/repos"
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ Require valid-user
__EOF__