X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vbuild-nightly.sh;h=3b7a186b894651805849da91dae02bb069e1af39;hb=72ea08be6de0f74220e577226e041519094edd0a;hp=88796ca0ca18dfd686cf7c99b26ea6ad0fcca161;hpb=e96e0438f22a90617c6741beea651cb4b8cfc022;p=build.git diff --git a/vbuild-nightly.sh b/vbuild-nightly.sh index 88796ca0..3b7a186b 100755 --- a/vbuild-nightly.sh +++ b/vbuild-nightly.sh @@ -11,8 +11,7 @@ DEFAULT_PERSONALITY=linux32 DEFAULT_BASE="@DATE@--@PLDISTRO@-@FCDISTRO@-@PERSONALITY@" DEFAULT_SVNPATH="http://svn.planet-lab.org/svn/build/trunk" DEFAULT_TESTSVNPATH="http://svn.planet-lab.org/svn/tests/trunk/system/" -DEFAULT_TESTCONFIG32="onelab onelab_testbox32" -DEFAULT_TESTCONFIG64="onelab onelab_testbox64" +DEFAULT_TESTCONFIG="default" DEFAULT_IFNAME=eth0 # web publishing results @@ -99,9 +98,9 @@ function failure() { mkdir -p ${WEBPATH} cp $LOG ${WEBLOG} summary $LOG >> ${WEBLOG} - (echo -n "============================== $COMMAND: failure at " ; date ; tail -c 20k $WEBLOG) > ${WEBLOG}.ko + (echo -n "============================== $COMMAND: failure at " ; date ; tail -c 30k $WEBLOG) > ${WEBLOG}.ko if [ -n "$MAILTO" ] ; then - tail -c 20k ${WEBLOG} | mail -s "Failures for build ${BASE}" $MAILTO + tail -c 30k ${WEBLOG} | mail -s "Failures for build ${BASE}" $MAILTO fi exit 1 } @@ -112,7 +111,12 @@ function success () { mkdir -p ${WEBPATH} cp $LOG ${WEBLOG} summary $LOG >> ${WEBLOG} - touch ${WEBLOG}.ok + if [ -n "$DO_TEST" ] ; then + echo "Successfully built and tested - see testlogs for details" > ${WEBLOG}.pass + rm -f ${WEBLOG}.ok + else + echo "Successfully built"> ${WEBLOG}.ok + fi if [ -n "$MAILTO" ] ; then (echo "$PLDISTRO ($BASE) build for $FCDISTRO completed on $(date)" ) | mail -s "Successful build for ${BASE}" $MAILTO fi @@ -170,16 +174,30 @@ function runtest () { fi url=$(echo $rpm | sed -e "s,/vservers/$BASE/build,${TESTBUILDURL}${PLDISTRO}/${BASE},") - # compute test directory name on test box - testdir=test-${BASE} + # test directory name on test box + testdir=${BASE} # clean it ssh ${TESTBOXSSH} rm -rf ${testdir} # check it out ssh ${TESTBOXSSH} svn co ${TESTSVNPATH} ${testdir} # invoke test on testbox - pass url and build url - so the tests can use vtest-init-vserver.sh - ssh 2>&1 ${TESTBOXSSH} python -u ${testdir}/runtest --build ${SVNPATH} --url ${url} --config "${TESTCONFIG}" --all - - if [ "$?" != 0 ] ; then + configs="" + for config in ${TESTCONFIG} ; do + configs="$configs --config $config" + done + + # need to proceed despite of set -e + success=true + ssh 2>&1 ${TESTBOXSSH} ${testdir}/runtest --build ${SVNPATH} --url ${url} $configs --all || success= + + # gather logs in the vserver + mkdir -p /vservers/$BASE/build/testlogs + ssh 2>&1 ${TESTBOXSSH} tar -C ${testdir}/logs -cf - . | tar -C /vservers/$BASE/build/testlogs -xf - || true + # push them to the build web + rsync --archive --delete /vservers/$BASE/build/testlogs/ $WEBPATH/$BASE/testlogs/ + chmod -R a+r $WEBPATH/$BASE/testlogs/ + + if [ -z "$success" ] ; then failure fi @@ -221,7 +239,7 @@ function usage () { echo " -r tagsrelease - a release number that refers to PLDISTROTAGS - defaults to HEAD" echo " -s svnpath - where to fetch the build module" echo " -x testsvnpath - defaults to $DEFAULT_TESTSVNPATH" - echo " -c testconfig - defaults to $DEFAULT_TESTCONFIG32 or $DEFAULT_TESTCONFIG64" + echo " -c testconfig - defaults to $DEFAULT_TESTCONFIG" echo " -w webpath - defaults to $DEFAULT_WEBPATH" echo " -m mailto - no default" echo " -O : overwrite - re-run in base directory, do not re-create vserver" @@ -286,8 +304,7 @@ function main () { [ -z "$IFNAME" ] && IFNAME="$DEFAULT_IFNAME" [ -z "$SVNPATH" ] && SVNPATH="$DEFAULT_SVNPATH" [ -z "$TESTSVNPATH" ] && TESTSVNPATH="$DEFAULT_TESTSVNPATH" - [ "$PERSONALITY" == linux32 ] && [ -z "$TESTCONFIG" ] && TESTCONFIG="$DEFAULT_TESTCONFIG32" - [ "$PERSONALITY" == linux64 ] && [ -z "$TESTCONFIG" ] && TESTCONFIG="$DEFAULT_TESTCONFIG64" + [ -z "$TESTCONFIG" ] && TESTCONFIG="$DEFAULT_TESTCONFIG" [ -n "$DRY_RUN" ] && MAILTO=""