[Fusionforge-commits] r15568 - in branches/Branch_5_2: . tests/scripts

Roland Mas lolando at fusionforge.org
Thu May 24 12:04:53 CEST 2012


Author: lolando
Date: 2012-05-24 12:04:52 +0200 (Thu, 24 May 2012)
New Revision: 15568

Modified:
   branches/Branch_5_2/
   branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-deb.sh
   branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-src-deb.sh
Log:
Backport from trunk: run VNC within the VM on the buildbot for Debian jobs

Modified: branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-deb.sh
===================================================================
--- branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-deb.sh	2012-05-24 09:11:48 UTC (rev 15567)
+++ branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-deb.sh	2012-05-24 10:04:52 UTC (rev 15568)
@@ -56,15 +56,29 @@
 # Run tests
 retcode=0
 echo "Run phpunit test on $HOST in $FORGE_HOME"
-if xterm -e "sh -c exit" 2>/dev/null
-then
-        ssh -X root@$HOST "$FORGE_HOME/tests/scripts/phpunit.sh DEBDebian60Tests.php" || retcode=$?
-        rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
-else
-        echo "No display is available, NOT RUNNING TESTS"
-        retcode=2
-fi
 
+ssh root@$HOST "apt-get -y install vnc4server ; mkdir -p /root/.vnc"
+ssh root@$HOST "cat > /root/.vnc/xstartup ; chmod +x /root/.vnc/xstartup" <<EOF
+#! /bin/bash
+: > /root/phpunit.exitcode
+$FORGE_HOME/tests/scripts/phpunit.sh DEBDebian60Tests.php &> /var/log/phpunit.log &
+echo \$! > /root/phpunit.pid
+wait %1
+echo \$? > /root/phpunit.exitcode
+EOF
+ssh root@$HOST vncpasswd <<EOF
+password
+password
+EOF
+ssh root@$HOST "vncserver :1"
+sleep 5
+pid=$(ssh root@$HOST cat /root/phpunit.pid)
+ssh root@$HOST "tail -f /var/log/phpunit.log --pid=$pid"
+sleep 5
+retcode=$(ssh root@$HOST cat /root/phpunit.exitcode)
+rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
+ssh root@$HOST "vncserver -kill :1" || retcode=$?
+
 stop_vm_if_not_keeped -t debian6 $@
 exit $retcode
 

Modified: branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-src-deb.sh
===================================================================
--- branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-src-deb.sh	2012-05-24 09:11:48 UTC (rev 15567)
+++ branches/Branch_5_2/tests/scripts/fusionforge-build-and-test-src-deb.sh	2012-05-24 10:04:52 UTC (rev 15568)
@@ -51,14 +51,28 @@
 # Run tests
 retcode=0
 echo "Run phpunit test on $HOST"
-if xterm -e "sh -c exit" 2>/dev/null
-then
-	ssh -X root@$HOST "$FORGE_HOME/tests/scripts/phpunit.sh DEBDebian60Tests.php" || retcode=$?
-	rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
-else
-	echo "No display is available, NOT RUNNING TESTS"
-	retcode=2
-fi
 
+ssh root@$HOST "apt-get -y install vnc4server ; mkdir -p /root/.vnc"
+ssh root@$HOST "cat > /root/.vnc/xstartup ; chmod +x /root/.vnc/xstartup" <<EOF
+#! /bin/bash
+: > /root/phpunit.exitcode
+$FORGE_HOME/tests/scripts/phpunit.sh DEBDebian60Tests.php &> /var/log/phpunit.log &
+echo \$! > /root/phpunit.pid
+wait %1
+echo \$? > /root/phpunit.exitcode
+EOF
+ssh root@$HOST vncpasswd <<EOF
+password
+password
+EOF
+ssh root@$HOST "vncserver :1"
+sleep 5
+pid=$(ssh root@$HOST cat /root/phpunit.pid)
+ssh root@$HOST "tail -f /var/log/phpunit.log --pid=$pid"
+sleep 5
+retcode=$(ssh root@$HOST cat /root/phpunit.exitcode)
+rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
+ssh root@$HOST "vncserver -kill :1" || retcode=$?
+
 stop_vm_if_not_keeped -t debian6 $@
 return $retcode




More information about the Fusionforge-commits mailing list