[Fusionforge-commits] FusionForge branch 6.0 updated. v6.0.2-63-gb1835ac

Sylvain Beucler beuc-inria at libremir.placard.fr.eu.org
Mon Sep 7 11:33:44 CEST 2015


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, 6.0 has been updated
       via  b1835ac7a1aee48f000b864a6bd2333890f5cba9 (commit)
      from  b42ac36030b81be952303da734ffd7c8647af822 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=b1835ac7a1aee48f000b864a6bd2333890f5cba9

commit b1835ac7a1aee48f000b864a6bd2333890f5cba9
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Mon Sep 7 11:32:11 2015 +0200

    testsuite: remove obsolete/broken setup + regroup functional testing scripts

diff --git a/autoinstall/common-backports b/autoinstall/common-backports
index 0279776..ffc366d 100644
--- a/autoinstall/common-backports
+++ b/autoinstall/common-backports
@@ -133,11 +133,8 @@ function backports_rpm {
 	#      - http://download.fedoraproject.org/pub/epel/7/x86_64/repoview/epel-release.html
 	if ! rpm -q epel-release >/dev/null; then
 	    case $os_version in
-		6)
-		    rpm -ivh http://rpmfind.net/linux/epel/6/i386/epel-release-6-8.noarch.rpm
-		    ;;
 		7)
-		    rpm -ivh http://rpmfind.net/linux/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
+		    rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
 		    ;;
 	    esac
 	fi
diff --git a/tests/buildbot/lxc/Makefile b/tests/buildbot/Makefile
similarity index 92%
rename from tests/buildbot/lxc/Makefile
rename to tests/buildbot/Makefile
index 039e8aa..70284d4 100644
--- a/tests/buildbot/lxc/Makefile
+++ b/tests/buildbot/Makefile
@@ -1,6 +1,3 @@
--include ../config/default
--include ../config/$(shell hostname)
-
 default: checkdepends installtemplate
 
 help: 
diff --git a/tests/buildbot/common-functions b/tests/buildbot/common-functions
index 4f9b246..c28dae6 100644
--- a/tests/buildbot/common-functions
+++ b/tests/buildbot/common-functions
@@ -1,85 +1,32 @@
 #! /bin/sh
