On 2003-11-04 00:43+0200, Jani Averbach wrote:
This patch is essentially same as previously posted, except
one changed instanse of BUILDTYPE -> BUILD_TYPE.
+ $CP_F "$TEST_ROOT/mod_dav_svn_$BUILD_TYPE.conf" "$INST_DIR/$HTTPD/conf/mod_dav_svn.conf" || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
Sorry about that.
BR, Jani
>
> Log:
>
> This patch add support for ra_dav testing, and support for
> putting test directory on ramdisk. Apr, Apr-util and httpd will
> be rebuilt when necessary.
>
> tools/test-script/svntest/svntest-rebuild-generic.sh is attachment.
>
tools/test-scripts/svntest/svntest.sh
- check essential config variables
- rebuilding of apr, apr-util and httpd
- run ra_dav test
- send out result emails of ra_dav also
tools/test-scripts/svntest/svntest-update.sh
- UPDATE_REBUILD_FLAG, new function
- update httpd also
tools/test-scripts/svntest/svntest-run.sh
- use SVNBIN instead of SVN for svn binary
- added ra_dav check
- added logic to re-initialize $OBJ/subversion/tests
directory when we are using ramdisk
tools/test-scripts/svntest/svntest-config.sh
- added names for project
- added MAKE_OPTS, RAMDISK, RA_DAV_CHECK_ARGS
- changed $BIN (==/usr/)binto USRBIN, added BIN (/bin)
OPTBIN (==/opt/bin), removed TOPBIN
- Added MOUNT, UMOUNT and TOUCH
- Changed TAIL to TAIL_100 (The woe of Coreutils 5.0!)
- Added functions mount_ramdisk, umount_ramdisk
tools/test-scripts/svntest/svntest-rebuild.sh
- Added logic to support ramdisk
- Added install step
tools/test-scripts/svntest/svntest-sendmail.sh
- changed SVN to SVNBIN
tools/test-scripts/svntest/README
- new documentation for changes
tools/test-scripts/svntest/svntest-rebuild-generic.sh
- new file for building apr, apr-util and httpd.
Index: tools/test-scripts/svntest/svntest.sh
===================================================================
--- tools/test-scripts/svntest/svntest.sh (revision 7624)
+++ tools/test-scripts/svntest/svntest.sh (working copy)
@@ -5,6 +5,27 @@
# Source the configuration file.
. "$EXEC_PATH/svntest-config.sh"
+
+test -z $TEST_ROOT && exit 1
+test -z $INST_DIR && exit 1
+test -z $SVN_REPO && exit 1
+test -z $APR && exit 1
+test -z $APR_REPO && exit 1
+test -z $APU && exit 1
+test -z $APU_REPO && exit 1
+test -z $HTTPD && exit 1
+test -z $HTTPD_REPO && exit 1
+test -z $RAMDISK && exit 1
+test -z $RA_DAV_CHECK_ARGS && exit 1
+test -z $LOG_FILE_PREFIX && exit 1
+test -z $CONFIG_PREFIX && exit 1
+test -z $OBJ_STATIC && exit 1
+test -z $OBJ_SHARED && exit 1
+test -z $FROM && exit 1
+test -z $TO && exit 1
+test -z $ERROR_TO && exit 1
+test -z $REPLY_TO && exit 1
+
# Remove log files from previous runs
$RM_F "$LOG_FILE_PREFIX.update"
$RM_F "$LOG_FILE_PREFIX.shared"
@@ -16,6 +37,30 @@
exit
}
+# conditionally rebuild apr, apr-util and httpd
+$EXEC_PATH/svntest-rebuild-generic.sh "$APR" "$APU" "$MAKE_OPTS" || {
+ $EXEC_PATH/svntest-sendmail.sh "update" "FAIL"
+ exit
+}
+$EXEC_PATH/svntest-rebuild-generic.sh "$APU" "$HTTPD" "$MAKE_OPTS" || {
+ $EXEC_PATH/svntest-sendmail.sh "update" "FAIL"
+ exit
+}
+# httpd won't build with parallel make
+$EXEC_PATH/svntest-rebuild-generic.sh "$HTTPD" "" "" || {
+ $EXEC_PATH/svntest-sendmail.sh "update" "FAIL"
+ exit
+}
+
+# add rebuild log files to the main log file
+test -f "$LOG_FILE_PREFIX.rebuild-$APR" && \
+ $CAT "$LOG_FILE_PREFIX.rebuild-$APR" >> "$LOG_FILE_PREFIX.update"
+test -f "$LOG_FILE_PREFIX.rebuild-$APU" && \
+ $CAT "$LOG_FILE_PREFIX.rebuild-$APU" >> "$LOG_FILE_PREFIX.update"
+test -f "$LOG_FILE_PREFIX.rebuild-$HTTPD" && \
+ $CAT "$LOG_FILE_PREFIX.rebuild-$HTTPD" >> "$LOG_FILE_PREFIX.update"
+
+
# Prime the shared and static log files
echo >> "$LOG_FILE_PREFIX.update"
$CP_F "$LOG_FILE_PREFIX.update" "$LOG_FILE_PREFIX.shared"
@@ -30,6 +75,9 @@
$NICE $EXEC_PATH/svntest-run.sh "shared" "ra_svn"
test $? = 0 && shared_ra_svn="PASS" || shared_ra_svn="FAIL"
+
+ $NICE $EXEC_PATH/svntest-run.sh "shared" "ra_dav"
+ test $? = 0 && shared_ra_dav="PASS" || shared_ra_dav="FAIL"
}
# Test static
@@ -41,6 +89,9 @@
$NICE $EXEC_PATH/svntest-run.sh "static" "ra_svn"
test $? = 0 && static_ra_svn="PASS" || static_ra_svn="FAIL"
+
+ $NICE $EXEC_PATH/svntest-run.sh "static" "ra_dav"
+ test $? = 0 && static_ra_dav="PASS" || static_ra_dav="FAIL"
}
# Send out the mails
@@ -49,6 +100,7 @@
test $shared = "PASS" && {
$EXEC_PATH/svntest-sendmail.sh "shared" "ra_local" "$shared_ra_local"
$EXEC_PATH/svntest-sendmail.sh "shared" "ra_svn" "$shared_ra_svn"
+ $EXEC_PATH/svntest-sendmail.sh "shared" "ra_dav" "$shared_ra_dav"
}
test $static = "FAIL" && \
@@ -56,4 +108,5 @@
test $static = "PASS" && {
$EXEC_PATH/svntest-sendmail.sh "static" "ra_local" "$static_ra_local"
$EXEC_PATH/svntest-sendmail.sh "static" "ra_svn" "$static_ra_svn"
+ $EXEC_PATH/svntest-sendmail.sh "static" "ra_dav" "$static_ra_dav"
}
Index: tools/test-scripts/svntest/svntest-update.sh
===================================================================
--- tools/test-scripts/svntest/svntest-update.sh (revision 7624)
+++ tools/test-scripts/svntest/svntest-update.sh (working copy)
@@ -8,34 +8,68 @@
# Compute local vars
LOG_FILE="$LOG_FILE_PREFIX.update"
-# Update apr, apr-util, httpd-2.0
-START "update apr" "Updating APR..."
+CVS_UPDATE_REGEXP_1='^[UPARMC] \(\(docs\)\|\(STATUS\)\|\(CHANGES\)\)'
+CVS_UPDATE_REGEXP_2='^[UPARMC] [A-Za-z]'
+
+#
+# If update status file contains already
+# '0' (== don't rebuild) then update value,
+# otherwise, honor current 'rebuild needed' (1)
+# value, and don't update it because
+# current rebuild value could be '0'
+UPDATE_REBUILD_FLAG () {
+ local CVS_UP_STATUS="$1"
+ local RB_FILE="$2"
+
+ if test ! -f "$RB_FILE"
+ then
+ echo "1" > "$RB_FILE"
+ elif test 0 -eq `$CAT "$RB_FILE"`
+ then
+ if test "$CVS_UP_STATUS" -eq 0
+ then
+ echo "1" > "$RB_FILE"
+ else
+ echo "0" > "$RB_FILE"
+ fi
+ fi
+}
+
+# Update apr, apr-util, httpd
+START "update $APR" "Updating $APR..."
cd $APR_REPO && $CVS -f -q -z6 update -d -P > "$TEST_ROOT/LOG_up_apr" 2>&1
test $? = 0 || {
FAIL_LOG "$TEST_ROOT/LOG_up_apr"
FAIL
}
PASS
+$GREP -qv "$UPDATE_REGEXP_1" "$TEST_ROOT/LOG_up_apr" | $GREP -q "$UPDATE_REGEXP_2" > /dev/null 2>&1
+UPDATE_REBUILD_FLAG $? $APR_REPO.rb
-START "update apr-util" "Updating APR-UTIL..."
+
+START "update $APU" "Updating $APU..."
cd $APU_REPO && $CVS -f -q -z6 update -d -P > "$TEST_ROOT/LOG_up_apu" 2>&1
test $? = 0 || {
FAIL_LOG "$TEST_ROOT/LOG_up_apu"
FAIL
}
PASS
+$GREP -qv "$UPDATE_REGEXP_1" "$TEST_ROOT/LOG_up_apu" | $GREP -q "$UPDATE_REGEXP_2" > /dev/null 2>&1
+UPDATE_REBUILD_FLAG $? $APU_REPO.rb
-#START "update httpd-2.0" "Updating Apache..."
-#cd $HTTPD_REPO && $CVS -f -q -z6 update -d -P > "$TEST_ROOT/LOG_up_httpd" 2>&1
-#test $? = 0 || {
-# FAIL_LOG "$TEST_ROOT/LOG_up_httpd"
-# FAIL
-#}
-#PASS
+START "update $HTTPD" "Updating $HTTPD..."
+cd $HTTPD_REPO && $CVS -f -q -z6 update -d -P > "$TEST_ROOT/LOG_up_httpd" 2>&1
+test $? = 0 || {
+ FAIL_LOG "$TEST_ROOT/LOG_up_httpd"
+ FAIL
+}
+PASS
+$GREP -qv "$UPDATE_REGEXP_1" "$TEST_ROOT/LOG_up_httpd" | $GREP -q "$UPDATE_REGEXP_2" > /dev/null 2>&1
+UPDATE_REBUILD_FLAG $? $HTTPD_REPO.rb
# Update svn
START "update subversion" "Updating Subversion..."
-cd $SVN_REPO && $SVN update > "$TEST_ROOT/LOG_up_svn" 2>&1
+cd $SVN_REPO && $SVNBIN update > "$TEST_ROOT/LOG_up_svn" 2>&1
test $? = 0 || {
FAIL_LOG "$TEST_ROOT/LOG_up_svn"
FAIL
Index: tools/test-scripts/svntest/svntest-run.sh
===================================================================
--- tools/test-scripts/svntest/svntest-run.sh (revision 7624)
+++ tools/test-scripts/svntest/svntest-run.sh (working copy)
@@ -10,7 +10,7 @@
# Compute local vars
LOG_FILE="$LOG_FILE_PREFIX.$BUILD_TYPE.$RA_TYPE"
TEST="`$GUESS` $BUILD_TYPE $RA_TYPE"
-REV="`$SVN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
+REV="`$SVNBIN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
# Prime and initialize the log file
$CP_F "$LOG_FILE_PREFIX.$BUILD_TYPE" $LOG_FILE
@@ -25,7 +25,7 @@
static) OBJ="$OBJ_STATIC" ;;
*) echo "$BUILD_TYPE: unknown build type"
echo "$BUILD_TYPE: unknown build type" >> $LOG_FILE
- FAIL ;;
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests";;
esac
PASS
@@ -34,27 +34,61 @@
case $RA_TYPE in
ra_local) CHECK_TARGET="check" ;;
ra_svn) CHECK_TARGET="svncheck" ;;
+ ra_dav) CHECK_TARGET="davcheck" ;;
*) echo "$RA_TYPE: unknown RA type"
echo "$RA_TYPE: unknown RA type" >> $LOG_FILE
- FAIL ;;
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests";;
esac
PASS
# Check that the object directory exists, and that it contains the
# necessary executable files
START "check object directory" "Checking object directory..."
-test -d $TEST_ROOT/$OBJ || FAIL; PASS
+test -d $TEST_ROOT/$OBJ || FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"; PASS
+
START "check svn executable" "Checking svn executable..."
-test -x $TEST_ROOT/$OBJ/subversion/clients/cmdline/svn || FAIL; PASS
+test -x $TEST_ROOT/$OBJ/subversion/clients/cmdline/svn || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"; PASS
+
START "check svnadmin executable" "Checking svnadmin executable..."
-test -x $TEST_ROOT/$OBJ/subversion/svnadmin/svnadmin || FAIL; PASS
+test -x $TEST_ROOT/$OBJ/subversion/svnadmin/svnadmin || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"; PASS
+
START "check svnlook executable" "Checking svnlook executable..."
-test -x $TEST_ROOT/$OBJ/subversion/svnlook/svnlook || FAIL; PASS
+test -x $TEST_ROOT/$OBJ/subversion/svnlook/svnlook || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"; PASS
+
START "check svnserve executable" "Checking svnserve executable..."
-test -x $TEST_ROOT/$OBJ/subversion/svnserve/svnserve || FAIL; PASS
+test -x $TEST_ROOT/$OBJ/subversion/svnserve/svnserve || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"; PASS
+
START "check svnversion executable" "Checking svnversion executable..."
-test -x $TEST_ROOT/$OBJ/subversion/svnversion/svnversion || FAIL; PASS
+test -x $TEST_ROOT/$OBJ/subversion/svnversion/svnversion || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"; PASS
+# Build has initially mounted ramdisk for us, but this
+# script will at the end to do unmount, so check if it is mounted or not
+# and if it is not, do initial fire up for it
+if test "xyes" == "x$RAMDISK";
+then
+ test -x $TEST_ROOT/$OBJ/subversion/tests/clients || {
+ START "re-initializing ramdisk" "Re-initializing ramdisk"
+ mount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests" >> "$LOG_FILE" 2>&1 || FAIL
+ cd "$TEST_ROOT/$OBJ"
+ $MAKE mkdir-init > "$LOG_FILE.ramdisk" 2>&1
+ test $? = 0 || {
+ FAIL_LOG "$LOG_FILE.ramdisk"
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
+ }
+ $MAKE $MAKE_OPTS > "$LOG_FILE.ramdisk" 2>&1
+ test $? = 0 || {
+ FAIL_LOG "$LOG_FILE.ramdisk"
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
+ }
+ PASS
+ }
+fi
+
# Prepare the server
case $CHECK_TARGET in
check)
@@ -65,16 +99,28 @@
$TEST_ROOT/$OBJ/subversion/svnserve/svnserve -d \
-r $TEST_ROOT/$OBJ/subversion/tests/clients/cmdline \
>> $LOG_FILE 2>&1
- test $? = 0 || FAIL
+ test $? = 0 || FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
PASS
START "get svnserve pid" "Getting svnserve process ID..."
USER_NAME="`$ID_UN`"
SVNSERVE_PID="`$PS_U $USER_NAME | $GREP '[s]vnserve' \
| $SED -e 's/^ *//' | $CUT -f 1 -d ' ' -s`"
- test -n "$SVNSERVE_PID" || FAIL
+ test -n "$SVNSERVE_PID" || FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
PASS
;;
+ davcheck)
+ START "run $HTTPD" "Running $HTTPD..."
+ $CP_F "$TEST_ROOT/$HTTPD.conf" "$INST_DIR/$HTTPD/conf/httpd.conf" || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
+ $CP_F "$TEST_ROOT/mod_dav_svn_$BUILD_TYPE.conf" "$INST_DIR/$HTTPD/conf/mod_dav_svn.conf" || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
+ "$INST_DIR/$HTTPD/bin/apachectl" start \
+ >> $LOG_FILE 2>&1
+ test $? = 0 || FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
+ PASS
+ CHECK_ARGS="$RA_DAV_CHECK_ARGS"
+ ;;
esac
# Kill the server
@@ -85,17 +131,32 @@
;;
svncheck)
START "kill svnserve" "Stopping svnserve..."
- $KILL $SVNSERVE_PID || FAIL
+ $KILL $SVNSERVE_PID || FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
PASS
;;
+ davcheck)
+ START "kill $HTTPD" "Stopping $HTTPD..."
+ "$INST_DIR/$HTTPD/bin/apachectl" stop || \
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
+ PASS
+ ;;
esac
+
+ umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
}
# Test
START "make $CHECK_TARGET" "Testing $RA_TYPE..."
CHECK_LOG_FILE="$TEST_ROOT/LOG_svn_check_${BUILD_TYPE}_${RA_TYPE}"
cd $TEST_ROOT/$OBJ
-$MAKE $CHECK_TARGET > $CHECK_LOG_FILE 2>&1
+if test $CHECK_TARGET == davcheck ;
+then
+ # At the moment we can't give repository url with
+ # make davcheck, so use check & BASE_URL here for the present
+ $MAKE check "$CHECK_ARGS" > $CHECK_LOG_FILE 2>&1
+else
+ $MAKE $CHECK_TARGET > $CHECK_LOG_FILE 2>&1
+fi
test $? = 0 || {
FAIL_LOG $CHECK_LOG_FILE
$CP "tests.log" "$LOG_FILE_PREFIX.log.$BUILD_TYPE.$RA_TYPE.$REV.failed" \
@@ -108,3 +169,4 @@
PASS
kill_svnserve
+
Index: tools/test-scripts/svntest/svntest-config.sh
===================================================================
--- tools/test-scripts/svntest/svntest-config.sh (revision 7624)
+++ tools/test-scripts/svntest/svntest-config.sh (working copy)
@@ -3,16 +3,42 @@
#
# Root of the test tree
#
-TEST_ROOT="/home/brane/svn"
+TEST_ROOT="/data/svntest"
+# Installation path, everything under that is considered
+# to be temporary
+INST_DIR="$TEST_ROOT/inst"
+
#
-# Repository paths
+# Repository paths and projects name
#
-SVN_REPO="$TEST_ROOT/repo"
-APR_REPO="$TEST_ROOT/apr"
-APU_REPO="$TEST_ROOT/apr-util"
-HTTPD_REPO="$TEST_ROOT/httpd-2.0"
+# installation paths are expected to be:
+# '$INST_DIR/<proj_name>, so take care of your
+# config.<proj_name> files.
+# Everything in those directories will be wiped out
+# by installation procedure. See svntest-rebuild-generic.sh
+SVN="svn"
+SVN_REPO="$TEST_ROOT/$SVN"
+
+APR="apr-0.9"
+APR_REPO="$TEST_ROOT/$APR"
+
+APU="apr-util-0.9"
+APU_REPO="$TEST_ROOT/$APU"
+
+HTTPD="httpd-2.0"
+HTTPD_REPO="$TEST_ROOT/$HTTPD"
+
+
+MAKE_OPTS="-j4"
+
+# RAMDISK=<yes|no>
+RAMDISK=no
+
+# This should correspond with your httpd Listen directive
+RA_DAV_CHECK_ARGS="BASE_URL=http://localhost:42024"
+
#
# Log file name prefix
#
@@ -21,7 +47,7 @@
#
# Configure script prefix and object directory names
#
-CONFIG_PREFIX="config.solaris"
+CONFIG_PREFIX="config"
OBJ_STATIC="obj-st"
OBJ_SHARED="obj-sh"
@@ -36,40 +62,47 @@
#
# Path to utilities
#
-BIN="/usr/bin"
+BIN="/bin"
+USRBIN="/usr/bin"
LOCALBIN="/usr/local/bin"
+OPTBIN="/opt/bin"
# Statically linked svn binary (used for repository updates)
-SVN="$TEST_ROOT/inst/bin/svn"
+SVNBIN="$TEST_ROOT/static/bin/svn"
# CVS binary (used for updating APR & friends)
-CVS="$LOCALBIN/cvs"
+CVS="$USRBIN/cvs"
# Path to config.guess (used for generating the mail subject line)
-GUESS="/usr/local/share/libtool/config.guess"
+GUESS="/usr/share/libtool/config.guess"
# Path to sendmail
-SENDMAIL="/usr/lib/sendmail"
+SENDMAIL="/usr/sbin/sendmail"
# Other stuff
-BASE64_E="$BIN/base64 -e - -"
+BASE64_E="$OPTBIN/base64 -e - -"
CAT="$BIN/cat"
-CP="$BIN/cp"
-CP_F="$BIN/cp -f"
-CUT="$BIN/cut"
+CP="$USRBIN/cp"
+CP_F="$USRBIN/cp -f"
+CUT="$USRBIN/cut"
+DATE="$BIN/date"
GREP="$BIN/grep"
GZIP_C="$BIN/gzip -9c"
-ID_UN="$BIN/id -un"
-KILL="$BIN/kill"
-MAKE="$LOCALBIN/make"
-MKDIR="$BIN/mkdir"
-NICE="$BIN/nice"
-PS_U="$TOPBIN/ps -u"
+ID_UN="$USRBIN/id -un"
+KILL="$USRBIN/kill"
+MAKE="$USRBIN/make"
+MKDIR="$USRBIN/mkdir"
+MKDIR_P="$USRBIN/mkdir -p"
+MOUNT="$BIN/mount"
+NICE="$USRBIN/nice"
+PS_U="$BIN/ps -u"
RM="$BIN/rm"
RM_F="$BIN/rm -f"
RM_RF="$BIN/rm -rf"
-SED="$BIN/sed"
-TAIL="$BIN/tail"
+SED="$USRBIN/sed"
+TAIL_100="$USRBIN/tail -n 100"
+TOUCH="$BIN/touch"
+UMOUNT="$BIN/umount"
#
# Helper functions
@@ -85,7 +118,7 @@
# Test failed
FAIL() {
echo "FAIL: $TST" >> $LOG_FILE
- test -n "$1" && eval "$1" # Run cleanup code
+ test -n "$1" && eval "$1" "$@" # Run cleanup code
exit 1
}
@@ -98,7 +131,7 @@
FAIL_LOG() {
echo >> $LOG_FILE
echo "Last 100 lines of the log file follow:" >> $LOG_FILE
- $TAIL -100 "$1" >> $LOG_FILE 2>&1
+ $TAIL_100 "$1" >> $LOG_FILE 2>&1
if [ "x$REV" = "x" ]
then
SAVED_LOG="$1.failed"
@@ -108,3 +141,37 @@
$CP "$1" "$SAVED_LOG" >> $LOG_FILE 2>&1
echo "Complete log saved in $SAVED_LOG" >> $LOG_FILE
}
+
+# Mount ramdisk conditionally
+# check that
+# i) RAMDISK is defined
+# ii) Ramdisk isn't already mounted
+mount_ramdisk() {
+ local mount_dir="$1"
+ if test "xyes" == "x$RAMDISK";
+ then
+ test -z "$mount_dir" && return 1
+
+ test -f "$mount_dir/.ramdisk" && {
+ echo "Warning: ramdisk exists"
+ return 0
+ }
+
+ $MOUNT "$mount_dir" || return 1
+ $TOUCH "$mount_dir/.ramdisk" || return 1
+ fi
+ return 0
+}
+
+umount_ramdisk() {
+ local mount_dir="$1"
+ if test "xyes" == "x$RAMDISK";
+ then
+ test -z "$mount_dir" && return
+
+ test -f "$mount_dir/.ramdisk" && {
+ $UMOUNT "$mount_dir" >> /dev/null 2>&1
+ }
+ fi
+}
+
Index: tools/test-scripts/svntest/svntest-rebuild.sh
===================================================================
--- tools/test-scripts/svntest/svntest-rebuild.sh (revision 7624)
+++ tools/test-scripts/svntest/svntest-rebuild.sh (working copy)
@@ -9,7 +9,7 @@
# Compute local vars
LOG_FILE="$LOG_FILE_PREFIX.$BUILD_TYPE"
BUILD="`$GUESS` $BUILD_TYPE"
-REV="`$SVN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
+REV="`$SVNBIN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
# Initialize the log file
echo "BUILD: Revision $REV on $BUILD" >> $LOG_FILE
@@ -28,8 +28,10 @@
# Create the object directory
START "create object directory" "Creating object directory..."
-$RM_RF $TEST_ROOT/$OBJ >> $LOG_FILE 2>&1 || FAIL
-$MKDIR $TEST_ROOT/$OBJ >> $LOG_FILE 2>&1 || FAIL
+$RM_RF "$TEST_ROOT/$OBJ" >> $LOG_FILE 2>&1 || FAIL
+$MKDIR "$TEST_ROOT/$OBJ" >> $LOG_FILE 2>&1 || FAIL
+$MKDIR_P "$TEST_ROOT/$OBJ/subversion/tests" >> $LOG_FILE 2>&1 || FAIL
+mount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests" >> $LOG_FILE 2>&1 || FAIL
PASS
# Configure
@@ -43,16 +45,29 @@
> "$TEST_ROOT/LOG_svn_configure_$BUILD_TYPE" 2>&1
test $? = 0 || {
FAIL_LOG "$TEST_ROOT/LOG_svn_configure_$BUILD_TYPE"
- FAIL
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
}
PASS
# Build
START "build" "Building..."
cd $TEST_ROOT/$OBJ
-$MAKE > "$TEST_ROOT/LOG_svn_build_$BUILD_TYPE" 2>&1
+$MAKE $MAKE_OPTS > "$TEST_ROOT/LOG_svn_build_$BUILD_TYPE" 2>&1
test $? = 0 || {
FAIL_LOG "$TEST_ROOT/LOG_svn_build_$BUILD_TYPE"
- FAIL
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
}
PASS
+
+
+# Install (bc mod_dav_svn.so)
+START "install" "Installing..."
+cd $TEST_ROOT/$OBJ
+$RM_RF "$INST_DIR/$SVN"
+$MAKE install > "$TEST_ROOT/LOG_svn_install_$BUILD_TYPE" 2>&1
+test $? = 0 || {
+ FAIL_LOG "$TEST_ROOT/LOG_svn_build_$BUILD_TYPE"
+ FAIL umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
+}
+PASS
+
Index: tools/test-scripts/svntest/svntest-sendmail.sh
===================================================================
--- tools/test-scripts/svntest/svntest-sendmail.sh (revision 7624)
+++ tools/test-scripts/svntest/svntest-sendmail.sh (working copy)
@@ -11,7 +11,7 @@
# Compute local vars
LOG_FILE="$LOG_FILE_PREFIX.$BUILD_TYPE"
TEST="`$GUESS` $BUILD_TYPE"
-REV="`$SVN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
+REV="`$SVNBIN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
test -z "$RA_TYPE" || {
LOG_FILE="$LOG_FILE.$RA_TYPE"
TEST="$TEST $RA_TYPE"
Index: tools/test-scripts/svntest/README
===================================================================
--- tools/test-scripts/svntest/README (revision 7624)
+++ tools/test-scripts/svntest/README (working copy)
@@ -3,21 +3,72 @@
1) Read the INSTALL (http://svn.collab.net/repos/svm/trunk/INSTALL)
file, especially the sections about bootstrapping from a tarball
- and getting the latest APR, APR-UTIL and httpd-2.0 sources.
- Check out and compile the latest Subversion.
+ and getting the latest APR-0.9, APR-UTIL-0.9 and httpd-2.0 sources.
+ Check out and compile the latest Subversion. You could easily run
+ svntest.sh against APR/APR-UTIL 1.0 and HTTPD 2.1 branches, just
+ checkout corresponding repositories, and edit svntest-config.sh.
2) Copy the svntest scripts from trunk/tools/test-scripts/svntest to
somewhere outside the repository. Then read and modify
svntest-config.sh to reflect your local installation. Take special
- care about program locations and e-mail addresses.
+ care about program locations, program installation locations and
+ e-mail addresses.
+ Also notice that this test script will wipe out following paths
+ during rebuilding:
+ $INST_DIR/<proj_name>, ie. with present configuration the paths are:
+ /home/brane/svn/inst/{apr-0.9,apr-util-0.9,httpd-2.0,svn}
+
3) Create one or more scripts that configure Subversion in different
ways (e.g., configure.shared, configure.static). Here's the script
I'm using for static builds on Solaris 7:
- #!/bin/sh
- env CC='gcc' \
- "../repo/configure" \
+ config.apr-0.9:
+ #!/bin/sh
+
+ "../apr-0.9/configure" \
+ "--prefix=/home/brane/svn/inst/apr-0.9" \
+ "--with-pic" \
+ "$@"
+
+
+ config.apr-util-0.9:
+ #!/bin/sh
+
+ "../apr-util-0.9/configure" \
+ "--prefix=/home/brane/svn/inst/apr-util-0.9" \
+ "--with-apr=/home/brane/svn/inst/apr-0.9" \
+ "--with-pic" \
+ "--with-dbm=db4" \
+ "--with-berkeley-db" \
+ "--with-expat=/usr" \
+ "$@"
+
+
+ config.httpd-2.0:
+ #!/bin/sh
+
+ CURR_WD="`pwd`"
+ cd ../httpd-2.0
+
+ "./buildconf" \
+ "--with-apr=/home/brane/svn/apr-0.9" \
+ "--with-apr-util=/home/brane/svn/apr-util-0.9"
+
+ cd "$CURR_WD"
+
+ "../httpd-2.0/configure" \
+ "--prefix=/home/brane/svn/inst/httpd-2.0" \
+ "--with-apr=/home/brane/svn/inst/apr-0.9/bin/apr-config" \
+ "--with-apr-util=/home/brane/svn/inst/apr-util-0.9/bin/apu-config" \
+ "--enable-dav" \
+ "$@"
+
+
+ config.solaris.static (for subversion):
+ #!/bin/sh
+ env CC='gcc' \
+ "../svn/configure" \
"--prefix=/home/brane/svn/inst" \
"--with-berkeley-db=/home/brane/svn/db4" \
"--disable-shared" \
@@ -27,13 +78,65 @@
static build types, but you can easily change that. If you do, also
change svntest.sh so that it tests all the different configurations.
-4) Make sure your environment (e.g., LD_LIBRARY_PATH) is set correctly
+4) Tailor your $HTTPD.conf (ie. httpd-2.0.conf) to suit
+ your needs, (easiest way to get a template for http-2.0.conf is
+ install Apache httpd at once, and after that copy installed httpd.conf, and
+ edit it). Things to change are probably:
+ i) Listen 127.0.0.1:42024
+ ii) LoadModule dav_svn_module modules/mod_dav_svn.so
+ iii) User jaa
+ Group jaa
+ v) ServerName localhost:42024
+
+ vi) Add mod_dav_svn block:
+
+ <IfModule mod_dav_svn.c>
+ Include conf/mod_dav_svn.conf
+ </IfModule>
+
+ vii) mod_dav_svn_shared.conf for shared builds:
+ <Location /repositories>
+ DAV svn
+ SVNParentPath /home/brane/svn/obj-sh/subversion/tests/clients/cmdline/repositories
+ </Location>
+ <Location /local_tmp/repos>
+ DAV svn
+ SVNPath /home/brane/svn/obj-sh/subversion/tests/clients/cmdline/local_tmp/repos
+ </Location>
+
+ mod_dav_svn_static.conf for static builds:
+ <Location /repositories>
+ DAV svn
+ SVNParentPath /home/brane/svn/obj-st/subversion/tests/clients/cmdline/repositories
+ </Location>
+ <Location /local_tmp/repos>
+ DAV svn
+ SVNPath /home/brane/svn/obj-st/subversion/tests/clients/cmdline/local_tmp/repos
+ </Location>
+
+ Don't ever thouch config files under $INST_DIR/$HTTPD/conf, they will be overwritten by
+ the script.
+
+5) Make sure your environment (e.g., LD_LIBRARY_PATH) is set correctly
to find Berkeley DB, etc.
-5) Run svntest.sh to get the latest versions of ARP, APR-UTIL and
- Subversion, build and test all the configurations. Note that the
- scripts do not test Apache integration (yet).
+6) If you like run test against ramdisk (subversion test data will be held on ramdisk)
+ then you shuold have something like that in your /etc/fstab (in Linux system):
+ tmpfs /home/brane/svn/obj-sh/subversion/tests tmpfs defaults,user,noauto,exec,size=600m
+ tmpfs /home/brane/svn/obj-st/subversion/tests tmpfs defaults,user,noauto,exec,size=600m
+
+ and you should set RAMDISK=yes, and check mount_ramdisk and umount_ramdisk in same file.
+ See http://subversion.tigris.org/project_faq.html#ramdisk-tests for further information.
+
+7) Run svntest.sh to get the latest versions of ARP, APR-UTIL, HTTPPD and
+ Subversion, build and test all the configurations.
+8) If you like force rebuilding of some component, you could do:
+ echo "1" > $PROJ_REPO.rb, dependies are:
+ apr-util depends of apr, and httpd depends of apr and apr-util.
+ Any dependent project will be also rebuild.
+ When you run this script first time, everything will be rebuild
+ automatically.
======================================================
Need more detailed instructions? Use the Source, Luke!
--
Jani Averbach
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 4 01:35:32 2003