[Fusionforge-commits] FusionForge branch GUM updated. c884fd624dcfc77ecb05738add16e7244aceeb4a

Sylvain Beucler beuc-inria at fusionforge.org
Mon Aug 25 18:07:24 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, GUM has been updated
       via  c884fd624dcfc77ecb05738add16e7244aceeb4a (commit)
       via  be852d611d24da2550300e3fa029eaf0c7f7e2e3 (commit)
       via  8098354023304d785ce53bf978c0efcb3dca62f0 (commit)
       via  c5d7cc9e8c9d782863725ee6b9610a8c7061dd80 (commit)
       via  5be30377d0b324cf62c51ebad56fd5e19752b556 (commit)
       via  357741d96cdb0b80d0c65f945053cb44001b8c2d (commit)
      from  443e269123633fc5948ef559ba1e90c99777d2df (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c884fd624dcfc77ecb05738add16e7244aceeb4a
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Aug 25 18:02:39 2014 +0200

    testsuite: run through $DISPLAY rather than xstartup+redirects+tail+etc.

diff --git a/tests/func/vncxstartsuite.sh b/tests/func/vncxstartsuite.sh
index c5431d7..5ff44c9 100755
--- a/tests/func/vncxstartsuite.sh
+++ b/tests/func/vncxstartsuite.sh
@@ -37,20 +37,7 @@ if type apt-get 2>/dev/null ; then
     apt-get -y install xfonts-base
 fi
 
-[ -d "/root/.vnc" ] || mkdir /root/.vnc 
-
-# Setup X11 to start phpunit
-cat > /root/.vnc/xstartup<<EOF
-#! /bin/bash
-: > /root/phpunit.exitcode
-INSTALL_METHOD=$INSTALL_METHOD INSTALL_OS=$INSTALL_OS $@ &> /var/log/phpunit.log 2>&1 &
-echo \$! > /root/phpunit.pid
-wait %1
-echo \$? > /root/phpunit.exitcode
-EOF
-chmod +x /root/.vnc/xstartup
-
-# Setup vnc password
+# Setup vnc password - otherwise vncserver prompts it
 vncpasswd <<EOF
 password
 password
@@ -67,15 +54,9 @@ if ! [ -e .ssh/config ] || ! grep -q StrictHostKeyChecking .ssh/config ; then
     echo StrictHostKeyChecking no >> .ssh/config
 fi
 
-# Start vnc server (that will start phpunit)
 vncserver :1
-sleep 5
-pid=$(cat /root/phpunit.pid)
-tail -f /var/log/phpunit.log --pid=$pid
-#wait $pid
-sleep 5
-
-retcode=$(cat /root/phpunit.exitcode)
+DISPLAY=:1 INSTALL_METHOD=$INSTALL_METHOD INSTALL_OS=$INSTALL_OS $@
+retcode=$?
 vncserver -kill :1 || retcode=$?
 
 exit $retcode

commit be852d611d24da2550300e3fa029eaf0c7f7e2e3
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Aug 25 17:22:48 2014 +0200

    testsuite: get it to work with new install system and vm scripts; improve error reporting; simplify nscd handling

diff --git a/src/post-install.d/web/configure.sh b/src/post-install.d/web/configure.sh
index 67852b0..70fd3d6 100755
--- a/src/post-install.d/web/configure.sh
+++ b/src/post-install.d/web/configure.sh
@@ -73,4 +73,6 @@ fi
 apache_service=$(forge_get_config apache_service)
 if service $apache_service status; then
     service $apache_service reload
+else
+    service $apache_service restart
 fi
diff --git a/tests/func/Testing/SeleniumForge.php b/tests/func/Testing/SeleniumForge.php
index 1b1aa18..3195918 100644
--- a/tests/func/Testing/SeleniumForge.php
+++ b/tests/func/Testing/SeleniumForge.php
@@ -61,7 +61,11 @@ class FForge_SeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
 		}
 		if (defined('DB_INIT_CMD')) {
 			// Reload a fresh database before running this test suite.
-			system(DB_INIT_CMD);
+			$ret = 0;
+			passthru(DB_INIT_CMD, $ret);
+			ob_flush();
+			if ($ret != 0)
+				die('DB_INIT_CMD ('.DB_INIT_CMD.') failed');
 		}
 		$this->reload_nscd();
 