-get_config()
-{
-	echo "Read config from tests/config/default"
-	. $(dirname $0)/config/default
-	if [ -f $(dirname $0)/config/`hostname` ]
-	then
-		echo "Read config from tests/config/`hostname`"
-		 . $(dirname $0)/config/`hostname` 
-	fi
-	if [ ! -z "$1" ]
-	then
-		echo "Set HOST to $1"
-        	export HOST="$1"
-	fi
+get_config() {
+    echo "Read config from tests/config/default"
+    . $(dirname $0)/config/default
+    if [ -f $(dirname $0)/config/$(hostname) ]; then
+	echo "Read config from tests/config/$(hostname)"
+	. $(dirname $0)/config/$(hostname)
+    fi
+    if [ ! -z "$1" ]
+    then
+	echo "Set HOST to $1"
+        export HOST="$1"
+    fi
 }
 
-prepare_workspace()
-{
-	export CURDIR=`pwd`
-	WORKDIR=$(cd $CURDIR/..; pwd)
-	export WORKSPACE=${WORKSPACE:-$WORKDIR}
-	export RPM_TMP=$WORKDIR/tmp
-	export BUILDRESULT=$WORKSPACE/build/packages
-	mkdir -p $BUILDRESULT
-	export BUILDERDIR=${BUILDERDIR:-$HOME/builder}
-	# Create place to store built packages
-	[ ! -d $WORKSPACE/packages ] || mkdir -p $WORKSPACE/packages
-	# Erase reports
-	[ ! -d $WORKSPACE/reports ] || rm -fr $WORKSPACE/reports
-	mkdir -p $WORKSPACE/reports/coverage
-	# Erase apidocs
-	[ ! -d $WORKSPACE/apidocs ] || rm -fr $WORKSPACE/apidocs
-	mkdir -p $WORKSPACE/apidocs
-}
-
-setup_epel_repo()
-{
-if [ -z "$HOST" ] ; then  echo "HOST undefined" ;exit 1; fi
-# EPEL REPO
-if [ ! -z "$EPEL_REPO" ] ; then
-        echo "Installing specific EPEL REPO $EPEL_REPO"
-	ssh root@$HOST "cat > /etc/yum.repos.d/epel.repo" <<-EOF
-# Name: EPEL RPM Repository for Red Hat Enterprise \$releasever - epel
-# URL: http://fedoraproject.org/wiki/EPEL
-[epel]
-name=Extra Packages for Enterprise Linux \$releasever - \$basearch 
-baseurl=$EPEL_REPO/\$releasever/\$basearch
-#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel\$releasever&arch=\$basearch
-failovermethod=priority
-enabled=0
-gpgcheck=0
-EOF
-else
-        echo "Installing standard EPEL REPO"
-	ssh root@$HOST "cat > /etc/yum.repos.d/epel.repo" <<-EOF
-# Name: EPEL RPM Repository for Red Hat Enterprise \$releasever - epel
-# URL: http://fedoraproject.org/wiki/EPEL
-[epel]
-name=Extra Packages for Enterprise Linux \$releasever - \$basearch 
-#baseurl=http://download.fedoraproject.org/pub/epel/\$releasever/\$basearch
-mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel\$releasever&arch=\$basearch
-failovermethod=priority
-enabled=0
-gpgcheck=0
-EOF
-fi
-}
-
-setup_epel_testing_repo()
-{
-if [ -z "$HOST" ] ; then  echo "HOST undefined" ;exit 1; fi
-# EPEL Testing REPO
-echo "Installing EPEL Testing REPO"
-ssh root@$HOST "cat > /etc/yum.repos.d/epel-testing.repo" <<-EOF
-# Name: EPEL RPM Repository for Red Hat Enterprise Testing \$releasever - epel
-# URL: http://fedoraproject.org/wiki/EPEL
-[epel-testing]
-name=Extra Packages for Enterprise Linux Testing \$releasever - \$basearch 
-mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel\$releasever&arch=\$basearch
-failovermethod=priority
-enabled=0
-gpgcheck=0
-EOF
+prepare_workspace() {
+    export CURDIR=`pwd`
+    WORKDIR=$(cd $CURDIR/..; pwd)
+    export WORKSPACE=${WORKSPACE:-$WORKDIR}
+    export RPM_TMP=$WORKDIR/tmp
+    export BUILDRESULT=$WORKSPACE/build/packages
+    mkdir -p $BUILDRESULT
+    export BUILDERDIR=${BUILDERDIR:-$HOME/builder}
+    # Create place to store built packages
+    [ ! -d $WORKSPACE/packages ] || mkdir -p $WORKSPACE/packages
+    # Erase reports
+    [ ! -d $WORKSPACE/reports ] || rm -fr $WORKSPACE/reports
+    mkdir -p $WORKSPACE/reports/coverage
+    # Erase apidocs
+    [ ! -d $WORKSPACE/apidocs ] || rm -fr $WORKSPACE/apidocs
+    mkdir -p $WORKSPACE/apidocs
 }
diff --git a/tests/buildbot/common-vm b/tests/buildbot/common-vm
deleted file mode 100644
index 6800410..0000000
--- a/tests/buildbot/common-vm
+++ /dev/null
@@ -1,144 +0,0 @@
-#! /bin/sh
-
-usage_vm()
-{
-    cat <<EOF
-$1 -h|--host=<hostname> -e|--engine=<vmengine> -c|--config=<config> -t|--template=<template>
-config use the syntax used in test/config/default file
-hostname=vmengine:template:address/mask:gateway
-EOF
-    return 0
-}
-
-read_param_vm()
-{
-options=`getopt -o h:e:c:t: -l host:,engine:,config:,template: -- "$@"`
-if [ $? -ne 0 ]; then
-        usage_vm `basename $0`
-        exit 1
-fi
-eval set -- "$options"
-
-while true
-do
-    case "$1" in
-        -e|--engine)    VMENGINE=$2; shift 2;;
-        -h|--host)      HOST=$2; shift 2;;
-        -c|--config)    CONFIG=$2; shift 2;;
-        -t|--template)  VMTEMPLATE=$2; shift 2;;
-        --)             shift 1; break ;;
-        *)              break ;;
-    esac
-done
-
-# Loading default config
-if [ -f $configdir/default ]
-then
-	. $configdir/default
-else
-	echo "Something went wrong, could not find default config: $configdir/default"
-	exit 1
-fi
-
-# Loading specific config
-if [ -f $configdir/`hostname` ]
-then
-        echo "Using specific config: $configdir/`hostname`"
-        . $configdir/`hostname`
-else
-        echo "Using default config"
-fi
-
-# Host can be defined by env var
-if [ -z "$HOST" ]
-then
-	echo "host not defined"
-	usage_vm
-	exit 2	
-fi
-
-BASEHOST=`echo $HOST|cut -d. -f1`
-# Config as a param
-if [ ! -z "$CONFIG" ]
-then
-	eval "$BASEHOST=$CONFIG"
-fi	
-
-# Now let's look if host/engine is defined in config
-IFS=: ; VARS=`eval echo \\\$$BASEHOST` ; unset IFS ;
-if [ ! -z "$VARS" ]
-then 
-	set $VARS
-	VMENGINE=$1
-	VMTEMPLATE=$2
-	CIDR=$3
-	IPGW=$4
-	echo "$BASEHOST=`eval echo \\\$$BASEHOST`"
-fi
-
-export HOST BASEHOST $BASEHOST
-
-if [ -z "$VMENGINE" ]
-then
-        # Try to guess the vmengine
-	if [ -x /usr/sbin/vzctl ]
-	then
-		VMENGINE=openvz
-	fi
-	if [ -x /usr/bin/lxc-start ]
-	then
-		VMENGINE=lxc
-	fi
-        if [ -z "$VMENGINE" ]
-        then
-                echo "VM engine not defined"
-		usage_vm
-                exit 3
-        fi
-fi
-
-if [ -z "$VMTEMPLATE" ]
-then
-	echo "Template not defined"
-	usage_vm
-	exit 4
-fi
-
-export VMTEMPLATE VMENGINE CIDR IPGW
-}
-
-destroy_vm_if_not_kept()
-{
-	if ! $KEEPVM
-	then
-	    $(dirname $0)/destroy_vm $@ || true
-	fi
-}
-
-start_vm_if_not_kept()
-{
-	if $KEEPVM
-	then
-		# VM can already exist
-		$(dirname $0)/start_vm $@
-	else
-		# Destroy the VM if found
-		$(dirname $0)/stop_vm $@ || true
-		if ! $(dirname $0)/start_vm $@
-		then
-			echo "Could not start VM";
-			exit 2
-		fi
-	fi
-}
-
-stop_vm_if_not_kept()
-{
-	if $KEEPVM
-	then
-        	echo "Keeping vm $@ alive"
-	else
-        	$(dirname $0)/stop_vm $@
-	fi
-}
-
diff --git a/tests/buildbot/config/default b/tests/buildbot/config/default
index 81f07be..5167f59 100644
--- a/tests/buildbot/config/default
+++ b/tests/buildbot/config/default
@@ -4,14 +4,11 @@
 # be sourced in a shell
 # So it should only be stuffs like VAR=value
 
