diff -uNr build_farm.org/build_test build_farm/build_test --- build_farm.org/build_test Fri Jun 22 19:05:01 2001 +++ build_farm/build_test Fri Mar 26 11:05:32 2004 @@ -7,8 +7,22 @@ # we used a fixed path that is a superset of the required paths. export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/usr/sbin:/usr/local/sbin -# go to our main directory -cd ~/build_farm || exit 1 +if [ -z $1 ] || [ $1 = "all" ]; then + rebuild="yes" + noclean="no" + actions="configure build install test" +elif [ $1 = "build" ]; then + rebuild="yes" + noclean="yes" + actions="configure build install" +elif [ $1 = "test" ]; then + rebuild="no" + noclean="yes" + actions="test" +else + echo "Usage: build_test (all|build|test)" + exit 1 +fi ( @@ -18,20 +32,9 @@ # we only want the short name of the host - use cut for portability host=`hostname | cut -d. -f1` - # make sure the password isn't readable by anyone - chmod 600 .password - - # grab the latest versions of the scripts - rsync --timeout=200 -q -az samba.org::build_farm/*.fns . - # load general functions . build_test.fns - if [ -f $host.fns ]; then - # load host specific functions - . $host.fns - else - . generic.fns - fi + . generic.fns ) >> build.log 2>&1 diff -uNr build_farm.org/build_test.fns build_farm/build_test.fns --- build_farm.org/build_test.fns Fri Nov 7 22:20:50 2003 +++ build_farm/build_test.fns Fri Mar 26 11:05:48 2004 @@ -7,58 +7,6 @@ # Copyright (C) 2001, 2003 by Martin Pool -############################# -# build a signature of a tree, used to see if we -# need to rebuild -sum_tree() { - sum_tree_test_root=$1 - sum_tree_tree=$2 - sum_tree_testsuite=$3 - sum_tree_sum=$4 - find $sum_tree_test_root/$sum_tree_tree -type f -print | xargs sum > $sum_tree_sum - sum build_test build_test.fns >> $sum_tree_sum - - if [ -f "$host.fns" ]; then - sum $host.fns >> $sum_tree_sum - fi - - if [ -d "$sum_tree_testsuite" ]; then - find $sum_tree_test_root/$sum_tree_testsuite -type f -print | xargs sum >> $sum_tree_sum - fi -} - -############################# -# send the logs to the master site -send_logs() { - if [ "$nologreturn" = "yes" ]; then - echo "skipping log transfer" - else - log="$1" - err="$2" - chmod 0644 "$log" "$err" - rsync -q --password-file=.password -atz --timeout=200 \ - "$log" "$err" $host@samba.org::build_farm_data/ - fi -} - -############################ -# fetch the latest copy of the tree -fetch_tree() { - if [ "$norsync" = "yes" ]; then - echo "skipping tree transfer" - else - tree=$1 - if rsync -q --partial --timeout=200 -az --delete --ignore-errors \ - ftp.samba.org::ftp/unpacked/$tree $test_root; then - echo "transferred $tree OK" - else - echo "transfer of $tree failed code $?" - return 1 - fi - fi - return 0 -} - ############################ # grab a lock file. Not atomic, but close :) # tries to cope with NFS @@ -111,6 +59,10 @@ echo CC="$compiler" ./configure $config_and_prefix CC="$compiler" export CC + if [ -f "configure" ]; then + rm -f ./configure + fi + ./autogen.sh ./configure $config_and_prefix cstatus=$? echo "CONFIGURE STATUS: $cstatus" @@ -148,12 +100,15 @@ # install the tree action_install() { if [ -d $prefix ]; then - if [ "$noclean" != "yes" ]; then + if [ "$rebuild" != "yes" ]; then rm -rf $prefix fi fi do_make install + if [ -d $test_root/$tree/$testsuite/script ]; then + chmod +x $test_root/$tree/$testsuite/script/* + fi istatus=$? echo "INSTALL STATUS: $istatus" return $istatus; @@ -169,8 +124,10 @@ case "$tree" in samba*) - /bin/rm -rf $prefix/lib - mkdir $prefix/lib + /bin/rm -rf "$prefix/lib/smb.conf*" "$prefix/lib/username.map" "$prefix/lib/lmhosts" + if [ ! -d $prefix/lib ]; then + mkdir $prefix/lib + fi ;; esac @@ -196,7 +153,6 @@ ) tstatus=$? if [ $tstatus != 0 ]; then - FAILED_TESTS="$FAILED_TESTS $test" echo "=========================================" echo "TEST FAILED: $test (status $?)" echo "=========================================" @@ -226,6 +182,11 @@ rm -f $logfile fi + echo "" >> $report + echo "--==--==--==--==--==--==--==--==--==--==--" >> $report + echo " Test Results" >> $report + echo "--==--==--==--==--==--==--==--==--==--==--" >> $report + testdir="$prefix/testdir" runlist_file="$test_root/$tree/$testsuite/runlist" @@ -236,23 +197,36 @@ . $test_root/$tree/$testsuite/runlist testhost=TEST_$host -# testlist=${!testhost} + testlist=${!testhost} if [ "$testlist" = "" ]; then testlist=$TEST_ALL fi tstatus=0 + totaltest=0 + totalsuccess=0 totalfailed=0 loglevel=1 for test in $testlist; do each_test $test; + totaltest=`expr $totaltest + 1`; if [ $tstatus != 0 ]; then + FAILED_TESTS="$FAILED_TESTS $test" + echo -e " $test\t: FAIL" >> $report totalfailed=`expr $totalfailed + 1`; loglevel=10 each_test $test loglevel=1 + else + echo -e " $test\t: SUCCESS" >> $report + totalsuccess=`expr $totalsuccess + 1`; fi done + echo "" >> $report + echo -e "TOTAL TESTS: \t$totaltest" >> $report + echo -e "TOTAL SUCCEEDED:\t$totalsuccess" >> $report + echo -e "TOTAL FAILED: \t$totalfailed" >> $report + echo "" >> $report echo "contents of $logfile:" cat $logfile echo "FAILED TESTS: $FAILED_TESTS" @@ -310,21 +284,19 @@ test_root=`pwd` fi + report="$test_root/brief_report" + if [ -f "$report" ]; then + rm -f "$report" + fi + log="build.$tree.$host.$compiler.log" err="build.$tree.$host.$compiler.err" - sum="build.$tree.$host.$compiler.sum" lck="$test_root/build.$tree.lck" if ! lock_file "$lck"; then return fi - # pull the tree - if ! fetch_tree "$tree"; then - unlock_file "$lck" - return - fi - if [ ! $USER = "" ]; then whoami=$USER else @@ -356,24 +328,11 @@ config_and_prefix="$config --prefix=$prefix" - # see if we need to rebuild - sum_tree $test_root $tree $testsuite $sum - echo "CFLAGS=$CFLAGS $config_and_prefix" >> $sum - - if cmp "$sum" "$sum.old" > /dev/null; then - touch "$log" "$err" - send_logs "$log" "$err" - unlock_file "$lck" - return - fi - - # we do need to rebuild - save the old sum - /bin/rm -f $sum.old - mv $sum $sum.old + date > $report + echo "" >> $report + uname -a >> $report - actions="$*" - - if [ "$actions" = "" ]; then + if [ "$*" = "" -a "$actions" = "" ]; then actions="configure build install test" fi @@ -392,7 +351,10 @@ ( action_$action ) if [ $? != 0 ]; then echo "ACTION FAILED: $action"; + echo "ACTION FAILED: $action" >> $report break; + else + echo "ACTION SUCCEEDED $action" >> $report fi done @@ -406,9 +368,6 @@ date ) > "$log" 2> "$err" - # send the logs to the master site - send_logs "$log" "$err" - # cleanup unlock_file "$lck" } diff -uNr build_farm.org/generic.fns build_farm/generic.fns --- build_farm.org/generic.fns Fri Nov 7 22:20:49 2003 +++ build_farm/generic.fns Fri Mar 26 11:05:32 2004 @@ -1,7 +1 @@ -test_tree samba4 source gcc test_tree samba source gcc -test_tree samba_2_2 source gcc -test_tree samba_3_0 source gcc -test_tree rsync . gcc -test_tree distcc . gcc -test_tree ccache . gcc