first attempt to reenable tests
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 12 Nov 2007 13:58:01 +0000 (13:58 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 12 Nov 2007 13:58:01 +0000 (13:58 +0000)
scripts/nightly-build-vserver.sh

index 04970ed..c5095be 100755 (executable)
@@ -15,7 +15,6 @@ DEFAULT_MAILTO_onelab="onelab-build@one-lab.org"
 
 # web publishing results
 WEBPATH=/build/@PLDISTRO@/@BASE@
-WEBLOG=/build/@PLDISTRO@/@BASE@.txt
 
 # for the test part
 TESTBUILDURL="http://build.one-lab.org/"
@@ -86,10 +85,16 @@ function runtest () {
     echo -n "============================== Starting $COMMAND:runtest on "
     date
     
-    ### compute URL to the myplc package
-    cd /build
-    rpm=$(find RPMS -name myplc\*.rpm )
+    ### the URL to the myplc package
+    cd /build/RPMS/i386
+    rpm=$(ls myplc-[0-9]*.rpm)
+    if [ ${#rpm} != 1 ] ; then
+       echo "Cannot locate rpm for testing"
+       exit 1
+    fi
     url=${TESTBUILDURL}${PLDISTRO}/${BASE}/${rpm}
+    
+    cd /build
   ### checkout the test material
     svn co ${TESTSVNPATH} plctest
   # compute test directory name on test box
@@ -274,33 +279,34 @@ function main () {
        LOG=$LOG2
 
        echo "XXXXXXXXXX $COMMAND: preparation of vserver $BASE done" $(date)
-       cp $COMMANDPATH /vservers/${BASE}/
-       # invoke this command in the vserver
-       vserver ${BASE} exec /$COMMAND "${argv[@]}"
+       cp $COMMANDPATH /vservers/${BASE}/build/
+
+       # invoke this command in the vserver for building (-T)
+       vserver ${BASE} exec /build/$COMMAND -T "${argv[@]}" 
 
-       # publish
+       # if successful (we run in set -e), publish
        webpath=$(echo $WEBPATH | sed -e s,@PLDISTRO@,"$PLDISTRO",g -e s,@BASE@,"$BASE",g)
-       weblog=$(echo $WEBLOG | sed -e s,@PLDISTRO@,"$PLDISTRO",g -e s,@BASE@,"$BASE",g)
-       rm -f $webpath
-       ln -s /vservers/$BASE/build $webpath
-       rm -f $weblog
-       ln -s $LOG $weblog
+       weblog=${webpath}.txt
+       rm -rf $webpath $weblog
+       myplcs=$(find /vservers/$BASE/build/RPMS -name myplc\*rpm)
+       mkdir $webpath
+       cp $myplcs $webpath
        
+       # invoke this command again for invoking tests
+       vserver ${BASE} exec /build/$COMMAND -B "${argv[@]}" 
+
+       success 
     else
        LOG=/build/build-log.txt
        if [ -n "$DO_BUILD" ] ; then 
            build 
-           touch /build-ok
        fi
     
-# todo :
-# ssh is missing in the vserver
-# and in any case the way it's done now, the stuff gets published AFTER the test is run
-#      if [ -n "$DO_TEST" ] ; then 
-#          runtest
-#      fi
+       # need ssh in the vserver 
+       if [ -n "$DO_TEST" ] ; then 
+           runtest
+       fi
 
-       success 
 
     fi