-# Do we keep vm at end of tests
+# Do we reuse VMs or destroy&recreate them?
 KEEPVM=false
 
-# VM Engine currently supported lxc, openvz TODO kvm, virtualbox,...
-VMENGINE=lxc
-
 # LXC post-install
 # Debian security mirror
 DEBMIRRORSEC=http://security.debian.org/
 # Redhat mirrors
-EPEL_REPO=http://download.fedoraproject.org/pub/epel
+#EPEL_REPO=http://download.fedoraproject.org/pub/epel
diff --git a/tests/buildbot/destroy_vm b/tests/buildbot/destroy_vm
deleted file mode 100755
index b1330d3..0000000
--- a/tests/buildbot/destroy_vm
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/sh
-
-HOST=$1
-
-sudo /usr/local/sbin/lxc-wrapper destroy $(basename $HOST .local)
diff --git a/tests/buildbot/fusionforge-build-and-test.sh b/tests/buildbot/fusionforge-build-and-test.sh
index 80dc556..f5b2146 100755
--- a/tests/buildbot/fusionforge-build-and-test.sh
+++ b/tests/buildbot/fusionforge-build-and-test.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
+# Create an LXC container and launch the functional testsuite
 . $(dirname $0)/common-functions
-. $(dirname $0)/common-vm
 
 set -ex
 
@@ -9,6 +9,88 @@ copy_logs() {
 }
 trap copy_logs ERR
 
