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
17 export HOST=centos5.$DNSDOMAIN
22 export LXCTEMPLATE=$LXCCOSTEMPLATE
24 export IPBASE=$IPCOSBASE
25 export IPDNS=$IPCOSDNS
26 export IPMASK=$IPCOSMASK
29 ARCH=`dpkg-architecture -qDEB_BUILD_ARCH`
30 export VZTEMPLATE=centos-$COSVERS-$ARCH-minimal
39 if [ "x${HUDSON_URL}" = "x" ]
41 export BASEDIR=${BASEDIR:-/~`id -un`/ws}
43 export SELENIUM_RC_HOST=localhost
44 export SELENIUM_RC_URL=http://`hostname -f`$BASEDIR/reports
45 export FFORGE_RPM_REPO=http://`hostname -f`$BASEDIR/build/packages
47 export SELENIUM_RC_URL=${HUDSON_URL}job/$JOB_NAME/ws/reports
48 export FFORGE_RPM_REPO=${HUDSON_URL}job/$JOB_NAME/ws/build/packages
49 export VZTEMPLATE=centos-5-x86
52 export CONFIGURED=true
54 [ ! -d $WORKSPACE/build ] || rm -fr $WORKSPACE/build
55 [ ! -d $WORKSPACE/reports ] || rm -fr $WORKSPACE/reports
56 mkdir -p $WORKSPACE/build/packages $WORKSPACE/build/config $WORKSPACE/reports/coverage
60 echo "Destroying vm $HOST"
61 (cd tests/scripts ; sh ./stop_vm.sh $HOST || true)
64 make -f Makefile.rh BUILDRESULT=$WORKSPACE/build/packages all
66 (cd tests/scripts ; sh ./start_vm.sh $HOST)
69 cp src/rpm-specific/fusionforge.repo $WORKSPACE/build/packages/fusionforge.repo
70 sed -i "s#http://fusionforge.org/#${HUDSON_URL}#" $WORKSPACE/build/packages/fusionforge.repo
71 if [ ! -z "$FFORGE_RPM_REPO" ]
73 sed -i "s#baseurl = .*#baseurl = ${FFORGE_RPM_REPO}/#" $WORKSPACE/build/packages/fusionforge.repo
75 scp $WORKSPACE/build/packages/fusionforge.repo root@$HOST:/etc/yum.repos.d/
76 [ ! -e ~/fusionforge_repo ] || scp -rp ~/fusionforge_repo root@$HOST:
79 cp src/rpm-specific/dag-rpmforge.repo $WORKSPACE/build/packages/dag-rpmforge.repo
80 if [ ! -z "$DAG_RPMFORGE_REPO" ] ; then
81 sed -i "s#http://apt.sw.be/redhat#${DAG_RPMFORGE_REPO}#" $WORKSPACE/build/packages/dag-rpmforge.repo
83 scp $WORKSPACE/build/packages/dag-rpmforge.repo root@$HOST:/etc/yum.repos.d/
85 cat > $WORKSPACE/build/config/phpunit <<-EOF
86 HUDSON_URL=$HUDSON_URL
90 scp -r tests root@$HOST:/root
91 scp -r $WORKSPACE/build/config root@$HOST:/root
92 scp 3rd-party/selenium/binary/selenium-server-current/selenium-server.jar root@$HOST:/root
93 ssh root@$HOST "ln -s gforge /usr/share/src"
96 [ ! -e "/tmp/timedhosts.txt" ] || scp -p /tmp/timedhosts.txt root@$HOST:/var/cache/yum/timedhosts.txt
97 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"
98 scp -p root@$HOST:/var/cache/yum/timedhosts.txt /tmp/timedhosts.txt || true
99 ssh root@$HOST '(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-builbot.ini'
100 ssh root@$HOST "cd /root/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"
101 ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
102 # Install a fake sendmail to catch all outgoing emails.
103 # ssh root@".HOST." 'perl -spi -e s#/usr/sbin/sendmail#/usr/share/tests/scripts/catch_mail.php# /etc/gforge/local.inc'
104 ssh root@$HOST "service crond stop" || true
109 echo "Run phpunit test on $HOST"
110 ssh -X root@$HOST "tests/scripts/phpunit.sh RPMCentos52Tests.php"|| retcode=$?
113 phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml RPMCentos52Tests.php || retcode=$?
117 if [ "x$SELENIUM_RC_DIR" != "x" ]
119 rsync -av root@$HOST:/var/log/ $SELENIUM_RC_DIR/
121 cp $WORKSPACE/reports/phpunit-selenium.xml $WORKSPACE/reports/phpunit-selenium.xml.org
122 xalan -in $WORKSPACE/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $WORKSPACE/reports/phpunit-selenium.xml
126 echo "Keeping vm $HOST alive"
128 (cd tests/scripts ; sh ./stop_vm.sh $HOST)