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="main 1vnodes 1testbox32"
-DEFAULT_TESTCONFIG64="main 1vnodes 1testbox64"
+# TESTSVNPATH to be computed from the -tags.mk file - no default anymore
+DEFAULT_TESTCONFIG="default"
DEFAULT_IFNAME=eth0
# web publishing results
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
}
mkdir -p ${WEBPATH}
cp $LOG ${WEBLOG}
summary $LOG >> ${WEBLOG}
- if [ -n "DO_TEST"] ; then
+ if [ -n "$DO_TEST" ] ; then
echo "Successfully built and tested - see testlogs for details" > ${WEBLOG}.pass
rm -f ${WEBLOG}.ok
else
make -C /build $DRY_RUN "${MAKEVARS[@]}" stage1=true
# versions
make -C /build $DRY_RUN "${MAKEVARS[@]}" versions
+ # store testsvnpath
+ make -C /build $DRY_RUN "${MAKEVARS[@]}" stage1=true testsvnpath
# actual stuff
make -C /build $DRY_RUN "${MAKEVARS[@]}" $MAKETARGETS
echo -n "============================== Starting $COMMAND:runtest on $(date)"
- ### the URL to the myplc package
- rpm=$( find /vservers/$BASE/build/RPMS -name 'myplc-[0-9]*' )
- if [ ${#rpm[@]} != 1 ] ; then
- echo "$COMMAND: Cannot locate rpm for testing"
+ # where to find TESTSVNPATH
+ stamp=/vservers/$BASE/build/testsvnpath
+ if [ ! -f $stamp ] ; then
+ echo "$COMMAND: Cannot figure TESTSVNPATH from missing $stamp"
+ failure
+ exit 1
+ fi
+ TESTSVNPATH=$(cat $stamp)
+ # use only this pat of the tests right now
+ TESTSVNPATH=${TESTSVNPATH}/system
+
+ ### the URL to the RPMS/<arch> location
+ url=""
+ for a in i386 x86_64; do
+ archdir=/vservers/$BASE/build/RPMS/$a
+ if [ -d $archdir ] ; then
+ url=$(echo $archdir | sed -e "s,/vservers/$BASE/build,${TESTBUILDURL}${PLDISTRO}/${BASE},")
+ break
+ fi
+ done
+
+ if [ -z "$url" ] ; then
+ echo "$COMMAND: Cannot locate arch URL for testing"
failure
exit 1
fi
- url=$(echo $rpm | sed -e "s,/vservers/$BASE/build,${TESTBUILDURL}${PLDISTRO}/${BASE},")
- # compute test directory name on test box
- testdir=chroot-${BASE}
- # use another name if any config contains vserver
- echo $TESTCONFIG | grep vserver &> /dev/null && testdir=vserver-${BASE}
+ # test directory name on test box
+ testdir=${BASE}
# clean it
- ssh ${TESTBOXSSH} rm -rf ${testdir}
+ ssh -n ${TESTBOXSSH} rm -rf ${testdir}
# check it out
- ssh ${TESTBOXSSH} svn co ${TESTSVNPATH} ${testdir}
+ ssh -n ${TESTBOXSSH} svn co ${TESTSVNPATH} ${testdir}
# invoke test on testbox - pass url and build url - so the tests can use vtest-init-vserver.sh
configs=""
for config in ${TESTCONFIG} ; do
configs="$configs --config $config"
done
- # proceed despite of set -e
+ # need to proceed despite of set -e
success=true
- ssh 2>&1 ${TESTBOXSSH} ${testdir}/runtest --build ${SVNPATH} --url ${url} $configs --all || success=
+ ssh 2>&1 -n ${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
+ ssh 2>&1 -n ${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
echo " -t pldistrotags - defaults to \${PLDISTRO}-tags.mk"
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"
t) PLDISTROTAGS=$OPTARG ;;
r) TAGSRELEASE=$OPTARG ;;
s) SVNPATH=$OPTARG ;;
- x) TESTSVNPATH=$OPTARG ;;
c) TESTCONFIG="$TESTCONFIG $OPTARG" ;;
w) WEBPATH=$OPTARG ;;
m) MAILTO=$OPTARG ;;
[ -z "$WEBPATH" ] && WEBPATH="$DEFAULT_WEBPATH"
[ -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=""
set -x
echo "XXXXXXXXXX $COMMAND: using existing vserver $BASE" $(date)
show_env
+ # start in case e.g. we just rebooted
+ vserver ${BASE} start || :
# update build
vserver ${BASE} exec svn update /build
else
rm -rf $WEBPATH/$BASE ; mkdir -p $WEBPATH/$BASE/{RPMS,SRPMS}
rsync --archive --delete --verbose /vservers/$BASE/build/RPMS/ $WEBPATH/$BASE/RPMS/
rsync --archive --delete --verbose /vservers/$BASE/build/SRPMS/ $WEBPATH/$BASE/SRPMS/
+ # publish myplc-release
+ rsync --verbose /vservers/$BASE/build/myplc-release $WEBPATH/$BASE
if [ -n "$DO_TEST" ] ; then
runtest
- rsync --archive --delete --verbose /vservers/$BASE/build/testlogs/ $WEBPATH/$BASE/testlogs/
fi
success