Fix the testrun function to manage the make install behavior
authorroot <root@41d37cc5-eb28-0410-a9bf-d37491348ade>
Thu, 9 Aug 2007 13:59:21 +0000 (13:59 +0000)
committerroot <root@41d37cc5-eb28-0410-a9bf-d37491348ade>
Thu, 9 Aug 2007 13:59:21 +0000 (13:59 +0000)
scripts/nightly-build.sh

index 38f5057..dd1575e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-
+##export PATH=/usr/sbin:/sbin:/usr/bin:/bin
 # use svn propset svn:keywords Revision to enable this
 REVISION=$(echo '$Revision$' | sed -e 's,\$,,g' -e 's,^\w*:\s,,' )
 
@@ -14,10 +14,11 @@ MAILTO="onelab-build@one-lab.org"
 DISTROMAKETAGS=onelab-tags.mk
 PLEBOX=root@planet-lab.eu
 TESTBUILDURL="http://build.one-lab.org/"
+TESTBOX=onelab-test.inria.fr
 TESTBOXSSH=root@onelab-test.inria.fr
 TESTSVNPATH="svn+ssh://build@svn.one-lab.org/svn/new_plc_api/trunk/plctest"
 TESTSCRIPT=TestMain.py
-TESTSEND=test_sendmail.py
+TESTSEND=TestSendMail
 ####################
 # plc chroot runs in UTC
 DATE=$(date -u +'%Y.%m.%d')
@@ -27,6 +28,7 @@ function do_chroot () {
     chroot /plc/devel/root su - build <<EOF
 $CHROOTBINDIR/$COMMAND $@
 EOF
+
 }
 
 # Notify recipient of failure or success, manage various stamps 
@@ -71,15 +73,8 @@ function use_base () {
        exit 1
     fi
 }
-function test_sendmail(){
-    set -x
-    #under the chroot jail launch an ssh on ple and the script is run there
-    chroot /plc/devel/root/ ssh ${PLEBOX} /root/${TESTSEND} 
-    if [ "$?" != 0 ] ; then
-       failure
-    fi
-    set +x
-}
+
+
 function build () {
     set -x
     set -e
@@ -117,10 +112,15 @@ function runtest () {
     set -e
     trap failure ERR INT
 
+    echo -n"==============================> testing the sendmail service on PLE"
+    #under the chroot jail launch an ssh on ple and the script is run there
+    ssh ${PLEBOX} python -u /root/${TESTSEND} 
+
     echo -n "============================== Starting $COMMAND:runtest on "
     date
     
-  ### compute URL to the myplc package
+
+    ### compute URL to the myplc package
     build=$1; shift
     buildname=$(basename $build)
     cd $build
@@ -135,9 +135,10 @@ function runtest () {
     rsync -a -v plctest/ ${TESTBOXSSH}:${testdir}
   # invoke test on testbox
     ssh ${TESTBOXSSH} python -u ${testdir}/${TESTSCRIPT} ${url} 
-  #invoke make install from build to the testbox
-  ## (echo "cd build/${DISTRO}/${buildname}/ &&  make install PLCHOST=${TESTBOXSSH}") | chroot /plc/devel/root
-    if [ "$?" != 0 ] ; then
+   #invoke make install from build to the testbox
+    make install PLCHOST=${TESTBOX}
+       
+  if [ "$?" != 0 ] ; then
        failure
     fi
 
@@ -185,10 +186,9 @@ function main () {
        MAKEOPTS=()
        DO_BUILD=true
        DO_TEST=true
-       while getopts "b:e:ud:t:r:s:nm:s:BTh" opt ; do
+       while getopts "b:ud:t:r:s:nm:s:BTh" opt ; do
            case $opt in
                b) BASE=$OPTARG ;;
-               e) DO_SEND= ;;
                u) USEOLD=true ;;
                d) DISTRO=$OPTARG ;;
                t) DISTROMAKETAGS=$OPTARG ;;