@@ -130,8 +134,7 @@ class FForge_SeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase
 
 	protected function reload_nscd()
 	{
-		$this->runCommand("service unscd restart > /dev/null 2>&1 || service nscd restart > /dev/null 2>&1 || true");
-		sleep (1); // Give it some time to wake up
+		$this->runCommand("nscd -i all >/dev/null");
 	}
 
 	protected function init() {
diff --git a/tests/func/db_reload.sh b/tests/func/db_reload.sh
index 059371e..65eef8c 100755
--- a/tests/func/db_reload.sh
+++ b/tests/func/db_reload.sh
@@ -167,10 +167,4 @@ start_database
 start_apache
 
 echo "Flushing/restarting nscd"
-rm -f /var/cache/nscd/* || true
-if type invoke-rc.d 2>/dev/null
-then
-    invoke-rc.d unscd restart || invoke-rc.d nscd restart || true
-else
-    service unscd restart || service nscd restart || true
-fi
+nscd -i all
diff --git a/tests/func/vncxstartsuite.sh b/tests/func/vncxstartsuite.sh
index 4b9c4da..c5431d7 100755
--- a/tests/func/vncxstartsuite.sh
+++ b/tests/func/vncxstartsuite.sh
@@ -4,8 +4,7 @@ TEST_ENV="$1"
 # Test arg
 if [ -z "$TEST_ENV" ]
 then
-	echo "Usage: $0 <TEST_ENV>"
-	echo "  examples: src/debian, deb/debian, rpm/centos"
+	echo "Usage: $0 script"
 	exit 1
 fi
 
@@ -44,7 +43,7 @@ fi
 cat > /root/.vnc/xstartup<<EOF
 #! /bin/bash
 : > /root/phpunit.exitcode
-INSTALL_METHOD=$INSTALL_METHOD INSTALL_OS=$INSTALL_OS $TEST_HOME/scripts/phpunit.sh &> /var/log/phpunit.log &
+INSTALL_METHOD=$INSTALL_METHOD INSTALL_OS=$INSTALL_OS $@ &> /var/log/phpunit.log 2>&1 &
 echo \$! > /root/phpunit.pid
 wait %1
 echo \$? > /root/phpunit.exitcode
diff --git a/tests/lxc/lxc-debian7 b/tests/lxc/lxc-debian7
index d3d7815..c0d4aee 100644
--- a/tests/lxc/lxc-debian7
+++ b/tests/lxc/lxc-debian7
@@ -389,7 +389,7 @@ EOF
     return 0
 }
 
-options=$(getopt -o hp:n:c -l help,path:,name:,clean -- "$@")
+options=$(getopt -o hp:n:c -l help,path:,rootfs:,name:,clean -- "$@")
 if [ $? -ne 0 ]; then
         usage $(basename $0)
 	exit 1
diff --git a/tests/lxc/start b/tests/lxc/start
index 2c5290a..c0fff28 100755
--- a/tests/lxc/start
+++ b/tests/lxc/start
@@ -34,12 +34,13 @@ else
 	then
 		echo "lxc.network.ipv4 = $CIDR" >> $tmpconf
 	fi
-	# Next is a bit hacky, the only way I found to pass pubkey to the template
-	# LXC don't allow to pass extra args
 	if [ ! -z "$IPGW" ]
 	then
 		echo "#lxc.network.ipv4.gw = $IPGW" >> $tmpconf
 	fi
+	# Next is a bit hacky, the only way I found to pass pubkey to the template
+	# LXC don't allow to pass extra args
+	# Note: doesn't work with lxc >= 1.0, comments are stripped
 	echo "#lxc.pubkey = $SSHPUBKEY" >> $tmpconf
 	sudo /usr/bin/lxc-create -n $HOST -f $tmpconf -t $TEMPLATE
 	rm -f $tmpconf
diff --git a/tests/scripts/deb/build.sh b/tests/scripts/deb/build.sh
index 2077040..25415c2 100755
--- a/tests/scripts/deb/build.sh
+++ b/tests/scripts/deb/build.sh
@@ -7,18 +7,13 @@
 
 # This script will build the Debian packages to be tested
 
-# Prerequisite : running 'update.sh' and its prerequisites
-
-
-# removed as the grep test below would break otherwise
-#set -e
-
-#set -x
-
+set -e
+export DEBIAN_FRONTEND=noninteractive
 
 # Install build dependencies
-aptitude -y install mini-dinstall dput devscripts equivs pbzip2
-mk-build-deps -i /usr/src/fusionforge/src/debian/control -t 'apt-get -y' -r
+apt-get -y install mini-dinstall dput devscripts fakeroot
+apt-get -y install build-essential \
+     $(grep Build-Depends /usr/src/fusionforge/src/debian/control | sed -e 's/Build-Depends: //' -e 's/(.*)//')
 
 
 # Populate a local Debian packages repository for APT managed with mini-dinstall
@@ -47,7 +42,7 @@ if [ ! -e $GNUPGHOME ]; then
     # 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!)
-    aptitude install -y rng-tools
+    apt-get install -y rng-tools
     echo HRNGDEVICE=/dev/urandom >> /etc/default/rng-tools
     service rng-tools restart
     gpg --batch --gen-key <<EOF
@@ -90,16 +85,6 @@ fi
 cd /usr/src/fusionforge/src
 f=$(mktemp)
 cp debian/changelog $f
-
-# The build is likely to fail if /tmp is too short.
-# When filesystem is too much full, the boot scripts mount a tmpfs /tmp that is far too small to allow builds,
-# but still gets unnoticed.
-# We assume here that you didn't change the VM partitions layout and that /tmp is not a mounted partition.
-mount | grep /tmp
-if [ $? -eq 0 ]; then
-    echo "WARNING: It is likely that the mounted /tmp could be too short. If you experience a build error bellow, Try make some room on the FS and reboot, first."
-fi
-
 debian/rules debian/control  # re-gen debian/control
 version=$(dpkg-parsechangelog | sed -n 's/^Version: \([0-9.]\+\(\~rc[0-9]\)\?\).*/\1/p')+$(date +%Y%m%d%H%M)
 dch --newversion $version-1 --distribution local --force-distribution "Autobuilt."
diff --git a/tests/scripts/deb/install.sh b/tests/scripts/deb/install.sh
index 5977733..d9f8118 100755
--- a/tests/scripts/deb/install.sh
+++ b/tests/scripts/deb/install.sh
@@ -13,37 +13,35 @@
 
 #set -x
 set -e
-
-# Optional argument '-minimal' for fusionforge-minimal install instead of fusionforge-full
-variant=${1:-full}
+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 ! dpkg -l loggerhead | grep -q ^ii ; then
-    wget -c http://snapshot.debian.org/archive/debian/20121107T152130Z/pool/main/l/loggerhead/loggerhead_1.19%7Ebzr477-1_all.deb
+if ! 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)
-    aptitude install gdebi-core
+    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
-    aptitude install locales-all
+    apt-get -y install locales-all
 fi
 
