4 export WORKSPACE=${WORKSPACE:-$CURDIR}
6 export CONFIG_PHP=func/config.php.buildbot
7 export SELENIUM_RC_HOST=${SELENIUM_RC_HOST:-`hostname -i`}
8 export SELENIUM_RC_DIR=$WORKSPACE/reports
11 . tests/config/default
12 if [ -f tests/config/`hostname` ] ; then . tests/config/`hostname`; fi
16 export LXCTEMPLATE=$LXCCOSTEMPLATE
18 export IPBASE=$IPCOSBASE
19 export IPDNS=$IPCOSDNS
20 export IPMASK=$IPCOSMASK
23 ARCH=`dpkg-architecture -qDEB_BUILD_ARCH`
24 export VZTEMPLATE=centos-$COSVERS-$ARCH-minimal
26 export HOST=centos5.local
34 if [ "x${HUDSON_URL}" = "x" ]
36 export BASEDIR=${BASEDIR:-/~`id -un`/ws}
38 export SELENIUM_RC_HOST=localhost
39 export SELENIUM_RC_URL=http://`hostname -f`$BASEDIR/reports
40 export FFORGE_RPM_REPO=http://`hostname -f`$BASEDIR/build/packages
42 export SELENIUM_RC_URL=${HUDSON_URL}job/$JOB_NAME/ws/reports
43 export FFORGE_RPM_REPO=${HUDSON_URL}job/$JOB_NAME/ws/build/packages
44 export VZTEMPLATE=centos-5-x86
47 export CONFIGURED=true
49 [ ! -d $WORKSPACE/build ] || rm -fr $WORKSPACE/build
50 [ ! -d $WORKSPACE/reports ] || rm -fr $WORKSPACE/reports
51 mkdir -p $WORKSPACE/build/packages $WORKSPACE/reports/coverage
53 make -f Makefile.rh BUILDRESULT=$WORKSPACE/build/packages all
55 cp src/rpm-specific/fusionforge.repo $WORKSPACE/build/packages/fusionforge.repo
56 sed -i "s#http://fusionforge.org/#${HUDSON_URL}#" $WORKSPACE/build/packages/fusionforge.repo
57 sed -i "s#baseurl = .*#baseurl = $FFORGE_RPM_REPO/#" $WORKSPACE/build/packages/fusionforge.repo
61 echo "Destroying vm $HOST"
62 (cd tests/scripts ; sh ./stop_vm.sh $HOST || true)
64 (cd tests/scripts ; sh ./start_vm.sh $HOST)
65 scp -r tests root@$HOST:/root
66 scp 3rd-party/selenium/binary/selenium-server-current/selenium-server.jar root@$HOST:/root
67 ssh root@$HOST "ln -s gforge /usr/share/src"
68 [ ! -e ~/fusionforge_repo ] || scp -rp ~/fusionforge_repo root@$HOST:
69 scp -rp src/rpm-specific/dag-rpmforge.repo root@$HOST:/etc/yum.repos.d/
70 if [ "x$FFORGE_RPM_REPO" != "x" ]
72 ssh root@$HOST "cd /etc/yum.repos.d/; wget $FFORGE_RPM_REPO/fusionforge.repo"
75 [ ! -e "/tmp/timedhosts.txt" ] || scp -p /tmp/timedhosts.txt root@$HOST:/var/cache/yum/timedhosts.txt
76 ssh root@$HOST "yum install -y fusionforge fusionforge-plugin-scmsvn fusionforge-plugin-online_help fusionforge-plugin-extratabs fusionforge-plugin-ldapextauth fusionforge-plugin-scmgit fusionforge-plugin-blocks"
77 scp -p root@$HOST:/var/cache/yum/timedhosts.txt /tmp/timedhosts.txt || true
78 ssh root@$HOST '(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-builbot.ini'
79 ssh root@$HOST "cd /root/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"
80 ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
81 # Install a fake sendmail to catch all outgoing emails.
82 # ssh root@".HOST." 'perl -spi -e s#/usr/sbin/sendmail#/usr/share/tests/scripts/catch_mail.php# /etc/gforge/local.inc'
83 ssh root@$HOST "service crond stop" || true
87 echo "Run phpunit test on $HOST"
88 ssh -X root@$HOST "tests/scripts/phpunit.sh RPMCentos52Tests.php"
91 phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml RPMCentos52Tests.php
93 if [ "x$SELENIUM_RC_DIR" != "x" ]
95 scp -r root@$HOST:/var/log $SELENIUM_RC_DIR
97 cp $WORKSPACE/reports/phpunit-selenium.xml $WORKSPACE/reports/phpunit-selenium.xml.org
98 xalan -in $WORKSPACE/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $WORKSPACE/reports/phpunit-selenium.xml
102 echo "Keeping vm $HOST alive"
104 (cd tests/scripts ; sh ./stop_vm.sh $HOST)