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
24 if [ "x${HUDSON_URL}" = "x" ]
26 export BASEDIR=${BASEDIR:-/~`id -un`/ws}
27 export SELENIUM_RC_HOST=localhost
28 export SELENIUM_RC_URL=http://`hostname -f`$BASEDIR/reports
30 export SELENIUM_RC_URL=${HUDSON_URL}job/$JOB_NAME/ws/reports
34 export CONFIGURED=true
36 export BUILDRESULT=$WORKSPACE/build/packages
38 # Create place to build package if necessary
39 [ ! -d $WORKSPACE/build/packages ] || mkdir -p $WORKSPACE/build/packages
42 [ ! -d $WORKSPACE/build/config ] || rm -fr $WORKSPACE/build/config
43 mkdir -p $WORKSPACE/build/config
46 [ ! -d $WORKSPACE/reports ] || rm -fr $WORKSPACE/reports
47 mkdir -p $WORKSPACE/reports/coverage
50 [ ! -d $WORKSPACE/apidocs ] || rm -fr $WORKSPACE/apidocs
51 mkdir -p $WORKSPACE/apidocs
53 #[ ! -e $HOME/doxygen-1.6.3/bin/doxygen ] || make build-doc DOCSDIR=$WORKSPACE/apidocs DOXYGEN=$HOME/doxygen-1.6.3/bin/doxygen
54 #make BUILDRESULT=$WORKSPACE/build/packages buildtar
55 #make -f Makefile.rh BUILDRESULT=$WORKSPACE/build/packages src
59 # VM can already exist
60 echo "Starting vm $HOST"
61 tests/scripts/start_vm $HOST
63 # Destroy the VM if found
64 echo "Destroying vm $HOST"
65 tests/scripts/stop_vm $HOST || true
68 # BUILD FUSIONFORGE REPO
69 echo "Build FUSIONFORGE REPO"
70 make -C 3rd-party -f Makefile.rh BUILDRESULT=$WORKSPACE/build/packages
73 if [ ! -z "$FFORGE_RPM_REPO" ]
75 echo "Installing specific FUSIONFORGE REPO $FFORGE_RPM_REPO"
76 cp src/rpm-specific/fusionforge.repo $WORKSPACE/build/packages/fusionforge.repo
77 sed -i "s#http://fusionforge.org/#${HUDSON_URL}#" $WORKSPACE/build/packages/fusionforge.repo
78 sed -i "s#baseurl = .*#baseurl = ${FFORGE_RPM_REPO}/#" $WORKSPACE/build/packages/fusionforge.repo
79 scp $WORKSPACE/build/packages/fusionforge.repo root@$HOST:/etc/yum.repos.d/
81 rsync -a --delete $WORKSPACE/build/packages/ root@$HOST:/root/fusionforge_repo/
82 echo "Installing standart FUSIONFORGE REPO from src/rpm-specific/fusionforge.repo"
83 scp src/rpm-specific/fusionforge.repo root@$HOST:/etc/yum.repos.d/
87 if [ ! -z "$DAG_RPMFORGE_REPO" ] ; then
88 echo "Installing specific DAG REPO $DAG_RPMFORGE_REPO"
89 cp src/rpm-specific/dag-rpmforge.repo $WORKSPACE/build/packages/dag-rpmforge.repo
90 sed -i "s#http://apt.sw.be/redhat#${DAG_RPMFORGE_REPO}#" $WORKSPACE/build/packages/dag-rpmforge.repo
91 scp $WORKSPACE/build/packages/dag-rpmforge.repo root@$HOST:/etc/yum.repos.d/
93 echo "Installing standart DAG REPO from src/rpm-specific/dag-rpmforge.repo"
94 scp src/rpm-specific/dag-rpmforge.repo root@$HOST:/etc/yum.repos.d/
97 cat > $WORKSPACE/build/config/phpunit <<-EOF
98 HUDSON_URL=$HUDSON_URL
102 rsync -a --delete src/ root@$HOST:/opt/gforge/
104 ssh root@$HOST "/opt/gforge/install-ng"
106 ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
108 ssh root@$HOST "(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-zbuildbot.ini"
109 ssh root@$HOST "cd /opt/gforge/tests/func; CONFIGURED=true CONFIG_PHP=config.php.buildbot DB_NAME=$DB_NAME php db_reload.php"
110 # Install a fake sendmail to catch all outgoing emails.
111 # ssh root@$HOST "perl -spi -e s#/usr/sbin/sendmail#/opt/tests/scripts/catch_mail.php# /etc/gforge/local.inc"
112 ssh root@$HOST "service crond stop" || true
115 echo "Run phpunit test on $HOST"
116 ssh -X root@$HOST "/opt/gforge/tests/scripts/phpunit.sh TarCentos52Tests.php" || retcode=$?
118 if [ "x$SELENIUM_RC_DIR" != "x" ]
120 rsync -av root@$HOST:/var/log/ $SELENIUM_RC_DIR/
123 cp $WORKSPACE/reports/phpunit-selenium.xml $WORKSPACE/reports/phpunit-selenium.xml.org
124 xalan -in $WORKSPACE/reports/phpunit-selenium.xml.org -xsl fix_phpunit.xslt -out $WORKSPACE/reports/phpunit-selenium.xml
128 echo "Keeping vm $HOST alive"
130 tests/scripts/stop_vm $HOST