scp -r tests root@$HOST:/root
scp -r $WORKSPACE/build/config root@$HOST:/root
-scp 3rd-party/selenium/binary/selenium-server-current/selenium-server.jar root@$HOST:/root
-ssh root@$HOST "cat /root/tests/preseed/* | LANG=C debconf-set-selections"
+scp 3rd-party/selenium/selenium-server.jar root@$HOST:/root
+ssh root@$HOST "cat /root/tests/preseed/* | sed s/@FORGE_ADMIN_PASSWORD@/$FORGE_ADMIN_PASSWORD/ | LANG=C debconf-set-selections"
ssh root@$HOST "echo \"deb $DEBMIRROR $DIST main\" > /etc/apt/sources.list"
ssh root@$HOST "echo \"deb $DEBMIRRORSEC $DIST/updates main\" > /etc/apt/sources.list.d/security.list"
gpg --export --armor | ssh root@$HOST "apt-key add -"
sleep 5
ssh root@$HOST "apt-get update"
-ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -y --force-yes install postgresql-contrib fusionforge-plugin-forumml fusionforge-full"
+ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -y --force-yes install postgresql-contrib fusionforge-full"
echo "Set forge admin password"
-ssh root@$HOST "/usr/share/gforge/bin/forge_set_password admin myadmin"
-ssh root@$HOST "LANG=C a2dissite default ; LANG=C invoke-rc.d apache2 reload ; LANG=C touch /tmp/fusionforge-use-pfo-rbac"
-ssh root@$HOST "(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-builbot.ini"
+ssh root@$HOST "/usr/share/gforge/bin/forge_set_password admin $FORGE_ADMIN_PASSWORD"
+#ssh root@$HOST "LANG=C a2dissite default ; LANG=C invoke-rc.d apache2 reload ; LANG=C touch /tmp/fusionforge-use-pfo-rbac"
+ssh root@$HOST "(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-buildbot.ini"
#ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
+ssh root@$HOST "a2dissite default"
ssh root@$HOST "invoke-rc.d cron stop" || true
retcode=0
if $REMOTESELENIUM
then
echo "Run phpunit test on $HOST"
- ssh -X root@$HOST "tests/scripts/phpunit.sh DEBDebian60Tests.php" || retcode=$?
+ 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
+/root/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)
+ ssh root@$HOST "vncserver -kill :1" || retcode=$?
else
cd tests
phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml DEBDebian60Tests.php || retcode=$?
then
echo "Keeping vm $HOST alive"
else
- (cd tests/scripts ; sh ./stop_vm.sh $HOST)
+ cd tests/scripts
+ sh ./stop_vm.sh $HOST || true
fi
exit $retcode