+start_vm() {
+    HOST=$1
+    if ! $KEEPVM; then
+	# Destroy the VM if found
+	destroy_vm $1 || true
+    fi
+
+    sudo /usr/local/sbin/lxc-wrapper start $(basename $HOST .local)
+    
+    echo "Waiting for $HOST to come up..."
+    i=0
+    while [ $i -lt 10 ] && ! test_host ; do
+	sleep 10
+	i=$(($i+1))
+	echo -n .
+    done
+    
+    if test_host ; then
+	echo " OK"
+    else
+	echo " FAIL"
+	exit 1
+    fi
+}
+
+test_host () {
+    ssh -o 'StrictHostKeyChecking=no' "root@$HOST" uname -a >/dev/null 2>&1
+}
+
+stop_vm() {
+    HOST=$1
+    if ! $KEEPVM; then
+	sudo /usr/local/sbin/lxc-wrapper stop $(basename $HOST .local)
+    fi
+}
+
+destroy_vm() {
+    HOST=$1
+    sudo /usr/local/sbin/lxc-wrapper destroy $(basename $HOST .local)
+}
+
+
+setup_epel_repo() {
+    if [ -z "$HOST" ] ; then  echo "HOST undefined" ;exit 1; fi
+    # EPEL REPO
+    if [ ! -z "$EPEL_REPO" ] ; then
+        echo "Installing specific EPEL REPO $EPEL_REPO"
+	ssh root@$HOST "cat > /etc/yum.repos.d/epel.repo" <<-EOF
+# Name: EPEL RPM Repository for Red Hat Enterprise \$releasever - epel
+# URL: http://fedoraproject.org/wiki/EPEL
+[epel]
+name=Extra Packages for Enterprise Linux \$releasever - \$basearch 
+baseurl=$EPEL_REPO/\$releasever/\$basearch
+#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel\$releasever&arch=\$basearch
+failovermethod=priority
+enabled=0
+gpgcheck=0
+EOF
+    else
+        echo "Installing standard EPEL REPO"
+	ssh root@$HOST rpm -ivh \
+	    https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || true
+    fi
+}
+
+setup_epel_testing_repo() {
+    if [ -z "$HOST" ] ; then  echo "HOST undefined" ;exit 1; fi
+    # EPEL Testing REPO
+    echo "Installing EPEL Testing REPO"
+    ssh root@$HOST "cat > /etc/yum.repos.d/epel-testing.repo" <<-EOF
+# Name: EPEL RPM Repository for Red Hat Enterprise Testing \$releasever - epel
+# URL: http://fedoraproject.org/wiki/EPEL
+[epel-testing]
+name=Extra Packages for Enterprise Linux Testing \$releasever - \$basearch 
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel\$releasever&arch=\$basearch
+failovermethod=priority
+enabled=0
+gpgcheck=0
+EOF
+}
+
+
 get_config
 prepare_workspace
 
@@ -64,8 +146,7 @@ case $INSTALL_METHOD in
 	;;
 esac
 
-destroy_vm_if_not_kept $HOST
-start_vm_if_not_kept $HOST
+start_vm $HOST
 
 # LXC post-install...
 if [ $INSTALL_OS == "debian" ]; then
@@ -79,7 +160,6 @@ if [ $INSTALL_OS == "debian" ]; then
 else
     ssh root@$HOST "yum install -y rsync"
     setup_epel_repo
-    setup_epel_testing_repo
     ssh root@$HOST "yum --enablerepo=epel install -y haveged"
 fi
 rsync -av --delete autoinstall src tests root@$HOST:/usr/src/fusionforge/
@@ -94,7 +174,7 @@ fi
 retcode=0
 echo "Run phpunit test on $HOST"
 #ssh root@$HOST "TESTGLOB='func/50_PluginsScmBzr/*' /usr/src/fusionforge/autoinstall/vnc-run-testsuite.sh /usr/src/fusionforge/autoinstall/run-testsuite.sh $INSTALL_METHOD/$INSTALL_OS" || retcode=$?
-ssh root@$HOST "/usr/src/fusionforge/autoinstall/vnc-run-testsuite.sh /usr/src/fusionforge/autoinstall/run-testsuite.sh $INSTALL_METHOD/$INSTALL_OS $*" || retcode=$?
+ssh root@$HOST "/usr/src/fusionforge/tests/func/vnc-run-testsuite.sh /usr/src/fusionforge/tests/func/run-testsuite.sh $INSTALL_METHOD/$INSTALL_OS $*" || retcode=$?
 
 copy_logs
 
@@ -109,5 +189,5 @@ if [ $retcode = 0 ] ; then
     esac
 fi
 
-stop_vm_if_not_kept $HOST
+stop_vm $HOST
 exit $retcode
diff --git a/tests/buildbot/fusionforge-unittests.sh b/tests/buildbot/fusionforge-unittests.sh
index ee59bdb..3ae0559 100755
--- a/tests/buildbot/fusionforge-unittests.sh
+++ b/tests/buildbot/fusionforge-unittests.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# syntax and unit tests (i.e. not func/)
+# Run the syntax and unit tests (i.e. not func/)
 . $(dirname $0)/common-functions
 
 set -ex