-# Install FusionForge packages (by default, the fusionforge-full meta-package and all dependencies)
-aptitude update
-if dpkg -l fusionforge-$variant | grep -q ^ii ; then
+# Install FusionForge packages
+apt-get update
+if dpkg -l fusionforge | grep -q ^ii ; then
     # Already installed, upgrading
-    UCF_FORCE_CONFFNEW=yes LANG=C DEBIAN_FRONTEND=noninteractive aptitude -y dist-upgrade
+    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 aptitude -y install fusionforge-$variant
+    UCF_FORCE_CONFFNEW=yes LANG=C DEBIAN_FRONTEND=noninteractive apt-get -y install fusionforge
 
     # Initial configuration
-    /usr/share/gforge/bin/forge_set_password admin myadmin
+    forge_set_password admin myadmin
     a2dissite default
     invoke-rc.d apache2 restart
 
diff --git a/tests/scripts/deb/run-testsuite.sh b/tests/scripts/deb/run-testsuite.sh
index d648ec4..d7aa133 100755
--- a/tests/scripts/deb/run-testsuite.sh
+++ b/tests/scripts/deb/run-testsuite.sh
@@ -5,29 +5,24 @@
 # controlled Firefox browser.
 
 # Build an unofficial package for selenium and install it
-if ! dpkg -l selenium | grep -q ^ii ; then
-    cd /usr/src/fusionforge/3rd-party/selenium/selenium
-    debian/rules get-orig-source
-    debuild --no-lintian --no-tgz-check -us -uc
-    dpkg -i /usr/src/fusionforge/3rd-party/selenium/selenium_*_all.deb
+if ! dpkg-query -s selenium >/dev/null 2>&1 ; then
+    version=2.35.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
 
     # Selenium dependencies
