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. @@ -38,6 +38,7 @@ SCRIPTDIR=$(dirname $0) SCRIPT=$(basename $0) +APXS="apxs" function say() { echo "$SCRIPT: $*" @@ -56,7 +57,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 +72,12 @@ return 1 } +APXS=$(which apxs) \ + || APXS=$(which apxs2) \ + || fail "neither apxs or apxs2 found - required to run davautocheck" + +say "Using apxs $APXS" + if [ -x svn-config ]; then ABS_BUILDDIR=$(pwd) elif [ -x $SCRIPTDIR/../../../../svn-config ]; then @@ -94,15 +101,20 @@ "$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 +# need to remove quotes from whatever 'cut' extracts root=$("$HTTPD" -V | grep HTTPD_ROOT | cut -d '=' -f 2) HTTPD_REAL_ROOT=${root//\"/} [ -d "$HTTPD_REAL_ROOT" ] \ @@ -121,12 +133,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 +182,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__