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 3rd-party/selenium ; make getselenium)
68 (cd tests/scripts ; sh ./start_vm.sh $HOST)
71 if [ ! -z "$FFORGE_RPM_REPO" ]
73 echo "Installing specific FUSIONFORGE REPO $FFORGE_RPM_REPO"
74 cp src/rpm-specific/fusionforge.repo $WORKSPACE/build/packages/fusionforge.repo
75 sed -i "s#http://fusionforge.org/#${HUDSON_URL}#" $WORKSPACE/build/packages/fusionforge.repo
76 sed -i "s#baseurl = .*#baseurl = ${FFORGE_RPM_REPO}/#" $WORKSPACE/build/packages/fusionforge.repo
77 scp $WORKSPACE/build/packages/fusionforge.repo root@$HOST:/etc/yum.repos.d/
79 rsync -a --delete $WORKSPACE/build/packages/ root@$HOST:/root/fusionforge_repo/
80 echo "Installing standart FUSIONFORGE REPO from src/rpm-specific/fusionforge.repo"
81 scp src/rpm-specific/fusionforge.repo root@$HOST:/etc/yum.repos.d/
85 if [ ! -z "$DAG_RPMFORGE_REPO" ] ; then
86 echo "Installing specific DAG REPO $DAG_RPMFORGE_REPO"
87 cp src/rpm-specific/dag-rpmforge.repo $WORKSPACE/build/packages/dag-rpmforge.repo
88 sed -i "s#http://apt.sw.be/redhat#${DAG_RPMFORGE_REPO}#" $WORKSPACE/build/packages/dag-rpmforge.repo
89 scp $WORKSPACE/build/packages/dag-rpmforge.repo root@$HOST:/etc/yum.repos.d/
91 echo "Installing standart DAG REPO from src/rpm-specific/dag-rpmforge.repo"
92 scp src/rpm-specific/dag-rpmforge.repo root@$HOST:/etc/yum.repos.d/
95 cat > $WORKSPACE/build/config/phpunit <<-EOF
96 HUDSON_URL=$HUDSON_URL
100 scp -r tests root@$HOST:/root
101 scp -r $WORKSPACE/build/config root@$HOST:/root
102 scp 3rd-party/selenium/binary/selenium-server-current/selenium-server.jar root@$HOST:/root
103 ssh root@$HOST "ln -s gforge /usr/share/src"
106 [ ! -e "/tmp/timedhosts.txt" ] || scp -p /tmp/timedhosts.txt root@$HOST:/var/cache/yum/timedhosts.txt
107 ssh root@$HOST "FFORGE_DB=$DB_NAME FFORGE_USER=gforge FFORGE_ADMIN_USER=admin FFORGE_ADMIN_PASSWORD=myadmin 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-ldapextauth fusionforge-plugin-scmgit fusionforge-plugin-blocks"
108 scp -p root@$HOST:/var/cache/yum/timedhosts.txt /tmp/timedhosts.txt || true
109 ssh root@$HOST '(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-builbot.ini'
110 #ssh root@$HOST "cd /root/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"
111 #ssh root@$HOST "su - postgres -c \"pg_dump -Fc $DB_NAME\" > /root/dump"
112 ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
113 # Install a fake sendmail to catch all outgoing emails.
114 # ssh root@".HOST." 'perl -spi -e s#/usr/sbin/sendmail#/usr/share/tests/scripts/catch_mail.php# /etc/gforge/local.inc'
115 ssh root@$HOST "service crond stop" || true
120 echo "Run phpunit test on $HOST"
121 ssh -X root@$HOST "tests/scripts/phpunit.sh RPMCentos52Tests.php"|| retcode=$?
124 phpunit --log-junit $WORKSPACE/reports/phpunit-selenium.xml RPMCentos52Tests.php || retcode=$?
128 if [ "x$SELENIUM_RC_DIR" != "x" ]
130 rsync -av root@$HOST:/var/log/ $SELENIUM_RC_DIR/
132 cp $WORKSPACE/reports/phpunit-selenium.xml $WORKSPACE/reports/phpunit-selenium.xml.org
133 xalan -in $WORKSPACE/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $WORKSPACE/reports/phpunit-selenium.xml
137 echo "Keeping vm $HOST alive"
139 (cd tests/scripts ; sh ./stop_vm.sh $HOST)