-    aptitude -y install default-jre iceweasel
+    apt-get -y install default-jre iceweasel
 
 fi
 
-config_path=$(cd /usr/src/fusionforge;utils/forge_get_config_basic fhs config_path)
+invoke-rc.d cron stop
 
+config_path=$(forge_get_config config_path)
 (echo [mediawiki]; echo unbreak_frames=yes) > $config_path/config.ini.d/zzz-buildbot.ini
 
 # Test dependencies
-aptitude -y install php5-cli phpunit phpunit-selenium
-
-## If available, install the JUnit OSLC provider test suite
-#if [ -d src/plugins/oslc/tests ]; then
-#    cd /usr/src/fusionforge/src/plugins/oslc/tests
-#    ./setup-provider-test.sh
-#fi
+apt-get -y install phpunit phpunit-selenium
 
 # Now, start the functionnal test suite using phpunit and selenium
 /usr/src/fusionforge/tests/scripts/phpunit.sh deb/debian
diff --git a/tests/scripts/fusionforge-build-and-test-deb.sh b/tests/scripts/fusionforge-build-and-test-deb.sh
index 8851ffa..0dbdf8c 100755
--- a/tests/scripts/fusionforge-build-and-test-deb.sh
+++ b/tests/scripts/fusionforge-build-and-test-deb.sh
@@ -6,7 +6,6 @@ set -e
 
 get_config
 
-export FORGE_HOME=/usr/share/gforge
 export HOST=$1
 case $HOST in
     debian7.local)
@@ -23,157 +22,34 @@ case $HOST in
 	;;
 esac	
 
-export FILTER="deb/debian"
+#conf=$(mktemp)
+#echo "lxc.network.link = virbr0" > $conf
+#echo "lxc.network.type = veth"  >> $conf
+#wsudo lxc-create -t $VM -n $HOST -t $conf
+#sudo lxc-start -n $HOST -d
+tests/scripts/start_vm -t $VM $HOST
 
