--- /dev/null
+See https://fusionforge.org/plugins/mediawiki/wiki/fusionforge/index.php/Virtual_machine_development_environment
--- /dev/null
+#!/bin/bash
+# Build FusionForge packages and create a local repo
+#
+# Copyright (C) 2011 Roland Mas
+# Copyright (C) 2011 Olivier Berger - Institut Telecom
+# Copyright (C) 2014 Inria (Sylvain Beucler)
+#
+# This file is part of FusionForge. FusionForge is free software;
+# you can redistribute it and/or modify it under the terms of the
+# GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the Licence, or (at your option)
+# any later version.
+#
+# FusionForge is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with FusionForge; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+# Debian and Fedora/CentOS/RHEL *package building* are so different
+# that there's nothing to factour out, so they are in separate functions.
+
+function build_deb {
+ export DEBIAN_FRONTEND=noninteractive
+
+ # Install build dependencies
+ apt-get -y install mini-dinstall dput devscripts fakeroot
+ apt-get -y install build-essential \
+ $(grep Build-Depends /usr/src/fusionforge/src/debian/control.in | sed -e 's/Build-Depends: //' -e 's/(.*)//')
+ apt-get -y install php5-cli # debian/gen_control.sh
+
+
+ # Populate a local Debian packages repository for APT managed with mini-dinstall
+ #rm -rf /usr/src/debian-repository
+ mkdir -p /usr/src/debian-repository
+
+ cat >/root/.mini-dinstall.conf <<-EOF
+ [DEFAULT]
+ archivedir = /usr/src/debian-repository
+ archive_style = flat
+
+ verify_sigs = 0
+
+ generate_release = 1
+ release_signscript = /usr/src/fusionforge/autoinstall/mini-dinstall-sign.sh
+
+ max_retry_time = 3600
+ mail_on_success = false
+
+ [local]
+ EOF
+
+ export GNUPGHOME=/usr/src/gnupg
+ if [ ! -e $GNUPGHOME ]; then
+ mkdir -m 700 $GNUPGHOME
+ # Quick 'n Dirty hack to get entropy on VMs
+ # https://bugs.launchpad.net/ubuntu/+source/gnupg/+bug/706011
+ # (don't do this for a public repo!)
+ apt-get install -y rng-tools
+ echo HRNGDEVICE=/dev/urandom >> /etc/default/rng-tools
+ service rng-tools restart
+ gpg --batch --gen-key <<-EOF
+ Key-Type: RSA
+ Key-Length: 2048
+ Subkey-Type: RSA
+ Subkey-Length: 2048
+ Name-Real: FusionForge
+ Expire-Date: 0
+ %commit
+ EOF
+ fi
+ gpg --export FusionForge -a > /usr/src/debian-repository/key.asc
+ apt-key add /usr/src/debian-repository/key.asc
+
+ mini-dinstall -b
+
+ # Configure debian package building tools so as to use the local repo
+ if [ ! -f /root/.dput.cf ]; then
+ cat > /root/.dput.cf <<-EOF
+ [local]
+ fqdn = localhost
+ incoming = /usr/src/debian-repository/mini-dinstall/incoming
+ method = local
+ run_dinstall = 0
+ allow_unsigned_uploads = yes
+ post_upload_command = mini-dinstall -b
+ allowed_distributions = local
+ EOF
+ fi
+
+ if [ ! -f /root/.devscripts ]; then
+ cat > /root/.devscripts <<-EOF
+ DEBRELEASE_UPLOADER=dput
+ DEBUILD_DPKG_BUILDPACKAGE_OPTS=-i
+ EOF
+ fi
+
+ # Finally, build the FusionForge packages
+ cd /usr/src/fusionforge/src
+ f=$(mktemp)
+ cp debian/changelog $f
+ version=$(dpkg-parsechangelog | sed -n 's/^Version: \([0-9.]\+\(\~rc[0-9]\)\?\).*/\1/p')+$(date +%Y%m%d%H%M)
+ debian/rules debian/control # re-gen debian/control
+ dch --newversion $version-1 --distribution local --force-distribution "Autobuilt."
+ make dist
+ mv fusionforge-$(make version).tar.bz2 ../fusionforge_$version.orig.tar.bz2
+ debuild -us -uc -tc # using -tc so 'git status' is readable
+
+ # Install built packages into the local repo
+ debrelease -f local
+ mv $f debian/changelog
+
+ # Declare the repo so that packages become installable
+ echo 'deb file:///usr/src/debian-repository local/' > /etc/apt/sources.list.d/local.list
+ apt-get update
+}
+
+
+function build_rpm {
+ # Install build dependencies
+ yum install -y gettext tar bzip2 rpm-build createrepo
+ yum install -y php-cli # rpm/gen_spec.sh
+
+ # Build package
+ cd /usr/src/fusionforge/src/
+ version="$(make version)"
+ snapshot="+$(date +%Y%m%d%H%M)"
+ rpm/gen_spec.sh $version $snapshot
+ make dist
+ mkdir -p ../build/SOURCES/ ../build/SPECS/
+ mv fusionforge-$(make version).tar.bz2 ../build/SOURCES/fusionforge-$version$snapshot.tar.bz2
+ chown -h root: ../build/SOURCES/fusionforge-$version$snapshot.tar.bz2
+ cp fusionforge.spec ../build/SPECS/
+ rpmbuild ../build/SPECS/fusionforge.spec --define "_topdir $(pwd)/../build" -ba
+
+ (cd ../build/RPMS/ && createrepo .)
+ cat <<-EOF > /etc/yum.repos.d/local.repo
+ [local]
+ name=local
+ baseurl=file:///usr/src/fusionforge/build/RPMS/
+ enabled=1
+ gpgcheck=0
+ EOF
+}
+
+if [ -e /etc/debian_version ]; then
+ build_deb
+elif [ -e /etc/redhat-release ]; then
+ build_rpm
+else
+ echo "Automated package building is not supported for this distribution."
+ echo "See https://fusionforge.org/plugins/mediawiki/wiki/fusionforge/index.php/Installing/FromSource"
+ echo "for instructions"
+fi
--- /dev/null
+#!/bin/bash
+# Tricks to install unavailable packages - used by install.sh and install-src.sh
+#
+# Copyright (C) 2011 Roland Mas
+# Copyright (C) 2011 Olivier Berger - Institut Telecom
+# Copyright (C) 2014 Inria (Sylvain Beucler)
+#
+# This file is part of FusionForge. FusionForge is free software;
+# you can redistribute it and/or modify it under the terms of the
+# GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the Licence, or (at your option)
+# any later version.
+#
+# FusionForge is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with FusionForge; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+function backports_deb {
+ # fusionforge-plugin-scmbzr depends on loggerhead (>= 1.19~bzr477~),
+ # but wheezy only has 1.19~bzr461-1, so we need to manually "Backport"
+ # a more recent dependency
+ if grep -q ^7 /etc/debian_version && ! dpkg-query -s loggerhead >/dev/null 2>&1 ; then
+ # install loggerhead with its dependencies
+ # we need gdebi to make sure dependencies are installed too (simple dpkg -i won't)
+ apt-get -y install gdebi-core wget
+ wget -c http://snapshot.debian.org/archive/debian/20121107T152130Z/pool/main/l/loggerhead/loggerhead_1.19%7Ebzr477-1_all.deb
+ gdebi --non-interactive loggerhead_1.19~bzr477-1_all.deb
+ fi
+}
+
+
+function backports_rpm {
+ # Fedora/RHEL/CentOS version:
+ os_version=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))
+
+ if ! rpm -q fedora-release >/dev/null; then
+ # EPEL - http://download.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.html
+ if ! rpm -q epel-release >/dev/null; then
+ rpm -ivh http://fr2.rpmfind.net/linux/epel/6/i386/epel-release-6-8.noarch.rpm
+ fi
+
+ # Prepare manual backports
+ cat <<'EOF' > /etc/yum.repos.d/fedora-source.repo
+[fedora]
+name=Fedora 20
+failovermethod=priority
+metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=$basearch
+enabled=0
+gpgcheck=0
+[fedora-source]
+name=Fedora 20 - Source
+failovermethod=priority
+metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-20&arch=$basearch
+enabled=0
+gpgcheck=0
+EOF
+ yum install -y yum-utils # yumdownloader
+ fi
+
+ if yum list libnss-pgsql >/dev/null 2>&1; then
+ yum install -y libnss-pgsql
+ else
+ # libnss-pgsql: id., plus http://yum.postgresql.org/8.4/redhat/rhel-5-x86_64/
+ yumdownloader --enablerepo=fedora --source libnss-pgsql
+ DEPS="gcc postgresql-devel xmlto"
+ yum install -y $DEPS
+ rpmbuild --rebuild libnss-pgsql-*.src.rpm
+ yum remove -y $DEPS
+ rpm -ivh ~/rpmbuild/RPMS/x86_64/libnss-pgsql-*.x86_64.rpm
+ fi
+
+ if yum list moin >/dev/null 2>&1; then
+ yum install -y moin
+ else
+ # moin: no available package for RHEL; though 'moin' is available in Fedora
+ yumdownloader --enablerepo=fedora --source moin
+ DEPS="python-devel"
+ yum install -y $DEPS
+ rpmbuild --rebuild moin-*.src.rpm
+ yum remove -y $DEPS
+ rpm -ivh ~/rpmbuild/RPMS/noarch/moin-*.noarch.rpm
+ fi
+
+ if yum list php-htmlpurifier-htmlpurifier >/dev/null 2>&1; then
+ yum install -y php-htmlpurifier-htmlpurifier
+ else
+ # moin: no available package for RHEL; though 'moin' is available in Fedora
+ yumdownloader --enablerepo=fedora --source php-htmlpurifier-htmlpurifier
+ DEPS="php-channel-htmlpurifier" # for v4.3.0-6.fc20
+ yum install -y $DEPS
+ rpmbuild --rebuild php-htmlpurifier-htmlpurifier-*.src.rpm
+ yum remove -y $DEPS
+ yum install -y ~/rpmbuild/RPMS/noarch/php-htmlpurifier-htmlpurifier-*.noarch.rpm
+ fi
+
+ # TODO: postfix: rebuild from RHEL/CentOS sources with pgsql enabled,
+ # so we can test mta-postfix
+}
-#! /bin/sh
+#!/bin/bash
# Install FusionForge from source
#
# Copyright (C) 2011 Roland Mas
#set -x
set -e
-export DEBIAN_FRONTEND=noninteractive
+. $(dirname $0)/common-backports
-# fusionforge-plugin-scmbzr depends on loggerhead (>= 1.19~bzr477~),
-# but wheezy only has 1.19~bzr461-1, so we need to manually "Backport"
-# a more recent dependency
-if grep -q ^7 /etc/debian_version && ! dpkg-query -s loggerhead >/dev/null 2>&1 ; then
- # install loggerhead with its dependencies
- # we need gdebi to make sure dependencies are installed too (simple dpkg -i won't)
- apt-get -y install gdebi-core wget
- wget -c http://snapshot.debian.org/archive/debian/20121107T152130Z/pool/main/l/loggerhead/loggerhead_1.19%7Ebzr477-1_all.deb
- gdebi --non-interactive loggerhead_1.19~bzr477-1_all.deb
-fi
-
-# Install locales-all which is a Recommends and not a Depends
-if ! dpkg -l locales-all | grep -q ^ii ; then
- apt-get -y install locales-all
-fi
-
-# Install FusionForge packages
-apt-get update
-apt-get install -y make gettext php5-cli php5-pgsql php-htmlpurifier \
- apache2 postgresql \
+# Install FusionForge dependencies
+if [ -e /etc/debian_version ]; then
+ export DEBIAN_FRONTEND=noninteractive
+ backports_deb
+ apt-get update
+ apt-get install -y make gettext php5-cli php5-pgsql php-htmlpurifier \
+ apache2 locales-all postgresql \
+ subversion viewvc \
+ mediawiki \
+ python-moinmoin libapache2-mod-wsgi python-psycopg2
+else
+ backports_rpm
+ yum install -y make gettext php-cli php-pgsql \
+ httpd mod_ssl postgresql-server \
subversion viewvc \
- mediawiki \
- python-moinmoin libapache2-mod-wsgi python-psycopg2
+ mediawiki119 \
+ moin mod_wsgi python-psycopg2
+fi
cd /usr/src/fusionforge/src/
make
post-install-plugin-online_help
# Dump clean DB
-if [ ! -e /root/dump ]; then $(dirname $0)/../../func/db_reload.sh --backup; fi
+if [ ! -e /root/dump ]; then $(dirname $0)/../tests/func/db_reload.sh --backup; fi
--- /dev/null
+#!/bin/bash
+# Install FusionForge packages from build.sh + dependencies
+#
+# Copyright (C) 2011 Roland Mas
+# Copyright (C) 2011 Olivier Berger - Institut Telecom
+# Copyright (C) 2014 Inria (Sylvain Beucler)
+#
+# This file is part of FusionForge. FusionForge is free software;
+# you can redistribute it and/or modify it under the terms of the
+# GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the Licence, or (at your option)
+# any later version.
+#
+# FusionForge is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with FusionForge; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+#set -x
+set -e
+. $(dirname $0)/common-backports
+
+# Install FusionForge packages
+if [ -e /etc/debian_version ]; then
+ export DEBIAN_FRONTEND=noninteractive
+ backports_deb
+ if dpkg-query -s fusionforge >/dev/null 2>&1; then
+ # Already installed, upgrading
+ UCF_FORCE_CONFFNEW=yes LANG=C DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
+ else
+ # Initial installation
+ UCF_FORCE_CONFFNEW=yes LANG=C DEBIAN_FRONTEND=noninteractive apt-get -y install fusionforge
+
+ # Additional components for testsuite
+ UCF_FORCE_CONFFNEW=yes apt-get install -y fusionforge-shell \
+ fusionforge-plugin-scmgit fusionforge-plugin-scmsvn fusionforge-plugin-scmbzr \
+ fusionforge-plugin-mediawiki fusionforge-plugin-moinmoin \
+ fusionforge-plugin-blocks locales-all
+ fi
+else
+ backports_rpm
+ if rpm -q fusionforge >/dev/null ; then
+ yum upgrade -y
+ else
+ # Initial installation
+ yum install -y fusionforge fusionforge-shell \
+ fusionforge-plugin-scmgit fusionforge-plugin-scmsvn \
+ fusionforge-plugin-mediawiki \
+ fusionforge-plugin-blocks fusionforge-plugin-online_help
+ fi
+fi
+
+# Dump clean DB
+if [ ! -e /root/dump ]; then $(dirname $0)/../tests/func/db_reload.sh --backup; fi
set -e
export DEBIAN_FRONTEND=noninteractive
-# Build an unofficial package for selenium and install it
-if ! dpkg-query -s selenium >/dev/null 2>&1 ; then
- version=2.35.0
- mkdir -p /usr/share/selenium/
- apt-get install -y wget
- wget -c http://selenium.googlecode.com/files/selenium-server-standalone-$version.jar \
- -O /usr/share/selenium/selenium-server.jar
-
- # Selenium dependencies
- apt-get -y install default-jre iceweasel
+if [ -z "$1" ]; then
+ echo "Usage:"
+ echo " $0 src/debian"
+ echo " $0 deb/debian"
+ echo " $0 src/centos"
+ echo " $0 rpm/centos"
+ exit 1
fi
+# Selenium dependencies and test dependencies
+# psmisc for db_reload.sh:killall
+if [ -e /etc/debian_version ]; then
+ apt-get -y install wget default-jre iceweasel
+ apt-get -y install phpunit phpunit-selenium patch psmisc patch
+else
+ yum -y install wget firefox java-1.6.0
+ yum install -y php-phpunit-PHPUnit php-phpunit-PHPUnit-Selenium psmisc patch
+fi
+
+# Install selenium (no packaged version available)
+version=2.39.0
+mkdir -p /usr/share/selenium/
+wget -c http://selenium.googlecode.com/files/selenium-server-standalone-$version.jar \
+ -O /usr/share/selenium/selenium-server.jar
+# Note: with >= 2.39.0:
+# http://selenium-release.storage.googleapis.com/X.YY/selenium-server-standalone-X.YY.Z.jar
+
service cron stop || true
-# Test dependencies
-# psmisc for db_reload.sh:killall
-apt-get -y install phpunit phpunit-selenium patch psmisc
-patch -N /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php <<'EOF' || true
+# Fix screenshot default black background (/usr/share/{php,pear}) (fix available upstream)
+patch -N /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php <<'EOF' || true
--- /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php-dist 2014-02-10 19:48:34.000000000 +0000
+++ /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php 2014-09-01 10:09:38.823051288 +0000
@@ -1188,7 +1188,7 @@
$this->testId . ".png\n";
EOF
+
+# Setup git+ssh and svn+ssh tests
+mkdir -p ~/.ssh/
+if ! [ -e ~/.ssh/id_rsa.pub ] ; then
+ ssh-keygen -f ~/.ssh/id_rsa -N ''
+ #cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+fi
+if ! [ -e ~/.ssh/config ] || ! grep -q StrictHostKeyChecking ~/.ssh/config ; then
+ echo StrictHostKeyChecking no >> ~/.ssh/config
+fi
+
# Now, start the functionnal test suite using phpunit and selenium
-/usr/src/fusionforge/tests/scripts/phpunit.sh $@
+$(dirname $0)/../tests/func/phpunit-selenium.sh $@
#!/bin/bash
# Aggressive desinstall for testing a clean re-install
-aptitude purge ~nforge ~npostgres ~nnss-pgsql ~napache2 ~nphp ~npostfix ~nexim4
+if [ -e /etc/debian_version ]; then
+ aptitude purge ~nforge ~npostgres ~nnss-pgsql ~napache2 ~nphp ~npostfix ~nexim4
+else
+ yum remove -y 'fusionforge*'
+fi
service postgresql stop
rm -rf /usr/share/fusionforge /usr/local/share/fusionforge /etc/fusionforge /var/lib/fusionforge
rm -rf /root/dump /var/lib/postgresql*/
--- /dev/null
+#!/bin/bash
+
+# First, make sure the distro is up-to-date
+if [ -e /etc/debian_version ]; then
+ aptitude update
+ aptitude -y dist-upgrade
+else
+ yum upgrade
+fi
+
+set -e
+
+# Then update the checked-out sources of FusionForge
+cd /usr/src/fusionforge/
+git pull
-#! /bin/bash
+#!/bin/bash
+# Wrapper to run the testsuite in a headless X server
# Check vncserver
if ! type vncserver 2>/dev/null
password
EOF
-# Setup ssh key and parameters
-cd
-mkdir -p .ssh
-if ! [ -e .ssh/id_rsa.pub ] ; then
- ssh-keygen -f .ssh/id_rsa -N ''
- cat .ssh/id_rsa.pub >> .ssh/authorized_keys
-fi
-if ! [ -e .ssh/config ] || ! grep -q StrictHostKeyChecking .ssh/config ; then
- echo StrictHostKeyChecking no >> .ssh/config
-fi
-
vncserver :1
DISPLAY=:1 $@
retcode=$?
get_config()
{
echo "Read config from tests/config/default"
- . tests/config/default
- if [ -f tests/config/`hostname` ]
+ . $(dirname $0)/config/default
+ if [ -f $(dirname $0)/config/`hostname` ]
then
echo "Read config from tests/config/`hostname`"
- . tests/config/`hostname`
+ . $(dirname $0)/config/`hostname`
fi
if [ ! -z "$1" ]
then
EOF
fi
}
-
-setup_debian_3rdparty_repo()
-{
-if [ -z "$HOST" ] ; then echo "HOST undefined" ;exit 1; fi
-if [ -z "$DEB3RD" ] ; then echo "DEB3RD undefined" ; exit 2 ; fi
-if [ -z "$DIST" ] ; then echo "DIST undefined" ; exit 3 ; fi
-echo "Installing debian 3rd party repo $DEB3RD $DIST on $HOST"
-ssh root@$HOST "echo \"deb $DEB3RD $DIST main\" > /etc/apt/sources.list.d/3rd-party.list"
-wget -q -O - ${DEB3RD}key | ssh root@$HOST "apt-key add -"
-}
-
-setup_redhat_3rdparty_repo()
-{
-if [ -z "$HOST" ] ; then echo "HOST undefined" ;exit 1; fi
-if [ -z "$RPM3RD" ] ; then echo "RPM3RD undefined" ; exit 2 ; fi
-echo "Installing redhat 3rd party repo $RPM3RD on $HOST"
-ssh root@$HOST "cat > /etc/yum.repos.d/FusionForge-3rdparty.repo" <<-EOF
-[FusionForge-3rdparty]
-name = Red Hat Enterprise \$releasever - fusionforge.org
-baseurl = $RPM3RD
-enabled = 1
-protect = 0
-gpgcheck = 0
-EOF
-}
{
if ! $KEEPVM
then
- tests/scripts/destroy_vm $@ || true
+ $(dirname $0)/destroy_vm $@ || true
fi
}
if $KEEPVM
then
# VM can already exist
- tests/scripts/start_vm $@
+ $(dirname $0)/start_vm $@
else
# Destroy the VM if found
- tests/scripts/stop_vm $@ || true
- if ! tests/scripts/start_vm $@
+ $(dirname $0)/stop_vm $@ || true
+ if ! $(dirname $0)/start_vm $@
then
echo "Could not start VM";
exit 2
then
echo "Keeping vm $@ alive"
else
- tests/scripts/stop_vm $@
+ $(dirname $0)/stop_vm $@
fi
}
--- /dev/null
+#!/bin/bash
+. $(dirname $0)/common-functions
+. $(dirname $0)/common-vm
+
+set -e
+
+get_config
+prepare_workspace
+
+export HOST=$1
+if [ -z "$HOST" ]; then
+ echo "Usage: $0 vm_hostname"
+ exit 1
+fi
+case $HOST in
+ debian7.local)
+ export DIST=wheezy
+ VM=debian7
+ INSTALL_OS=debian
+ ;;
+ debian8.local)
+ export DIST=jessie
+ VM=debian8
+ INSTALL_OS=debian
+ ;;
+ centos5.local)
+ VM=centos5
+ INSTALL_OS=centos
+ ;;
+ centos6.local)
+ VM=centos6
+ INSTALL_OS=centos
+ ;;
+ *)
+ export DIST=jessie
+ VM=debian8
+ INSTALL_OS=debian
+ ;;
+esac
+
+INSTALL_METHOD=$2
+if [ -z "$INSTALL_METHOD" ]; then INSTALL_METHOD='src'; fi
+
+destroy_vm_if_not_kept -t $VM $HOST
+start_vm_if_not_kept -t $VM $HOST
+
+# LXC post-install...
+if [ $INSTALL_OS == "debian" ]; then
+ ssh root@$HOST "echo \"deb $DEBMIRRORSEC $DIST/updates main\" > /etc/apt/sources.list.d/security.list"
+ ssh root@$HOST "echo 'APT::Install-Recommends \"false\";' > /etc/apt/apt.conf.d/01InstallRecommends"
+ ssh root@$HOST "apt-get update"
+fi
+
+ssh root@$HOST "apt-get install -y rsync"
+rsync -av --delete autoinstall src tests root@$HOST:/usr/src/fusionforge/
+ssh root@$HOST "/usr/src/fusionforge/autoinstall/build.sh"
+if [ $INSTALL_METHOD = "src" ]; then
+ ssh root@$HOST "/usr/src/fusionforge/autoinstall/install-src.sh"
+else
+ ssh root@$HOST "/usr/src/fusionforge/autoinstall/install.sh"
+fi
+
+# Run tests
+retcode=0
+echo "Run phpunit test on $HOST"
+# TESTGLOB='func/50_PluginsScmGit/*'
+ssh root@$HOST "/usr/src/fusionforge/autoinstall/vnc-run-testsuite.sh /usr/src/fusionforge/autoinstall/run-testsuite.sh $INSTALL_METHOD/$INSTALL_OS" || retcode=$?
+
+rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
+
+stop_vm_if_not_kept -t $VM $@
+exit $retcode
#! /bin/sh
-scriptdirname=`dirname $0`
-scriptdirparent=`cd $scriptdirname/..;pwd`
-scriptdir=$scriptdirparent/scripts
-configdir=$scriptdirparent/config
-. $scriptdirparent/scripts/common-vm
+scriptdir=$(dirname $0)
+configdir=$scriptdir/config
+. $(dirname $0)/common-vm
-read_param_vm $@
+read_param_vm "$@"
# Start script for this engine must exist
-if [ ! -x $scriptdirparent/${VMENGINE}/start ]
+if [ ! -x $scriptdir/${VMENGINE}/start ]
then
echo "Don't know how to run ${VMENGINE} engine"
- echo "$scriptdirparent/${VMENGINE}/start not found"
+ echo "$scriptdir/${VMENGINE}/start not found"
exit 4
else
- $scriptdirparent/${VMENGINE}/start
+ $scriptdir/${VMENGINE}/start
fi
# Loop until engine is up and ssh is running
--- /dev/null
+#! /bin/sh -e
+
+scriptdir=$(dirname $0)
+configdir=$scriptdir/config
+. $(dirname $0)/common-vm
+
+read_param_vm "$@"
+
+# Start script for this engine must exist
+if [ ! -x $scriptdir/${VMENGINE}/stop ]
+then
+ echo "Don't know how to stop ${VMENGINE} engine"
+ echo "$scriptdir/${VMENGINE}/stop not found"
+ exit 4
+else
+ $scriptdir/${VMENGINE}/stop
+fi
-#! /bin/sh
+#!/bin/bash
+
+set -e
TEST_ENV="$1"
# Test arg
if [ -z "$TEST_ENV" ]
then
- echo "Usage: $0 script"
- exit 1
+ echo "Usage: $0 testsuite_name"
+ exit 1
fi
export INSTALL_METHOD=${TEST_ENV%/*}
export INSTALL_OS=${TEST_ENV#*/}
if [ -z "$INSTALL_METHOD" ] || [ -z "$INSTALL_OS" ] ; then
- echo INSTALL_METHOD and INSTALL_OS required
- echo Example: INSTALL_METHOD=src INSTALL_OS=centos $0
+ echo "Usage: $0 testsuite_name"
+ echo "Example: $0 src/centos"
+ exit 1
fi
scriptdir=$(dirname $0)
cd $FORGE_HOME
# Initialize defaults
-[ ! -f tests/config/default ] || . tests/config/default
-[ ! -f tests/config/phpunit ] || . tests/config/phpunit
+. $scriptdir/../buildbot/config/default
+[ ! -f $scriptdir/../buildbot/config/phpunit ] || . $scriptdir/../buildbot/config/phpunit
SELENIUM_RC_DIR=/var/log
SELENIUM_RC_URL=${HUDSON_URL}job/${JOB_NAME}/ws/reports
EOF
echo "Starting Selenium"
-killall -9 java
+killall -9 java || true
timeout=300
PATH=/usr/lib/iceweasel:$PATH LANG=C java -jar /usr/share/selenium/selenium-server.jar -trustAllSSLCertificates -singleWindow &
pid=$!
i=0
while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 && kill -0 $pid 2>/dev/null; do
+ echo "Waiting for Selenium..."
sleep 1
i=$(($i+1))
done
if [ $i = $timeout ] || ! kill -0 $pid 2>/dev/null; then
- echo "Selenium failed to start."
+ echo "Selenium failed to start!"
netstat -tnl
exit 1
fi
+++ /dev/null
-#! /bin/sh
-
-# Setup Env
-relativepath=`dirname $0`
-absolutetestspath=`cd $relativepath/..; pwd`
-cd $absolutetestspath
-
-# Read defaults and hostname specific
-. config/default
-if [ -f config/`hostname` ]
-then
- . config/`hostname`
-fi
-
-case $1 in
- BUILDERDIR)
- BUILDERDIR=${BUILDERDIR:-$HOME/builder/}
- echo $BUILDERDIR
- ;;
- REPOPATH)
- WORKDIR=`cd $absolutetestspath/../..; pwd`
- # Jenkins will set WORKSPACE
- WORKSPACE=${WORKSPACE:-$WORKDIR}
- REPOPATH=$WORKSPACE/build
- echo $REPOPATH
- ;;
-esac
+++ /dev/null
-#!/usr/bin/php
-<?php
-
-$LOG_FILE = '/tmp/catch_mail.log';
-
-// Clear log file ?
-if ($argv[1] == '-c') {
- if (file_exists($LOG_FILE)) {
- unlink($LOG_FILE);
- }
- exit(0);
-}
-
-// Catch the mail
-$stdin = fopen('php://stdin', 'r');
-$in = '';
-$inBody = 0;
-$cr = 0;
-while (!feof($stdin)) {
- $line = rtrim(fgets($stdin), "\n\r");
-
- if ($inBody) {
- $in .= $line . "\n";
- }
- elseif (! $line) {
- $inBody = 1;
- $in .= "\n";
- }
- elseif (preg_match('/^(\w+):.*/', $line, $matches)) {
- switch (strtolower($matches[1])) {
- case 'from':
- case 'to':
- case 'bcc':
- case 'subject':
- $in .= $line . "\n";
- break;
- }
- }
-}
-
-$fp = fopen($LOG_FILE, 'w');
-fwrite($fp, $in);
-fclose($fp);
-
-?>
+++ /dev/null
-#! /bin/sh
-# This script will build the Debian packages to be tested
-#
-# Copyright (C) 2011 Roland Mas
-# Copyright (C) 2011 Olivier Berger - Institut Telecom
-# Copyright (C) 2014 Inria (Sylvain Beucler)
-#
-# This file is part of FusionForge. FusionForge is free software;
-# you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the Licence, or (at your option)
-# any later version.
-#
-# FusionForge is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with FusionForge; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-set -e
-export DEBIAN_FRONTEND=noninteractive
-
-# Install build dependencies
-apt-get -y install mini-dinstall dput devscripts fakeroot
-apt-get -y install build-essential \
- $(grep Build-Depends /usr/src/fusionforge/src/debian/control.in | sed -e 's/Build-Depends: //' -e 's/(.*)//')
-apt-get -y install php5-cli # debian/gen_control.sh
-
-
-# Populate a local Debian packages repository for APT managed with mini-dinstall
-#rm -rf /usr/src/debian-repository
-mkdir -p /usr/src/debian-repository
-
-cat >/root/.mini-dinstall.conf <<EOF
-[DEFAULT]
-archivedir = /usr/src/debian-repository
-archive_style = flat
-
-verify_sigs = 0
-
-generate_release = 1
-release_signscript = /usr/src/fusionforge/tests/scripts/deb/mini-dinstall-sign.sh
-
-max_retry_time = 3600
-mail_on_success = false
-
-[local]
-EOF
-
-export GNUPGHOME=/usr/src/gnupg
-if [ ! -e $GNUPGHOME ]; then
- mkdir -m 700 $GNUPGHOME
- # Quick 'n Dirty hack to get entropy on VMs
- # https://bugs.launchpad.net/ubuntu/+source/gnupg/+bug/706011
- # (don't do this for a public repo!)
- apt-get install -y rng-tools
- echo HRNGDEVICE=/dev/urandom >> /etc/default/rng-tools
- service rng-tools restart
- gpg --batch --gen-key <<EOF
- Key-Type: RSA
- Key-Length: 2048
- Subkey-Type: RSA
- Subkey-Length: 2048
- Name-Real: FusionForge
- Expire-Date: 0
- %commit
-EOF
-fi
-gpg --export FusionForge -a > /usr/src/debian-repository/key.asc
-apt-key add /usr/src/debian-repository/key.asc
-
-mini-dinstall -b
-
-# Configure debian package building tools so as to use the local repo
-if [ ! -f /root/.dput.cf ]; then
- cat > /root/.dput.cf <<EOF
-[local]
-fqdn = localhost
-incoming = /usr/src/debian-repository/mini-dinstall/incoming
-method = local
-run_dinstall = 0
-allow_unsigned_uploads = yes
-post_upload_command = mini-dinstall -b
-allowed_distributions = local
-EOF
-fi
-
-if [ ! -f /root/.devscripts ]; then
- cat > /root/.devscripts <<EOF
-DEBRELEASE_UPLOADER=dput
-DEBUILD_DPKG_BUILDPACKAGE_OPTS=-i
-EOF
-fi
-
-# Finally, build the FusionForge packages
-cd /usr/src/fusionforge/src
-f=$(mktemp)
-cp debian/changelog $f
-version=$(dpkg-parsechangelog | sed -n 's/^Version: \([0-9.]\+\(\~rc[0-9]\)\?\).*/\1/p')+$(date +%Y%m%d%H%M)
-debian/rules debian/control # re-gen debian/control
-dch --newversion $version-1 --distribution local --force-distribution "Autobuilt."
-make dist
-mv fusionforge-$(make version).tar.bz2 ../fusionforge_$version.orig.tar.bz2
-debuild -us -uc -tc # using -tc so 'git status' is readable
-
-# Install built packages into the local repo
-debrelease -f local
-mv $f debian/changelog
-
-# Declare the repo so that packages become installable
-echo 'deb file:///usr/src/debian-repository local/' > /etc/apt/sources.list.d/local.list
-apt-get update
+++ /dev/null
-#! /bin/sh
-# Install FusionForge packages from build.sh + dependencies
-#
-# Copyright (C) 2011 Roland Mas
-# Copyright (C) 2011 Olivier Berger - Institut Telecom
-# Copyright (C) 2014 Inria (Sylvain Beucler)
-#
-# This file is part of FusionForge. FusionForge is free software;
-# you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the Licence, or (at your option)
-# any later version.
-#
-# FusionForge is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with FusionForge; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-#set -x
-set -e
-export DEBIAN_FRONTEND=noninteractive
-
-# fusionforge-plugin-scmbzr depends on loggerhead (>= 1.19~bzr477~),
-# but wheezy only has 1.19~bzr461-1, so we need to manually "Backport"
-# a more recent dependency
-if grep -q ^7 /etc/debian_version && ! dpkg-query -s loggerhead >/dev/null 2>&1 ; then
- # install loggerhead with its dependencies
- # we need gdebi to make sure dependencies are installed too (simple dpkg -i won't)
- apt-get -y install gdebi-core wget
- wget -c http://snapshot.debian.org/archive/debian/20121107T152130Z/pool/main/l/loggerhead/loggerhead_1.19%7Ebzr477-1_all.deb
- gdebi --non-interactive loggerhead_1.19~bzr477-1_all.deb
-fi
-
-# Install locales-all which is a Recommends and not a Depends
-if ! dpkg -l locales-all | grep -q ^ii ; then
- apt-get -y install locales-all
-fi
-
-# Install FusionForge packages
-apt-get update
-if dpkg-query -s fusionforge >/dev/null 2>&1; then
- # Already installed, upgrading
- UCF_FORCE_CONFFNEW=yes LANG=C DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
-else
- # Initial installation
- UCF_FORCE_CONFFNEW=yes LANG=C DEBIAN_FRONTEND=noninteractive apt-get -y install fusionforge
-
- # Additional components for testsuite
- UCF_FORCE_CONFFNEW=yes apt-get install -y fusionforge-shell \
- fusionforge-plugin-scmgit fusionforge-plugin-scmsvn fusionforge-plugin-scmbzr \
- fusionforge-plugin-mediawiki fusionforge-plugin-moinmoin \
- fusionforge-plugin-blocks
-fi
-
-# Dump clean DB
-if [ ! -e /root/dump ]; then $(dirname $0)/../../func/db_reload.sh --backup; fi
+++ /dev/null
-#!/bin/bash
-
-# First, make sure the Debian distro is up-to-date
-aptitude update
-aptitude -y dist-upgrade
-
-set -e
-
-# Then update the checked-out sources of FusionForge
-cd /usr/src/fusionforge/
-git pull
+++ /dev/null
-#! /bin/sh
-
-set -e
-
-# Setup Env
-relativepath=`dirname $0`
-absolutesourcepath=`cd $relativepath/../..; pwd`
-cd $absolutesourcepath
-BUILDERDIR=$(./tests/scripts/builder_get_config.sh BUILDERDIR)
-REPOPATH=$(./tests/scripts/builder_get_config.sh REPOPATH)
-
-DISTS="wheezy jessie"
-
-[ ! -d $REPOPATH/debian ] || rm -r $REPOPATH/debian
-mkdir -p $REPOPATH/debian/conf
-DEFAULTKEY=buildbot@$(hostname -f)
-SIGNKEY=${DEBEMAIL:-$DEFAULTKEY}
-
-:> $REPOPATH/debian/conf/distributions
-for DIST in $DISTS ; do
- cat >> $REPOPATH/debian/conf/distributions <<EOF
-Codename: $DIST
-Suite: $DIST
-Components: main
-UDebComponents: main
-Architectures: amd64 i386 source
-Origin: buildbot.fusionforge.org
-Description: FusionForge 3rd-party autobuilt repository
-SignWith: $SIGNKEY
-
-EOF
-done
-
-# Backport mediawiki from Jessie to Wheezy
-# make -C 3rd-party/mediawiki DIST=wheezy
-
-# Build selenium packages for Wheezy+Jessie
-for DIST in $DISTS ; do
- make -C 3rd-party/selenium DIST=$DIST
-done
-
-# Write key
-gpg --export --armor > ${REPOPATH}/debian/key
-
+++ /dev/null
-#!/bin/sh
-. tests/scripts/common-functions
-. tests/scripts/common-vm
-
-set -e
-
-get_config
-prepare_workspace
-
-export HOST=$1
-if [ -z "$HOST" ]; then
- echo "Usage: $0 vm_hostname"
- exit 1
-fi
-case $HOST in
- debian7.local)
- export DIST=wheezy
- VM=debian7
- ;;
- debian8.local)
- export DIST=jessie
- VM=debian8
- ;;
- *)
- export DIST=jessie
- VM=debian8
- ;;
-esac
-
-destroy_vm_if_not_kept -t $VM $HOST
-start_vm_if_not_kept -t $VM $HOST
-
-# LXC post-install...
-ssh root@$HOST "echo \"deb $DEBMIRRORSEC $DIST/updates main\" > /etc/apt/sources.list.d/security.list"
-ssh root@$HOST "echo 'APT::Install-Recommends \"false\";' > /etc/apt/apt.conf.d/01InstallRecommends"
-ssh root@$HOST "apt-get update"
-
-# Transfer preseeding
-#cat tests/preseed/* | sed s/@FORGE_ADMIN_PASSWORD@/$FORGE_ADMIN_PASSWORD/ | ssh root@$HOST "LANG=C debconf-set-selections"
-
-ssh root@$HOST "apt-get install -y rsync"
-rsync -av --delete src tests root@$HOST:/usr/src/fusionforge/
-ssh root@$HOST "/usr/src/fusionforge/tests/scripts/deb/build.sh"
-ssh root@$HOST "/usr/src/fusionforge/tests/scripts/deb/install.sh"
-
-# Run tests
-retcode=0
-echo "Run phpunit test on $HOST"
-# TESTGLOB='func/50_PluginsScmGit/*'
-ssh root@$HOST "/usr/src/fusionforge/tests/func/vncxstartsuite.sh /usr/src/fusionforge/tests/scripts/deb/run-testsuite.sh deb/debian" || retcode=$?
-
-rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
-
-stop_vm_if_not_kept -t $VM $@
-exit $retcode
+++ /dev/null
-#!/bin/sh
-. tests/scripts/common-functions
-. tests/scripts/common-vm
-
-set -e
-
-get_config
-prepare_workspace
-
-export HOST=$1
-if [ -z "$HOST" ]; then
- echo "Usage: $0 vm_hostname"
- exit 1
-fi
-case $HOST in
- centos6.local)
- VM=centos6
- ;;
- *)
- VM=centos6
- ;;
-esac
-
-destroy_vm_if_not_kept -t $VM $HOST
-start_vm_if_not_kept -t $VM $HOST
-
-ssh root@$HOST "yum install -y rsync"
-rsync -av --delete src tests root@$HOST:/usr/src/fusionforge/
-ssh root@$HOST "/usr/src/fusionforge/tests/scripts/rpm/build.sh"
-ssh root@$HOST "/usr/src/fusionforge/tests/scripts/rpm/install.sh"
-
-# Run tests
-retcode=0
-echo "Run phpunit test on $HOST in $FORGE_HOME"
-ssh root@$HOST "/usr/src/fusionforge/tests/func/vncxstartsuite.sh /usr/src/fusionforge/tests/scripts/rpm/run-testsuite.sh" || retcode=$?
-
-rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
-
-stop_vm_if_not_kept -t $VM $@
-exit $retcode
+++ /dev/null
-#!/bin/sh
-. tests/scripts/common-functions
-. tests/scripts/common-vm
-
-set -e
-
-get_config
-prepare_workspace
-
-export HOST=$1
-if [ -z "$HOST" ]; then
- echo "Usage: $0 vm_hostname"
- exit 1
-fi
-case $HOST in
- centos5.local)
- VM=centos5
- ;;
- centos6.local)
- VM=centos6
- ;;
- *)
- VM=centos6
- ;;
-esac
-
-destroy_vm_if_not_kept -t $VM $HOST
-start_vm_if_not_kept -t $VM $HOST
-
-ssh root@$HOST "yum install -y rsync"
-rsync -av --delete src tests root@$HOST:/usr/src/fusionforge/
-#ssh root@$HOST "/usr/src/fusionforge/tests/scripts/rpm/build.sh"
-ssh root@$HOST "/usr/src/fusionforge/tests/scripts/rpm/install-src.sh"
-
-# Run tests
-retcode=0
-echo "Run phpunit test on $HOST in $FORGE_HOME"
-ssh root@$HOST "/usr/src/fusionforge/tests/func/vncxstartsuite.sh /usr/src/fusionforge/tests/scripts/rpm/run-testsuite.sh src/centos" || retcode=$?
-
-rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
-
-stop_vm_if_not_kept -t $VM $@
-exit $retcode
+++ /dev/null
-#!/bin/sh
-. tests/scripts/common-functions
-. tests/scripts/common-vm
-
-set -e
-
-get_config
-prepare_workspace
-
-export HOST=$1
-if [ -z "$HOST" ]; then
- echo "Usage: $0 vm_hostname"
- exit 1
-fi
-case $HOST in
- debian7.local)
- export DIST=wheezy
- VM=debian7
- ;;
- debian8.local)
- export DIST=jessie
- VM=debian8
- ;;
- *)
- export DIST=jessie
- VM=debian8
- ;;
-esac
-
-destroy_vm_if_not_kept -t $VM $HOST
-start_vm_if_not_kept -t $VM $HOST
-
-# LXC post-install...
-ssh root@$HOST "echo \"deb $DEBMIRRORSEC $DIST/updates main\" > /etc/apt/sources.list.d/security.list"
-ssh root@$HOST "echo 'APT::Install-Recommends \"false\";' > /etc/apt/apt.conf.d/01InstallRecommends"
-ssh root@$HOST "apt-get update"
-
-ssh root@$HOST "apt-get install -y rsync"
-rsync -av --delete src tests root@$HOST:/usr/src/fusionforge/
-#ssh root@$HOST "/usr/src/fusionforge/tests/scripts/deb/build.sh"
-ssh root@$HOST "/usr/src/fusionforge/tests/scripts/deb/install-src.sh"
-
-# Run tests
-retcode=0
-echo "Run phpunit test on $HOST"
-ssh root@$HOST "/usr/src/fusionforge/tests/func/vncxstartsuite.sh /usr/src/fusionforge/tests/scripts/deb/run-testsuite.sh src/debian" || retcode=$?
-
-rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
-
-stop_vm_if_not_kept -t $VM $@
-exit $retcode
+++ /dev/null
-#! /bin/sh -e
-
-# Setup Env
-relativepath=`dirname $0`
-absolutesourcepath=`cd $relativepath/../..; pwd`
-cd $absolutesourcepath
-BUILDERDIR=$(./tests/scripts/builder_get_config.sh BUILDERDIR)
-REPOPATH=$(./tests/scripts/builder_get_config.sh REPOPATH)
-
-[ ! -d $REPOPATH/redhat ] || rm -r $REPOPATH/redhat
-mkdir -p $REPOPATH/redhat
-
-# Build redhat 3rd-party
-make -C 3rd-party -f Makefile.rh BUILDRESULT=$REPOPATH/redhat
-
+++ /dev/null
-#!/bin/bash
-# Build FusionForge .rpm packages
-#
-# Copyright (C) 2014 Inria (Sylvain Beucler)
-#
-# This file is part of FusionForge. FusionForge is free software;
-# you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the Licence, or (at your option)
-# any later version.
-#
-# FusionForge is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with FusionForge; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# Build .rpm packages
-set -e
-
-# Install build dependencies
-yum install -y gettext tar bzip2 rpm-build createrepo
-yum install -y php-cli # rpm/gen_spec.sh
-
-# Build package
-cd /usr/src/fusionforge/src/
-version="$(make version)"
-snapshot="+$(date +%Y%m%d%H%M)"
-rpm/gen_spec.sh $version $snapshot
-make dist
-mkdir -p ../build/SOURCES/ ../build/SPECS/
-mv fusionforge-$(make version).tar.bz2 ../build/SOURCES/fusionforge-$version$snapshot.tar.bz2
-chown -h root: ../build/SOURCES/fusionforge-$version$snapshot.tar.bz2
-cp fusionforge.spec ../build/SPECS/
-rpmbuild ../build/SPECS/fusionforge.spec --define "_topdir $(pwd)/../build" -ba
-
-(cd ../build/RPMS/ && createrepo .)
-cat <<EOF > /etc/yum.repos.d/local.repo
-[local]
-name=local
-baseurl=file:///usr/src/fusionforge/build/RPMS/
-enabled=1
-gpgcheck=0
-EOF
+++ /dev/null
-#! /bin/sh
-# Install FusionForge from source, and its dependencies
-#
-# Copyright (C) 2014 Inria (Sylvain Beucler)
-#
-# This file is part of FusionForge. FusionForge is free software;
-# you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the Licence, or (at your option)
-# any later version.
-#
-# FusionForge is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with FusionForge; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# Fedora/RHEL/CentOS version:
-os_version=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))
-
-if ! rpm -q fedora-release >/dev/null; then
- # EPEL - http://download.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.html
- if ! rpm -q epel-release >/dev/null; then
- rpm -ivh http://fr2.rpmfind.net/linux/epel/6/i386/epel-release-6-8.noarch.rpm
- fi
-
- # Prepare manual backports
- cat <<'EOF' > /etc/yum.repos.d/fedora-source.repo
-[fedora]
-name=Fedora 20
-failovermethod=priority
-metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=$basearch
-enabled=0
-gpgcheck=0
-[fedora-source]
-name=Fedora 20 - Source
-failovermethod=priority
-metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-20&arch=$basearch
-enabled=0
-gpgcheck=0
-EOF
- yum install -y yum-utils # yumdownloader
-fi
-
-if yum list libnss-pgsql >/dev/null 2>&1; then
- yum install -y libnss-pgsql
-else
- # libnss-pgsql: id., plus http://yum.postgresql.org/8.4/redhat/rhel-5-x86_64/
- yumdownloader --enablerepo=fedora --source libnss-pgsql
- DEPS="gcc postgresql-devel xmlto"
- yum install -y $DEPS
- rpmbuild --rebuild libnss-pgsql-*.src.rpm
- yum remove -y $DEPS
- rpm -ivh ~/rpmbuild/RPMS/x86_64/libnss-pgsql-*.x86_64.rpm
-fi
-
-if yum list moin >/dev/null 2>&1; then
- yum install -y moin
-else
- # moin: no available package for RHEL; though 'moin' is available in Fedora
- yumdownloader --enablerepo=fedora --source moin
- DEPS="python-devel"
- yum install -y $DEPS
- rpmbuild --rebuild moin-*.src.rpm
- yum remove -y $DEPS
- rpm -ivh ~/rpmbuild/RPMS/noarch/moin-*.noarch.rpm
-fi
-
-if yum list php-htmlpurifier-htmlpurifier >/dev/null 2>&1; then
- yum install -y php-htmlpurifier-htmlpurifier
-else
- # moin: no available package for RHEL; though 'moin' is available in Fedora
- yumdownloader --enablerepo=fedora --source php-htmlpurifier-htmlpurifier
- DEPS="php-channel-htmlpurifier" # for v4.3.0-6.fc20
- yum install -y $DEPS
- rpmbuild --rebuild php-htmlpurifier-htmlpurifier-*.src.rpm
- yum remove -y $DEPS
- yum install -y ~/rpmbuild/RPMS/noarch/php-htmlpurifier-htmlpurifier-*.noarch.rpm
-fi
-
-# TODO: postfix: rebuild from RHEL/CentOS sources with pgsql enabled,
-# so we can test SSH
-
-# Install FusionForge packages
-yum install -y make gettext php-cli php-pgsql \
- httpd mod_ssl postgresql-server \
- subversion viewvc \
- mediawiki119 \
- moin mod_wsgi python-psycopg2
-
-cd /usr/src/fusionforge/src/
-make
-make install-base install-shell
-make install-plugin-scmsvn install-plugin-blocks \
- install-plugin-mediawiki install-plugin-moinmoin \
- install-plugin-online_help
-# adapt .ini configuration in /etc/fusionforge/config.ini.d/
-make post-install-base post-install-plugin-scmsvn post-install-plugin-blocks \
- post-install-plugin-mediawiki post-install-plugin-moinmoin \
- post-install-plugin-online_help
-
-# Dump clean DB
-if [ ! -e /root/dump ]; then $(dirname $0)/../../func/db_reload.sh --backup; fi
+++ /dev/null
-#!/bin/bash
-# Install FusionForge and its dependencies
-#
-# Copyright (C) 2014 Inria (Sylvain Beucler)
-#
-# This file is part of FusionForge. FusionForge is free software;
-# you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the Licence, or (at your option)
-# any later version.
-#
-# FusionForge is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with FusionForge; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# postgresql-server
-# php-cli php-pgsql
-# httpd php
-# nscd # no unscd T-T
-
-# get_news_notapproved.pl:
-# perl perl-DBI perl-Text-Autoformat perl-Mail-Sendmail
-
-# php-htmlpurifier-htmlpurifier # fedora
-# htmlpurifier # pear
-# pear channel-discover htmlpurifier.org
-# pear install hp/HTMLPurifier
-# Note: htmlpurifier required in -common: group->forum->textsanitizer->htmlpurifier
-# arc # vendor/
-# graphite # vendor/
-# php-pear-CAS # epel
-# php-simplepie # epel or common/rss/simplepie.inc
-
-# postfix: needs to be recompiled, el6 doesn't have pgsql support enabled (conditional in .spec)
-
-# mediawiki (provided by mediawiki119): EPEL
-
-# Fedora/RHEL/CentOS version:
-os_version=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))
-
-if ! rpm -q fedora-release >/dev/null; then
- # EPEL - http://download.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.html
- if ! rpm -q epel-release >/dev/null; then
- rpm -ivh http://fr2.rpmfind.net/linux/epel/6/i386/epel-release-6-8.noarch.rpm
- fi
-
- # Prepare manual backports
- cat <<'EOF' > /etc/yum.repos.d/fedora-source.repo
-[fedora]
-name=Fedora 20
-failovermethod=priority
-metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=$basearch
-enabled=0
-gpgcheck=0
-[fedora-source]
-name=Fedora 20 - Source
-failovermethod=priority
-metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-20&arch=$basearch
-enabled=0
-gpgcheck=0
-EOF
- yum install -y yum-utils # yumdownloader
-fi
-
-if yum list libnss-pgsql >/dev/null 2>&1; then
- yum install -y libnss-pgsql
-else
- # libnss-pgsql: id., plus http://yum.postgresql.org/8.4/redhat/rhel-5-x86_64/
- yumdownloader --enablerepo=fedora --source libnss-pgsql
- DEPS="gcc postgresql-devel xmlto"
- yum install -y $DEPS
- rpmbuild --rebuild libnss-pgsql-*.src.rpm
- yum remove -y $DEPS
- rpm -ivh ~/rpmbuild/RPMS/x86_64/libnss-pgsql-*.x86_64.rpm
-fi
-
-if yum list moin >/dev/null 2>&1; then
- yum install -y moin
-else
- # moin: no available package for RHEL; though 'moin' is available in Fedora
- yumdownloader --enablerepo=fedora --source moin
- DEPS="python-devel"
- yum install -y $DEPS
- rpmbuild --rebuild moin-*.src.rpm
- yum remove -y $DEPS
- rpm -ivh ~/rpmbuild/RPMS/noarch/moin-*.noarch.rpm
-fi
-
-if yum list php-htmlpurifier-htmlpurifier >/dev/null 2>&1; then
- yum install -y php-htmlpurifier-htmlpurifier
-else
- # moin: no available package for RHEL; though 'moin' is available in Fedora
- yumdownloader --enablerepo=fedora --source php-htmlpurifier-htmlpurifier
- DEPS="php-channel-htmlpurifier" # for v4.3.0-6.fc20
- yum install -y $DEPS
- rpmbuild --rebuild php-htmlpurifier-htmlpurifier-*.src.rpm
- yum remove -y $DEPS
- yum install -y ~/rpmbuild/RPMS/noarch/php-htmlpurifier-htmlpurifier-*.noarch.rpm
-fi
-
-# TODO: postfix: rebuild from RHEL/CentOS sources with pgsql enabled,
-# so we can test SSH
-
-if rpm -q fusionforge >/dev/null ; then
- yum upgrade -y
-else
- # Initial installation
- yum install -y fusionforge fusionforge-shell \
- fusionforge-plugin-scmgit fusionforge-plugin-scmsvn \
- fusionforge-plugin-mediawiki \
- fusionforge-plugin-blocks fusionforge-plugin-online_help
-fi
-
-# Dump clean DB
-if [ ! -e /root/dump ]; then $(dirname $0)/../../func/db_reload.sh --backup; fi
+++ /dev/null
-#!/bin/bash -x
-# Run FusionForge's PHPUnit+Selenium testsuite
-#
-# Copyright (C) 2011 Olivier Berger - Institut Telecom
-# Copyright (C) 2014 Inria (Sylvain Beucler)
-#
-# This file is part of FusionForge. FusionForge is free software;
-# you can redistribute it and/or modify it under the terms of the
-# GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the Licence, or (at your option)
-# any later version.
-#
-# FusionForge is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with FusionForge; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-set -e
-
-# Build an unofficial package for selenium and install it
-if ! rpm -q selenium >/dev/null ; then
- version=2.35.0
- mkdir -p /usr/share/selenium/
- yum install -y wget
- wget -c http://selenium.googlecode.com/files/selenium-server-standalone-$version.jar \
- -O /usr/share/selenium/selenium-server.jar
-
- # Selenium dependencies
- yum -y install firefox java-1.6.0
-fi
-
-service crond stop || true
-
-# Test dependencies (EPEL)
-yum install -y php-phpunit-PHPUnit php-phpunit-PHPUnit-Selenium
-
-# Install a fake sendmail to catch all outgoing emails.
-#perl -spi -e s#/usr/sbin/sendmail#$FORGE_HOME/tests/scripts/catch_mail.php# $config_path/config.ini.d/defaults.ini
-
-# Now, start the functionnal test suite using phpunit and selenium
-/usr/src/fusionforge/tests/scripts/phpunit.sh rpm/centos
+++ /dev/null
-#!/bin/bash
-# Aggressive desinstall for testing a clean re-install
-yum remove -y 'fusionforge*'
-service postgresql stop
-rm -rf /usr/share/fusionforge /usr/local/share/fusionforge /etc/fusionforge /var/lib/fusionforge
-rm -rf /root/dump /var/lib/pgsql*/
+++ /dev/null
-#! /bin/sh -e
-
-scriptdirname=`dirname $0`
-scriptdirparent=`cd $scriptdirname/..;pwd`
-scriptdir=$scriptdirparent/scripts
-configdir=$scriptdirparent/config
-. $scriptdirparent/scripts/common-vm
-
-read_param_vm "$@"
-
-# Start script for this engine must exist
-if [ ! -x $scriptdirparent/${VMENGINE}/stop ]
-then
- echo "Don't know how to stop ${VMENGINE} engine"
- echo "$scriptdirparent/${VMENGINE}/stop not found"
- exit 4
-else
- $scriptdirparent/${VMENGINE}/stop
-fi
[Desktop Entry]
Encoding=UTF-8
Name=Build + inst
-Exec=sh -c "/usr/src/fusionforge/vm/scripts/build.sh ; /usr/src/fusionforge/vm/scripts/install.sh ; echo Press Enter... ; read i"
+Exec=sh -c "/usr/src/fusionforge/autoinstall/build.sh ; /usr/src/fusionforge/autoinstall/install.sh ; echo Press Enter... ; read i"
Terminal=true
Type=Application
[Desktop Entry]
Encoding=UTF-8
Name=Run testsuite
-Exec=sh -c "/usr/src/fusionforge/vm/scripts/run-testsuite.sh ; echo Press Enter... ; read i"
+Exec=sh -c "/usr/src/fusionforge/autoinstall/run-testsuite.sh ; echo Press Enter... ; read i"
Terminal=true
Type=Application