2 . tests/scripts/common-functions
3 . tests/scripts/common-vm
5 export FORGE_HOME=/usr/share/gforge
8 destroy_vm -t centos5 $@
9 start_vm_if_not_keeped -t centos5 $@
11 # BUILD FUSIONFORGE REPO
12 echo "Build FUSIONFORGE REPO in $BUILDRESULT"
13 make -f Makefile.rh BUILDRESULT=$BUILDRESULT RPM_TMP=$RPM_TMP all
19 ssh root@$HOST "FFORGE_DB=$DB_NAME FFORGE_USER=gforge FFORGE_ADMIN_USER=$FORGE_ADMIN_USERNAME FFORGE_ADMIN_PASSWORD=$FORGE_ADMIN_PASSWORD export FFORGE_DB FFORGE_USER FFORGE_ADMIN_USER FFORGE_ADMIN_PASSWORD; yum install -y --skip-broken fusionforge fusionforge-plugin-scmsvn fusionforge-plugin-online_help fusionforge-plugin-extratabs fusionforge-plugin-authldap fusionforge-plugin-scmgit fusionforge-plugin-blocks"
21 ssh root@$HOST '(echo [core];echo use_ssl=no;echo use_fti=no) > /etc/gforge/config.ini.d/zzz-buildbot.ini'
22 ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
23 # Install a fake sendmail to catch all outgoing emails.
24 ssh root@$HOST "perl -spi -e s#/usr/sbin/sendmail#$FORGE_HOME/tests/scripts/catch_mail.php# /etc/gforge/config.ini.d/defaults.ini"
27 ssh root@$HOST "service crond stop" || true
29 # Install selenium tests
30 ssh root@$HOST mkdir $FORGE_HOME/tests
31 make -C 3rd-party/selenium selenium-server.jar
32 cp 3rd-party/selenium/selenium-server.jar tests/
33 rsync -a --delete tests/ root@$HOST:$FORGE_HOME/tests/
35 ssh root@$HOST "cat > $FORGE_HOME/tests/config/phpunit" <<-EOF
36 HUDSON_URL=$HUDSON_URL
42 echo "Run phpunit test on $HOST in $FORGE_HOME"
44 ssh root@$HOST "yum install -y vnc-server ; mkdir -p /root/.vnc"
45 ssh root@$HOST "cat > /root/.vnc/xstartup ; chmod +x /root/.vnc/xstartup" <<EOF
47 : > /root/phpunit.exitcode
48 $FORGE_HOME/tests/scripts/phpunit.sh RPMCentosTests.php &> /var/log/phpunit.log &
49 echo \$! > /root/phpunit.pid
51 echo \$? > /root/phpunit.exitcode
53 ssh root@$HOST vncpasswd <<EOF
57 ssh root@$HOST "vncserver :1"
59 pid=$(ssh root@$HOST cat /root/phpunit.pid)
60 ssh root@$HOST "tail -f /var/log/phpunit.log --pid=$pid"
62 retcode=$(ssh root@$HOST cat /root/phpunit.exitcode)
63 rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
64 ssh root@$HOST "vncserver -kill :1" || retcode=$?
66 stop_vm_if_not_keeped -t centos5 $@