COMMAND=$(basename $0)
# default values, tunable with command-line options
-DEFAULT_FCDISTRO=f7
+DEFAULT_FCDISTRO=f8
DEFAULT_PLDISTRO=planetlab
DEFAULT_PERSONALITY=linux32
DEFAULT_BASE="@DATE@--@PLDISTRO@-@FCDISTRO@-@PERSONALITY@"
TESTBOX=onelab-test.inria.fr
TESTBOXSSH=root@onelab-test.inria.fr
TESTSVNPATH="http://svn.planet-lab.org/svn/tests/trunk/system/"
-TESTSCRIPT=TestMain.py
####################
# assuming vserver runs in UTC
DATE=$(date +'%Y.%m.%d')
m_installing_any=re.compile('\r (Installing:[^\]]*]) ')
m_installing_err=re.compile('\r (Installing:[^\]]*])(..+)')
m_installing_end=re.compile('Installed:.*')
-m_installing_doc=re.compile("(.*)install-info: No such file or directory for /usr/share/info/\S+(.*)")
+m_installing_doc1=re.compile("(.*)install-info: No such file or directory for /usr/share/info/\S+(.*)")
+m_installing_doc2=re.compile("(.*)grep: /usr/share/info/dir: No such file or directory(.*)")
-def scan_log (filename):
+def summary (filename):
try:
if filename=="-":
echo=False
for line in f.xreadlines():
# first off : discard warnings related to doc
- if m_installing_doc.match(line):
- (begin,end)=m_installing_doc.match(line).groups()
+ if m_installing_doc1.match(line):
+ (begin,end)=m_installing_doc1.match(line).groups()
+ line=begin+end
+ if m_installing_doc2.match(line):
+ (begin,end)=m_installing_doc2.match(line).groups()
line=begin+end
# unconditionnally show these lines
if m_show_line.match(line):
- print line,
+ print '>>>',line,
# an 'installing' line with messages afterwards : needs to be echoed
elif m_installing_err.match(line):
(installing,error)=m_installing_err.match(line).groups()
- print installing
- print error
+ print '>>>',installing
+ print '>>>',error
echo=True
# closing an 'installing' section
elif m_installing_end.match(line):
elif m_installing_any.match(line):
if echo:
installing=m_installing_any.match(line).group(1)
- print installing
+ print '>>>',installing
echo=False
# print lines when echo is true
else:
- if echo: print line,
+ if echo: print '>>>',line,
f.close()
except:
print 'Failed to analyze',filename
for arg in sys.argv[1:]:
- scan_log(arg)
+ summary(arg)
EOF
echo "******************** END SUMMARY"
}
summary $LOG >> ${WEBLOG}
(echo -n "============================== $COMMAND: failure at " ; date ; tail -c 20k $WEBLOG) > ${WEBLOG}.ko
if [ -n "$MAILTO" ] ; then
- tail -c 20k ${WEBPATH}/${BASE}.log.txt | mail -s "Failures for build ${BASE}" $MAILTO
+ tail -c 20k ${WEBLOG} | mail -s "Failures for build ${BASE}" $MAILTO
fi
exit 1
}
summary $LOG >> ${WEBLOG}
touch ${WEBLOG}.ok
if [ -n "$MAILTO" ] ; then
- (echo "$PLDISTRO ($BASE) build for $FCDISTRO completed on $(date)" ) | mail -s "Successfull build for ${BASE}" $MAILTO
+ (echo "$PLDISTRO ($BASE) build for $FCDISTRO completed on $(date)" ) | mail -s "Successful build for ${BASE}" $MAILTO
fi
exit 0
}
show_env
echo "Running make IN $(pwd)"
+
+ # stuff our own variable settings
+ MAKEVARS=("PLDISTRO=${PLDISTRO}" "${MAKEVARS[@]}")
+ MAKEVARS=("PLDISTROTAGS=${PLDISTROTAGS}" "${MAKEVARS[@]}")
+ MAKEVARS=("NIGHTLY_BASE=${BASE}" "${MAKEVARS[@]}")
+ MAKEVARS=("NIGHTLY_PERSONALITY=${PERSONALITY}" "${MAKEVARS[@]}")
+
# stage1
- make -C /build "${MAKEOPTS[@]}" PLDISTROTAGS=${PLDISTROTAGS} PLDISTRO=${PLDISTRO} "${MAKEVARS[@]}" stage1=true
+ make -C /build $DRY_RUN "${MAKEVARS[@]}" stage1=true
# versions
- make -C /build "${MAKEOPTS[@]}" PLDISTROTAGS=${PLDISTROTAGS} PLDISTRO=${PLDISTRO} "${MAKEVARS[@]}" NIGHTLY_BASE=${BASE} versions
+ make -C /build $DRY_RUN "${MAKEVARS[@]}" versions
# actual stuff
- make -C /build "${MAKEOPTS[@]}" PLDISTROTAGS=${PLDISTROTAGS} PLDISTRO=${PLDISTRO} "${MAKEVARS[@]}" $MAKETARGETS
+ make -C /build $DRY_RUN "${MAKEVARS[@]}" $MAKETARGETS
}
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 myplc-init-vserver.sh
- ssh 2>&1 ${TESTBOXSSH} python -u ${testdir}/${TESTSCRIPT} --build ${SVNPATH} --url ${url} --all
+ # 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} --all
# still missing - need to populate /var/www/html/install-rpms on the myplc
if [ "$?" != 0 ] ; then
echo BASE=$BASE
echo SVNPATH=$SVNPATH
echo MAKEVARS="${MAKEVARS[@]}"
- echo MAKEOPTS="${MAKEOPTS[@]}"
+ echo DRY_RUN="$DRY_RUN"
echo PLDISTROTAGS="$PLDISTROTAGS"
echo TAGSRELEASE="$TAGSRELEASE"
echo -n "(might be unexpanded)"
# parse arguments
MAKEVARS=()
- MAKEOPTS=()
+ DRY_RUN=
DO_BUILD=true
DO_TEST=true
while getopts "nf:d:b:p:t:r:s:om:a:w:BTvh7" opt ; do
case $opt in
- n) DRY_RUN="true" ; MAKEOPTS=(${MAKEOPTS[@]} -n) ;;
+ n) DRY_RUN="-n" ;;
f) FCDISTRO=$OPTARG ;;
d) PLDISTRO=$OPTARG ;;
p) PERSONALITY=$OPTARG ;;