-prepare_workspace
-
-CHECKOUTPATH=$(pwd)
-
-COWBUILDERCONFIG=$BUILDERDIR/config/$DIST.config
-
-cd $CHECKOUTPATH/src
-PKGNAME=$(dpkg-parsechangelog | awk '/^Source:/ { print $2 }')
-PKGVERS=$(dpkg-parsechangelog | awk '/^Version:/ { print $2 }')
-MAJOR=${PKGVERS%-*}
-SMAJOR=${MAJOR#*:}
-MINOR=${PKGVERS##*-}
-if [ -d $CHECKOUTPATH/.svn ] ; then
-    MINOR=-$MINOR+svn$(svn info | awk '/^Revision:/ { print $2 }')
-elif [ -d $CHECKOUTPATH/.bzr ] ; then
-    MINOR=-$MINOR+bzr$(bzr revno)
-elif [ -d $CHECKOUTPATH/.git ] ; then
-    MINOR=-$MINOR+git$(git describe --always)
-else
-    MINOR=-$MINOR+$(TZ=UTC date +%Y%m%d%H%M%S)
-fi
-ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
-
-# Build out of the source tree
-. $COWBUILDERCONFIG
-CHANGEFILE=${BUILDRESULT}/${PKGNAME}_${SMAJOR}${MINOR}_${ARCH}.changes
-cd $CHECKOUTPATH
-rm -rf $BUILDPLACE/$PKGNAME-$MAJOR
-cp -r src/ $BUILDPLACE/$PKGNAME-$MAJOR
-cd $BUILDPLACE/$PKGNAME-$MAJOR
-dch -b -v $MAJOR$MINOR -D UNRELEASED "This is $DIST-$ARCH autobuild"
-sed -i -e "1s/UNRELEASED/$DIST/" debian/changelog
-debian/rules debian/control
-pdebuild --configfile $COWBUILDERCONFIG --buildresult $BUILDRESULT
-
-cd $BUILDRESULT
-lintian -i $CHANGEFILE
-REPOPATH=$WORKSPACE/build/debian
-
-[ ! -d $REPOPATH ] || rm -r $REPOPATH
-mkdir -p $REPOPATH/conf
-DEFAULTKEY=buildbot@$(hostname -f)
-SIGNKEY=${DEBEMAIL:-$DEFAULTKEY}
-cat > $REPOPATH/conf/distributions <<EOF
-Codename: $DIST
-Suite: $DIST
-Components: main
-UDebComponents: main
-Architectures: amd64 i386 source
-Origin: buildbot.fusionforge.org
-Description: FusionForge autobuilt repository
-SignWith: $SIGNKEY
-EOF
-
-reprepro -Vb $REPOPATH include $DIST $CHANGEFILE
-
-rm ${BUILDPLACE}/${PKGNAME}_${SMAJOR}${MINOR}*
-rm -rf $BUILDPLACE/$PKGNAME-$MAJOR
-
-cd $BUILDRESULT
-cat $CHANGEFILE | sed '1,/^Checksums-Sha1:/d;/^[[:alnum:]]/,$d' | awk '{print $3}' | xargs rm
-rm $CHANGEFILE
-
-cd $CHECKOUTPATH
-
-destroy_vm -t $VM $HOST
-start_vm_if_not_keeped -t $VM $HOST
-setup_debian_3rdparty_repo
-
-# Transfer preseeding
-cat tests/preseed/* | sed s/@FORGE_ADMIN_PASSWORD@/$FORGE_ADMIN_PASSWORD/ | ssh root@$HOST "LANG=C debconf-set-selections"
-
-# Setup debian repo
-export DEBMIRROR DEBMIRRORSEC
-ssh root@$HOST "echo \"deb $DEBMIRROR $DIST main\" > /etc/apt/sources.list"
+# LXC post-install...
 ssh root@$HOST "echo \"deb $DEBMIRRORSEC $DIST/updates main\" > /etc/apt/sources.list.d/security.list"
-ssh root@$HOST "apt-get update"
-# ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes dist-upgrade"
-
-ssh root@$HOST "apt-get update"
-ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes install libapache2-mod-wsgi nscd"
-
-if [ "$DIST" = wheezy ] ; then
-    ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes install javascript-common"
-
-    # Grab a more recent loggerhead (without pulling everything)
-    if ! ssh root@$HOST dpkg -l loggerhead | grep -q ^ii ; then
-	ssh root@$HOST "apt-get -y --force-yes install wget gdebi-core;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
-
-    ssh root@$HOST "echo \"deb $DEBMIRROR wheezy-backports main\" >> /etc/apt/sources.list.d/wheezy-backports.list"
-    ssh root@$HOST "apt-get update"
-    ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes install -t wheezy-backports libjs-jquery-ui"
-    ssh root@$HOST "rm /etc/apt/sources.list.d/wheezy-backports.list"
-fi
-
-ssh root@$HOST "echo \"deb $DEBMIRROR $DIST main\" > /etc/apt/sources.list"
-ssh root@$HOST "apt-get update"
-
-ssh root@$HOST "echo \"deb file:/debian $DIST main\" >> /etc/apt/sources.list"
-scp -r $WORKSPACE/build/debian root@$HOST:/ 
-gpg --export --armor | ssh root@$HOST "apt-key add -"
-sleep 5
+ssh root@$HOST "echo 'APT::Install-Recommends \"false\";' > /etc/apt/apt.conf.d/01InstallRecommends"
 ssh root@$HOST "apt-get update"
 
-# Install fusionforge
-ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes install rsync postgresql-contrib fusionforge-full"
-
-config_path=$(ssh root@$HOST forge_get_config config_path)
-data_path=$(ssh root@$HOST forge_get_config data_path)
-
-echo "Set forge admin password"
-ssh root@$HOST "/usr/share/gforge/bin/forge_set_password $FORGE_ADMIN_USERNAME $FORGE_ADMIN_PASSWORD"
-ssh root@$HOST "LANG=C a2dissite default ; LANG=C a2dissite 000-default ; LANG=C invoke-rc.d apache2 reload"
-ssh root@$HOST "(echo [core];echo use_ssl=no) > $config_path/config.ini.d/zzz-buildbot.ini"
-ssh root@$HOST "(echo [moinmoin];echo use_frame=no) >> $config_path/config.ini.d/zzz-buildbot.ini"
-ssh root@$HOST "(echo [mediawiki];echo unbreak_frames=yes) >> $config_path/config.ini.d/zzz-buildbot.ini"
-ssh root@$HOST "[ -e $data_path/.bazaar/bazaar.conf ] && sed -i -e s,https://,http://,g $data_path/.bazaar/bazaar.conf"
-ssh root@$HOST "service nscd restart"
-
-# Dump database
-echo "Dump freshly installed database"
-ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
-
-# Stop cron
-echo "Stop cron daemon"
-ssh root@$HOST "invoke-rc.d cron stop" || true
-
-# Install selenium
-ssh root@$HOST "apt-get -o debug::pkgproblemresolver=true -y install selenium"
-
-# Install selenium tests
-ssh root@$HOST "[ -d $FORGE_HOME ] || mkdir -p $FORGE_HOME"
-rsync -a --delete tests/ root@$HOST:$FORGE_HOME/tests/
+# Transfer preseeding
+#cat tests/preseed/* | sed s/@FORGE_ADMIN_PASSWORD@/$FORGE_ADMIN_PASSWORD/ | ssh root@$HOST "LANG=C debconf-set-selections"
 
-# Transfer hudson config
-ssh root@$HOST "cat > $FORGE_HOME/tests/config/phpunit" <<-EOF
-HUDSON_URL=$HUDSON_URL
-JOB_NAME=$JOB_NAME
-EOF
+ssh root@$HOST "apt-get install 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"
+ssh root@$HOST "apt-get install -y fusionforge-shell fusionforge-plugin-mediawiki"
 
 # Run tests
 retcode=0
-echo "Run phpunit test on $HOST in $FORGE_HOME"
-ssh root@$HOST "$FORGE_HOME/tests/func/vncxstartsuite.sh $FILTER" || retcode=$?
-rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
+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" || retcode=$?
 
-cd $CHECKOUTPATH
-for i in *_source.changes ; do echo $i ; echo $(basename $i _source.changes)_*.build ; cat $i | sed -e 0,/^Checksums/d -e /^Checksums/,\$d | awk '{print $3}' ; done | xargs rm || true
+rsync -av root@$HOST:/var/log/ ~/reports/
 
-stop_vm_if_not_keeped -t $VM $@
+lxc-stop -k -n $HOST
+lxc-destroy -n $HOST
 exit $retcode
diff --git a/tests/scripts/phpunit.sh b/tests/scripts/phpunit.sh
index 5167c0e..3de3cf1 100755
--- a/tests/scripts/phpunit.sh
+++ b/tests/scripts/phpunit.sh
@@ -41,7 +41,7 @@ define('DB_NAME', getenv('DB_NAME'));
 define('DB_USER', getenv('DB_USER'));
 define('DB_PASSWORD', '@@FFDB_PASS@@');
 // Command which will reload a clean database at each SeleniumTestCase start
-define('DB_INIT_CMD', "$FORGE_HOME/tests/func/db_reload.sh >>/var/log/db_reload_selenium.log 2>&1");
+define('DB_INIT_CMD', "$FORGE_HOME/tests/func/db_reload.sh 2>&1");
 
 // Prefix for commands to run
 define('RUN_COMMAND_PREFIX', '');
@@ -51,14 +51,14 @@ print "Looking for forge_run_job script...\n";
 if (is_executable ("$FORGE_HOME/bin/forge_run_job")) {
     print "Found in $FORGE_HOME/bin/\n";
     define('RUN_JOB_PATH', "$FORGE_HOME/bin/");
-} elseif (is_executable ("$FORGE_HOME/utils/forge_run_job")) {
-    print "Found in $FORGE_HOME/utils/\n";
-    define('RUN_JOB_PATH', "$FORGE_HOME/utils/");
-} elseif (is_executable ("$FORGE_HOME/src/utils/forge_run_job")) {
-    print "Found in $FORGE_HOME/src/utils/\n";
-    define('RUN_JOB_PATH', "$FORGE_HOME/src/utils/");
+} elseif (is_executable ("$FORGE_HOME/bin/forge_run_job")) {
+    print "Found in $FORGE_HOME/bin/\n";
+    define('RUN_JOB_PATH', "$FORGE_HOME/bin/");
+} elseif (is_executable ("$FORGE_HOME/src/bin/forge_run_job")) {
+    print "Found in $FORGE_HOME/src/bin/\n";
+    define('RUN_JOB_PATH', "$FORGE_HOME/src/bin/");
 } else {
-    print "Neither $FORGE_HOME/bin/forge_run_job, nor $FORGE_HOME/utils/forge_run_job, nor $FORGE_HOME/src/utils/forge_run_job seem to be executable, strange.\n";
+    print "Neither $FORGE_HOME/bin/forge_run_job, nor $FORGE_HOME/bin/forge_run_job, nor $FORGE_HOME/src/bin/forge_run_job seem to be executable, strange.\n";
     exit(1);
 }
 
@@ -96,34 +96,17 @@ EOF
 
 echo "Starting Selenium"
 killall -9 java
-t=$(mktemp)
 timeout=300
-PATH=/usr/lib/iceweasel:$PATH LANG=C java -jar /usr/share/selenium/selenium-server.jar -trustAllSSLCertificates -singleWindow > $t 2>&1 &
+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 ; do
+while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 && kill -0 $pid 2>/dev/null; do
     sleep 1
     i=$(($i+1))
 done
-if [ $i = $timeout ] ; then
-    echo "Selenium failed to start within $timeout seconds:"
-    echo -----
-    cat $t
-    echo -----
-    echo "Trying again."
-    PATH=/usr/lib/iceweasel:$PATH LANG=C java -jar /usr/share/selenium/selenium-server.jar -trustAllSSLCertificates -singleWindow > $t 2>&1 &
-    i=0
-    while [ $i -lt $timeout ] && ! netstat -tnl 2>/dev/null | grep -q :4444 ; do
-	sleep 1
-	i=$(($i+1))
-    done
-    if [ $i = $timeout ] ; then
-	echo "Selenium failed to start within $timeout seconds:"
-	echo -----
-	cat $t
-	echo -----
-	echo "Giving up."
-	exit 1
-    fi
+if [ $i = $timeout ] || ! kill -0 $pid 2>/dev/null; then
+    echo "Selenium failed to start."
+    exit 1
 fi
 
 echo "Running PHPunit tests"

commit 8098354023304d785ce53bf978c0efcb3dca62f0
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Aug 25 17:20:15 2014 +0200

    debian: experiment with single 'fusionforge' package + Recommends + Suggests, rather than minimal/standard/full packages

diff --git a/src/debian/control b/src/debian/control
index 7b3c10d..3307716 100644
--- a/src/debian/control
+++ b/src/debian/control
@@ -10,9 +10,11 @@ Vcs-Git: https://fusionforge.org/anonscm/git/deb-packaging/deb-packaging.git
 Vcs-Browser: https://fusionforge.org/scm/browser.php?group_id=9
 
 
-Package: fusionforge-standard
+Package: fusionforge
 Architecture: all
 Depends: fusionforge-common (=${source:Version}), fusionforge-web, ${misc:Depends}
+Recommends: fusionforge-shell
+Suggests: fusionforge-plugin-mediawiki
 Description: FusionForge collaborative development tool - standard metapackage
  FusionForge provides many tools to aid collaboration in a
  development project, such as bug-tracking, task management,
@@ -20,7 +22,8 @@ Description: FusionForge collaborative development tool - standard metapackage
  web/FTP hosting, release management, etc. All these services are
  integrated into one web site and managed through a web interface.
  .
- This metapackage installs a standard FusionForge site.
+ This metapackage installs a stand-alone FusionForge site.
+ See also the Recommends and Suggests dependencies.
 
 
 Package: fusionforge-common

commit c5d7cc9e8c9d782863725ee6b9610a8c7061dd80
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Aug 25 17:18:22 2014 +0200

    install: db: run upgrade-sh.php before adding admin user, otherwise themes aren't there yet

diff --git a/src/post-install.d/db/db.sh b/src/post-install.d/db/db.sh
index 981cf4f..80d6e40 100755
--- a/src/post-install.d/db/db.sh
+++ b/src/post-install.d/db/db.sh
@@ -5,4 +5,3 @@ source_path=$(forge_get_config source_path)
 
 $source_path/post-install.d/db/configure.sh
 $source_path/post-install.d/db/populate.sh
-$source_path/bin/upgrade-db.php
diff --git a/src/post-install.d/db/populate.sh b/src/post-install.d/db/populate.sh
index a923dd3..ac81d5c 100755
--- a/src/post-install.d/db/populate.sh
+++ b/src/post-install.d/db/populate.sh
@@ -26,11 +26,6 @@ su - postgres -c psql <<EOF
 ALTER ROLE $database_user WITH PASSWORD '$database_password_quoted' ;
 EOF
 su - postgres -c "createuser -SDR ${database_user}_nss"
-su - postgres -c 'psql fusionforge' <<EOF
-GRANT SELECT ON nss_passwd TO ${database_user}_nss;
-GRANT SELECT ON nss_groups TO ${database_user}_nss;
-GRANT SELECT ON nss_usergroups TO ${database_user}_nss;
-EOF
 
 # Create database
 su - postgres -c "createdb --template template0 --encoding UNICODE $database_name"
@@ -43,12 +38,19 @@ cat <<EOF > $PGPASSFILE
 $database_host:$database_port:$database_name:$database_user:$database_password
 EOF
 psql -h $database_host -p $database_port -U $database_user $database_name < $source_path/db/1-fusionforge-init.sql
+
+$source_path/bin/upgrade-db.php
+
 psql -h $database_host -p $database_port -U $database_user $database_name <<EOF
 INSERT INTO users (user_name, realname, firstname, lastname, email,
     user_pw, unix_pw, status, theme_id)
   VALUES ('admin', 'Forge Admin', 'Forge', 'Admin', 'root at localhost.localdomain',
     'INVALID', 'INVALID', 'A', (SELECT theme_id FROM themes WHERE dirname='funky'));
+GRANT SELECT ON nss_passwd TO ${database_user}_nss;
+GRANT SELECT ON nss_groups TO ${database_user}_nss;
+GRANT SELECT ON nss_usergroups TO ${database_user}_nss;
 EOF
 rm -f $PGPASSFILE
 unset PGPASSFILE
-forge_make_admin admin
+forge_make_admin admin  # set permissions
+# Note: no password defined yet

commit 5be30377d0b324cf62c51ebad56fd5e19752b556
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Aug 25 17:17:49 2014 +0200

    install: don't require pbzip2 for 'make dist'

diff --git a/src/GNUmakefile b/src/GNUmakefile
index ca42770..ded53cc 100644
--- a/src/GNUmakefile
+++ b/src/GNUmakefile
@@ -128,14 +128,14 @@ dist-clean:
 ## Developer tools
 
 # tar.bz2 release
-# depends: gettext tar pbzip2
+# depends: gettext tar
 TAR_PREFIX=fusionforge-$(VERSION)
 dist: all
 	rm -rf $(TAR_PREFIX)/
 	mkdir  $(TAR_PREFIX)/
 	$(CP_R) $$(ls -A | grep -v '^\.git' | grep -v $(TAR_PREFIX)) $(TAR_PREFIX)/
 	find $(TAR_PREFIX)/ -name '*~' -print0 | xargs -r0 rm
-	tar cf $(TAR_PREFIX).tar.bz2 --use-compress-prog=pbzip2 $(TAR_PREFIX)/
+	tar cjf $(TAR_PREFIX).tar.bz2 $(TAR_PREFIX)/
 	rm -rf $(TAR_PREFIX)/
 
 version:

commit 357741d96cdb0b80d0c65f945053cb44001b8c2d
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Aug 25 10:25:19 2014 +0200

    build.sh: doc fix

diff --git a/tests/scripts/deb/build.sh b/tests/scripts/deb/build.sh
index 2df22dc..2077040 100755
--- a/tests/scripts/deb/build.sh
+++ b/tests/scripts/deb/build.sh
@@ -46,7 +46,7 @@ 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 in prod!)
+    # (don't do this for a public repo!)
     aptitude install -y rng-tools
     echo HRNGDEVICE=/dev/urandom >> /etc/default/rng-tools
     service rng-tools restart

-----------------------------------------------------------------------

Summary of changes:
 src/GNUmakefile                                 |    4 +-
 src/debian/control                              |    7 +-
 src/post-install.d/db/db.sh                     |    1 -
 src/post-install.d/db/populate.sh               |   14 +-
 src/post-install.d/web/configure.sh             |    2 +
 tests/func/Testing/SeleniumForge.php            |    9 +-
 tests/func/db_reload.sh                         |    8 +-
 tests/func/vncxstartsuite.sh                    |   28 +---
 tests/lxc/lxc-debian7                           |    2 +-
 tests/lxc/start                                 |    5 +-
 tests/scripts/deb/build.sh                      |   29 +---
 tests/scripts/deb/install.sh                    |   24 ++--
 tests/scripts/deb/run-testsuite.sh              |   23 ++--
 tests/scripts/fusionforge-build-and-test-deb.sh |  164 +++--------------------
 tests/scripts/phpunit.sh                        |   45 ++-----
 15 files changed, 93 insertions(+), 272 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list