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
55 echo "Destroying vm $HOST"
56 (cd tests/scripts ; sh ./stop_vm.sh $HOST || true)
59 make -f Makefile.rh BUILDRESULT=$WORKSPACE/build/packages all
61 (cd tests/scripts ; sh ./start_vm.sh $HOST)
64 cp src/rpm-specific/fusionforge.repo $WORKSPACE/build/packages/fusionforge.repo
65 sed -i "s#http://fusionforge.org/#${HUDSON_URL}#" $WORKSPACE/build/packages/fusionforge.repo
66 if [ ! -z "$FFORGE_RPM_REPO" ]
68 sed -i "s#baseurl = .*#baseurl = ${FFORGE_RPM_REPO}/#" $WORKSPACE/build/packages/fusionforge.repo
70 scp $WORKSPACE/build/packages/fusionforge.repo root@$HOST:/etc/yum.repos.d/
71 [ ! -e ~/fusionforge_repo ] || scp -rp ~/fusionforge_repo root@$HOST:
74 cp src/rpm-specific/dag-rpmforge.repo $WORKSPACE/build/packages/dag-rpmforge.repo
75 if [ ! -z "$DAG_RPMFORGE_REPO" ] ; then
76 sed -i "s#http://apt.sw.be/redhat#${DAG_RPMFORGE_REPO}#" $WORKSPACE/build/packages/dag-rpmforge.repo
78 scp $WORKSPACE/build/packages/dag-rpmforge.repo root@$HOST:/etc/yum.repos.d/
80 scp -r tests root@$HOST:/root
81 scp 3rd-party/selenium/binary/selenium-server-current/selenium-server.jar root@$HOST:/root
82 ssh root@$HOST "ln -s gforge /usr/share/src"
85 [ ! -e "/tmp/timedhosts.txt" ] || scp -p /tmp/timedhosts.txt root@$HOST:/var/cache/yum/timedhosts.txt
86 ssh root@$HOST "yum install -y fusionforge fusionforge-plugin-scmsvn fusionforge-plugin-online_help fusionforge-plugin-extratabs fusionforge-plugin-authldap fusionforge-plugin-scmgit fusionforge-plugin-blocks"
87 scp -p root@$HOST:/var/cache/yum/timedhosts.txt /tmp/timedhosts.txt || true
88 ssh root@$HOST '(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-builbot.ini'
89 ssh root@$HOST "cd /root/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"
90 ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
91 # Install a fake sendmail to catch all outgoing emails.
92 # ssh root@".HOST." 'perl -spi -e s#/usr/sbin/sendmail#/usr/share/tests/scripts/catch_mail.php# /etc/gforge/local.inc'
93 ssh root@$HOST "service crond stop" || true
97 echo "Run phpunit test on $HOST"
98 ssh -X root@$HOST "tests/scripts/phpunit.sh RPMCentos52Tests.php"
101 phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml RPMCentos52Tests.php
103 if [ "x$SELENIUM_RC_DIR" != "x" ]
105 scp -r root@$HOST:/var/log $SELENIUM_RC_DIR
107 cp $WORKSPACE/reports/phpunit-selenium.xml $WORKSPACE/reports/phpunit-selenium.xml.org
108 xalan -in $WORKSPACE/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $WORKSPACE/reports/phpunit-selenium.xml
112 echo "Keeping vm $HOST alive"
114 (cd tests/scripts ; sh ./stop_vm.sh $HOST)