diff --git a/tests/buildbot/lxc/init-jenkins.sh b/tests/buildbot/init-jenkins.sh
similarity index 100%
rename from tests/buildbot/lxc/init-jenkins.sh
rename to tests/buildbot/init-jenkins.sh
diff --git a/tests/buildbot/lxc/lxc-wrapper b/tests/buildbot/lxc-wrapper
similarity index 100%
rename from tests/buildbot/lxc/lxc-wrapper
rename to tests/buildbot/lxc-wrapper
diff --git a/tests/buildbot/start_vm b/tests/buildbot/start_vm
deleted file mode 100755
index 495bab3..0000000
--- a/tests/buildbot/start_vm
+++ /dev/null
@@ -1,25 +0,0 @@
-#! /bin/sh
-
-HOST=$1
-
-sudo /usr/local/sbin/lxc-wrapper start $(basename $HOST .local)
-
-# Loop until engine is up and ssh is running
-test_host () {
-    ssh -o 'StrictHostKeyChecking=no' "root@$HOST" uname -a >/dev/null 2>&1
-}
-
-echo "Waiting for $HOST to come up..."
-i=0
-while [ $i -lt 10 ] && ! test_host ; do
-    sleep 10
-    i=$(($i+1))
-    echo -n .
-done
-
-if test_host ; then
-    echo " OK"
-else
-    echo " FAIL"
-    exit 1
-fi
diff --git a/tests/buildbot/stop_vm b/tests/buildbot/stop_vm
deleted file mode 100755
index a67cb32..0000000
--- a/tests/buildbot/stop_vm
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/sh
-
-HOST=$1
-
-sudo /usr/local/sbin/lxc-wrapper stop $(basename $HOST .local)
diff --git a/autoinstall/run-testsuite.sh b/tests/func/run-testsuite.sh
similarity index 95%
rename from autoinstall/run-testsuite.sh
rename to tests/func/run-testsuite.sh
index 4be5fd1..45a937b 100755
--- a/autoinstall/run-testsuite.sh
+++ b/tests/func/run-testsuite.sh
@@ -81,8 +81,8 @@ patch -N /usr/share/*/PHPUnit/Extensions/SeleniumTestCase.php <<'EOF' || true
 EOF
 
 # Reset the database to post-install state
-$(dirname $0)/../tests/func/db_reload.sh --reset
-$(dirname $0)/../tests/func/db_reload.sh --backup
+$(dirname $0)/db_reload.sh --reset
+$(dirname $0)/db_reload.sh --backup
 
 # Now, start the functionnal test suite using phpunit and selenium
-$(dirname $0)/../tests/func/phpunit-selenium.sh $@
+$(dirname $0)/phpunit-selenium.sh $@
diff --git a/autoinstall/vnc-run-testsuite.sh b/tests/func/vnc-run-testsuite.sh
similarity index 100%
rename from autoinstall/vnc-run-testsuite.sh
rename to tests/func/vnc-run-testsuite.sh

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

Summary of changes:
 autoinstall/common-backports                     |   5 +-
 tests/buildbot/{lxc => }/Makefile                |   3 -
 tests/buildbot/common-functions                  | 109 +++++------------
 tests/buildbot/common-vm                         | 144 -----------------------
 tests/buildbot/config/default                    |   7 +-
 tests/buildbot/destroy_vm                        |   5 -
 tests/buildbot/fusionforge-build-and-test.sh     |  92 ++++++++++++++-
 tests/buildbot/fusionforge-unittests.sh          |   2 +-
 tests/buildbot/{lxc => }/init-jenkins.sh         |   0
 tests/buildbot/{lxc => }/lxc-wrapper             |   0
 tests/buildbot/start_vm                          |  25 ----
 tests/buildbot/stop_vm                           |   5 -
 {autoinstall => tests/func}/run-testsuite.sh     |   6 +-
 {autoinstall => tests/func}/vnc-run-testsuite.sh |   0
 14 files changed, 121 insertions(+), 282 deletions(-)
 rename tests/buildbot/{lxc => }/Makefile (92%)
 delete mode 100644 tests/buildbot/common-vm
 delete mode 100755 tests/buildbot/destroy_vm
 rename tests/buildbot/{lxc => }/init-jenkins.sh (100%)
 rename tests/buildbot/{lxc => }/lxc-wrapper (100%)
 delete mode 100755 tests/buildbot/start_vm
 delete mode 100755 tests/buildbot/stop_vm
 rename {autoinstall => tests/func}/run-testsuite.sh (95%)
 rename {autoinstall => tests/func}/vnc-run-testsuite.sh (100%)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list