add the sendmail function
authorroot <root@41d37cc5-eb28-0410-a9bf-d37491348ade>
Wed, 8 Aug 2007 09:39:31 +0000 (09:39 +0000)
committerroot <root@41d37cc5-eb28-0410-a9bf-d37491348ade>
Wed, 8 Aug 2007 09:39:31 +0000 (09:39 +0000)
scripts/nightly-build.sh

index d4c7f91..38f5057 100755 (executable)
@@ -12,12 +12,12 @@ SVNPATH="svn+ssh://build@svn.one-lab.org/svn/build/trunk"
 DISTRO=onelab
 MAILTO="onelab-build@one-lab.org"
 DISTROMAKETAGS=onelab-tags.mk
-
+PLEBOX=root@planet-lab.eu
 TESTBUILDURL="http://build.one-lab.org/"
 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
 ####################
 # plc chroot runs in UTC
 DATE=$(date -u +'%Y.%m.%d')
@@ -71,7 +71,15 @@ 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
@@ -177,9 +185,10 @@ function main () {
        MAKEOPTS=()
        DO_BUILD=true
        DO_TEST=true
-       while getopts "b:ud:t:r:s:nm:s:BTh" opt ; do
+       while getopts "b:e: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 ;;
@@ -212,6 +221,10 @@ function main () {
        fi
        BUILD=$ROOT/$BASE
        
+       if [ -n "$DO_SEND" ] ; then 
+           test_sendmail  ${BUILD} >> ${BUILD}/log-build.txt 2>&1 
+       fi
+       
        if [ -n "$DO_BUILD" ] ; then 
            build >> ${BUILD}/log-build.txt 2>&1 
            touch ${BUILD}.build-ok