Skip to contentSkip to conversation

refactor and clean up make-flight

PATCH In review Ian Campbell 2 participants 24 messages Jan 22, 2014

lore
Share & tools
lore
#0 lore raw

cover refactor and clean up make-flight

The following series refactors make-flight to move some of the useful guts into a helper shell library which can be used for creating alternative flights. My goal was to create a flight which ran distro domU tests (starting with Debian), which I've posted before and you rightly commented that make-flight could do with some refactoring...

I didn't actually get as far as a working distro flight (or rather I haven't addressed the comments you had on test cases last time) but my make-distro-flight is below for reference. It is much smaller that last time!

There's a lot of code motion and whitespace cleanups in here, I've tried to split them up (hence too many patches).

I've confirmed with mg-show-flight-runvars things only changed as expected:

osstest +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
xen-4.0-testing No change
xen-4.1-testing No change
xen-4.2-testing +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
xen-4.3-testing +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
xen-unstable +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
qemu-upstream-unstable No change
qemu-upstream-4.2-testing No change
qemu-upstream-4.3-testing No change
linux-3.10 +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
linux-3.4 +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
linux-arm-xen No change
linux-linus +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
linux-mingo-tip-master +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1
linux-3.0 +test-amd64-i386-xl-qemuu-win7-amd64 & +test-amd64-i386-xl-qemuu-winxpsp3-vcpus1

Phew! (NB: no new tests for qemu-upstream-* because they are already included)

I'm a little uncertain about the number of global variables which are assumed to be in scope in various places, but the alternative was dozens of parameters to each function, which given the lack of named arguments to functions in shell seemed like an equally bad proposition.

Ian.

8<--------------------------

#!/bin/bash

# This is part of "osstest", an automated testing framework for Xen. # Copyright (C) 2009-2013 Citrix Inc.
#
# This program is free software: you can redistribute it and/or modify

# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program 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 Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

set -e

branch=$1
xenbranch=$2
blessing=$3
buildflight=$4

flight=./cs-flight-create $blessing $branch

. ap-common
. cri-common
. mfi-common

defsuite=getconfig DebianSuite
defguestsuite=getconfig GuestDebianSuite

if [ x$buildflight = x ]; then

if [ "x$BUILD_LVEXTEND_MAX" != x ]; then

     BUILD_RUNVARS+=" build_lvextend_max=$BUILD_LVEXTEND_MAX "

fi

WANT_XEND=false REVISION_LINUX_OLD=disable

create_build_jobs

else

bfi=$buildflight.

fi

job_create_test_filter_callback () {
    :
}
test_matrix_branch_filter_callback () {
    :
}

test_do_one_arch_dist () {

  job_create_test test-$xenarch$kern-$dom0arch-$domU-$dist-di   \
    test-debian-di xl                                           \
      xenbuildjob=${bfi}build-$xenarch                          \
      kernbuildjob=${bfi}build-$dom0arch-$kernbuild             \
      buildjob=${bfi}build-$dom0arch                            \
      debian_arch=$domU                                         \
      debian_dist=$dist                                         \

all_hostflags=$most_hostflags
}

test_matrix_do_one () {
case ${xenarch} in
amd64) domUarches="amd64 i386";;
i386) domUarches="";;
armhf) domUarches="armhf";;
esac

for domU in $domUarches ; do
for dist in squeeze wheezy jessie ; do
case $domU_$dist in
armhf_squeeze) continue;;
*) ;;
esac

test_do_one_arch_dist

done
done
}

test_matrix_iterate

echo $flight

# Local variables:
# mode: sh
# sh-basic-offset: 2
# indent-tabs-mode: nil
# End:

#1 lore raw

PATCH 1/17 make-flight: expand hard tabs

Run expand on the file.

Add an emacs magic var block disabling indent-tabs-mode and setting the sh mode basic offset to 2 (which appears to be the common, but not universal, case).

---
 make-flight | 370 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 188 insertions(+), 182 deletions(-)
make-flight +188 -182
index fea642c..ddd4427 100755
@@ -58,8 +58,8 @@ if [ x$buildflight = x ]; then
       xen-4.2-testing) continue;;
       esac
       pvops_kernel="
-	tree_linux=$TREE_LINUX_ARM
-	revision_linux=${REVISION_LINUX_ARM:-${DEFAULT_REVISION_LINUX_ARM}}
+        tree_linux=$TREE_LINUX_ARM
+        revision_linux=${REVISION_LINUX_ARM:-${DEFAULT_REVISION_LINUX_ARM}}
       "
       pvops_kconfig_overrides="
         kconfig_override_y=CONFIG_EXT4_FS
@@ -70,8 +70,8 @@ if [ x$buildflight = x ]; then
       linux-arm-xen) continue;;
       esac
       pvops_kernel="
-	tree_linux=$TREE_LINUX
-	revision_linux=${REVISION_LINUX:-${DEFAULT_REVISION_LINUX}}
+        tree_linux=$TREE_LINUX
+        revision_linux=${REVISION_LINUX:-${DEFAULT_REVISION_LINUX}}
       "
       ;;
     esac
@@ -115,49 +115,49 @@ if [ x$buildflight = x ]; then
     esac
 
     eval "
-	arch_runvars=\"\$ARCH_RUNVARS_$arch\"
+        arch_runvars=\"\$ARCH_RUNVARS_$arch\"
     "
 
     build_hostflags=share-build-$suite-$arch,arch-$arch,suite-$suite,purpose-build
 
-    ./cs-job-create $flight build-$arch build				     \
-		arch=$arch enable_xend=$build_defxend enable_ovmf=$enable_ovmf	     \
-	tree_qemu=$TREE_QEMU	     \
-	tree_qemuu=$TREE_QEMU_UPSTREAM	     \
-	tree_xen=$TREE_XEN		     \
-		$RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars     \
-		$suite_runvars                                               \
-		host_hostflags=$build_hostflags    \
-		revision_xen=$REVISION_XEN				     \
-		revision_qemu=$REVISION_QEMU				     \
-		revision_qemuu=$REVISION_QEMU_UPSTREAM
+    ./cs-job-create $flight build-$arch build                                \
+                arch=$arch enable_xend=$build_defxend enable_ovmf=$enable_ovmf       \
+        tree_qemu=$TREE_QEMU         \
+        tree_qemuu=$TREE_QEMU_UPSTREAM       \
+        tree_xen=$TREE_XEN                   \
+                $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars     \
+                $suite_runvars                                               \
+                host_hostflags=$build_hostflags    \
+                revision_xen=$REVISION_XEN                                   \
+                revision_qemu=$REVISION_QEMU                                 \
+                revision_qemuu=$REVISION_QEMU_UPSTREAM
 
     if [ $build_extraxend = "true" ] ; then
-    ./cs-job-create $flight build-$arch-xend build			     \
-		arch=$arch enable_xend=true enable_ovmf=$enable_ovmf	     \
-	tree_qemu=$TREE_QEMU	     \
-	tree_qemuu=$TREE_QEMU_UPSTREAM	     \
-	tree_xen=$TREE_XEN		     \
-		$RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars     \
-		$suite_runvars                                               \
-		host_hostflags=$build_hostflags    \
-		revision_xen=$REVISION_XEN				     \
-		revision_qemu=$REVISION_QEMU				     \
-		revision_qemuu=$REVISION_QEMU_UPSTREAM
+    ./cs-job-create $flight build-$arch-xend build                           \
+                arch=$arch enable_xend=true enable_ovmf=$enable_ovmf         \
+        tree_qemu=$TREE_QEMU         \
+        tree_qemuu=$TREE_QEMU_UPSTREAM       \
+        tree_xen=$TREE_XEN                   \
+                $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars     \
+                $suite_runvars                                               \
+                host_hostflags=$build_hostflags    \
+                revision_xen=$REVISION_XEN                                   \
+                revision_qemu=$REVISION_QEMU                                 \
+                revision_qemuu=$REVISION_QEMU_UPSTREAM
     fi
 
-    ./cs-job-create $flight build-$arch-pvops build-kern		     \
-		arch=$arch kconfighow=xen-enable-xen-config		     \
-	tree_xen=$TREE_XEN		     \
-		$RUNVARS $BUILD_RUNVARS $BUILD_LINUX_RUNVARS $arch_runvars   \
-		$suite_runvars                                               \
-		host_hostflags=$build_hostflags    \
-		xen_kernels=linux-2.6-pvops				     \
-		revision_xen=$REVISION_XEN				     \
-		$pvops_kernel $pvops_kconfig_overrides			     \
-		${TREEVCS_LINUX:+treevcs_linux=}${TREEVCS_LINUX}	\
-		tree_linuxfirmware=$TREE_LINUXFIRMWARE			     \
-		revision_linuxfirmware=$REVISION_LINUXFIRMWARE
+    ./cs-job-create $flight build-$arch-pvops build-kern                     \
+                arch=$arch kconfighow=xen-enable-xen-config                  \
+        tree_xen=$TREE_XEN                   \
+                $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_RUNVARS $arch_runvars   \
+                $suite_runvars                                               \
+                host_hostflags=$build_hostflags    \
+                xen_kernels=linux-2.6-pvops                                  \
+                revision_xen=$REVISION_XEN                                   \
+                $pvops_kernel $pvops_kconfig_overrides                       \
+                ${TREEVCS_LINUX:+treevcs_linux=}${TREEVCS_LINUX}        \
+                tree_linuxfirmware=$TREE_LINUXFIRMWARE                       \
+                revision_linuxfirmware=$REVISION_LINUXFIRMWARE
 
     case "$arch" in
     armhf) continue;; # don't do any other kernel builds
@@ -165,19 +165,19 @@ if [ x$buildflight = x ]; then
 
     if [ "x$REVISION_LINUX_OLD" != xdisable ]; then
 
-      ./cs-job-create $flight build-$arch-oldkern build			\
-		arch=$arch						\
-	tree_qemu=$TREE_QEMU	\
-	tree_qemuu=$TREE_QEMU_UPSTREAM	     \
-	tree_xen=$TREE_XEN		\
-		$RUNVARS $BUILD_RUNVARS $BUILD_LINUX_OLD_RUNVARS	\
-		$arch_runvars $suite_runvars				\
-		host_hostflags=$build_hostflags \
-		xen_kernels=linux-2.6-xen				\
-		revision_xen=$REVISION_XEN				\
-		revision_qemu=$REVISION_QEMU			        \
-		revision_qemuu=$REVISION_QEMU_UPSTREAM			\
-	tree_linux=http://xenbits.xen.org/linux-2.6.18-xen.hg	\
+      ./cs-job-create $flight build-$arch-oldkern build                 \
+                arch=$arch                                              \
+        tree_qemu=$TREE_QEMU    \
+        tree_qemuu=$TREE_QEMU_UPSTREAM       \
+        tree_xen=$TREE_XEN              \
+                $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_OLD_RUNVARS        \
+                $arch_runvars $suite_runvars                            \
+                host_hostflags=$build_hostflags \
+                xen_kernels=linux-2.6-xen                               \
+                revision_xen=$REVISION_XEN                              \
+                revision_qemu=$REVISION_QEMU                            \
+                revision_qemuu=$REVISION_QEMU_UPSTREAM                  \
+        tree_linux=http://xenbits.xen.org/linux-2.6.18-xen.hg   \
         revision_linux=$REVISION_LINUX_OLD
 
     fi
@@ -185,17 +185,17 @@ if [ x$buildflight = x ]; then
     if false && [ $arch = i386 -a "x$REVISION_LINUX_XCP" != xdisable ]; then
       # XCP dom0 kernel is 32-bit only
 
-      ./cs-job-create $flight build-$arch-xcpkern build-kern		      \
-		$RUNVARS $BUILD_RUNVARS $BUILD_LINUX_XCP_RUNVARS	      \
-		$arch_runvars $suite_runvars				      \
-		arch=$arch						\
-	kconfighow=intree-buildconfigs kimagefile=arch/x86/boot/vmlinuz \
-		host_hostflags=$build_hostflags     \
-		tree_xen=$TREE_XEN	      \
-		revision_xen=$REVISION_XEN				      \
-	tree_linux=$TREEBASE_LINUX_XCP.hg    \
+      ./cs-job-create $flight build-$arch-xcpkern build-kern                  \
+                $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_XCP_RUNVARS              \
+                $arch_runvars $suite_runvars                                  \
+                arch=$arch                                              \
+        kconfighow=intree-buildconfigs kimagefile=arch/x86/boot/vmlinuz \
+                host_hostflags=$build_hostflags     \
+                tree_xen=$TREE_XEN            \
+                revision_xen=$REVISION_XEN                                    \
+        tree_linux=$TREEBASE_LINUX_XCP.hg    \
      tree_pq_linux=$TREEBASE_LINUX_XCP.pq.hg \
-        revision_linux=$REVISION_LINUX_XCP				      \
+        revision_linux=$REVISION_LINUX_XCP                                    \
         revision_pq_linux=$REVISION_PQ_LINUX_XCP
 
     fi
@@ -226,17 +226,17 @@ stripy () {
 }
 
 job_create_test () {
-	local job=$1; shift
-	local recipe=$1; shift
-	local toolstack=$1; shift
-	local xenarch=$1; shift
-	local dom0arch=$1; shift
+        local job=$1; shift
+        local recipe=$1; shift
+        local toolstack=$1; shift
+        local xenarch=$1; shift
+        local dom0arch=$1; shift
 
         local job_md5=`echo "$job" | md5sum`
         job_md5="${job_md5%  -}"
 
-	xenbuildjob="${bfi}build-$xenarch"
-	buildjob="${bfi}build-$dom0arch"
+        xenbuildjob="${bfi}build-$xenarch"
+        buildjob="${bfi}build-$dom0arch"
 
         case "$xenbranch:$toolstack" in
         xen-3.*-testing:*) ;;
@@ -245,8 +245,8 @@ job_create_test () {
         xen-4.2-testing:*) ;;
         xen-4.3-testing:*) ;;
         *:xend) xenbuildjob="$xenbuildjob-xend"
-		buildjob="${bfi}build-$dom0arch-xend"
-		;;
+                buildjob="${bfi}build-$dom0arch-xend"
+                ;;
         esac
 
         if [ "x$JOB_MD5_PATTERN" != x ]; then
@@ -256,36 +256,36 @@ job_create_test () {
                 esac
         fi
 
-	case "$branch" in
-	qemu-upstream-*)
-		case " $* " in
-		*" device_model_version=qemu-xen "*)
-			;;
-		*)
-			: "suppressed $job"
-			return;;
-		esac
-		;;
-	*)
-	        case "$job" in
-		*-qemuu-*)
-	           if [ "x$toolstack" != xxl ]; then return; fi
-
-	           case "$job" in
-	           *-win*)
-	                      case "$job_md5" in
-	                      *[0-a]) return;;
-	                      esac
-	                      ;;
-	           esac
-	           ;;
-		esac
-		;;
+        case "$branch" in
+        qemu-upstream-*)
+                case " $* " in
+                *" device_model_version=qemu-xen "*)
+                        ;;
+                *)
+                        : "suppressed $job"
+                        return;;
+                esac
+                ;;
+        *)
+                case "$job" in
+                *-qemuu-*)
+                   if [ "x$toolstack" != xxl ]; then return; fi
+
+                   case "$job" in
+                   *-win*)
+                              case "$job_md5" in
+                              *[0-a]) return;;
+                              esac
+                              ;;
+                   esac
+                   ;;
+                esac
+                ;;
         esac
 
-	./cs-job-create $flight $job $recipe toolstack=$toolstack	\
-		$RUNVARS $TEST_RUNVARS $most_runvars			\
-		xenbuildjob=$xenbuildjob buildjob=$buildjob "$@"
+        ./cs-job-create $flight $job $recipe toolstack=$toolstack       \
+                $RUNVARS $TEST_RUNVARS $most_runvars                    \
+                xenbuildjob=$xenbuildjob buildjob=$buildjob "$@"
 }
 
 for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
@@ -294,37 +294,37 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
   case "$xenarch" in
   armhf)
-	# Arm from 4.3 onwards only
-	case "$xenbranch" in
-	xen-3.*-testing) continue;;
-	xen-4.0-testing) continue;;
-	xen-4.1-testing) continue;;
-	xen-4.2-testing) continue;;
-	*) ;;
-	esac
-	case "$branch" in
-	linux-arm-xen) ;;
-	linux-*) continue;;
-	qemu-*) continue;;
-	esac
-	;;
+        # Arm from 4.3 onwards only
+        case "$xenbranch" in
+        xen-3.*-testing) continue;;
+        xen-4.0-testing) continue;;
+        xen-4.1-testing) continue;;
+        xen-4.2-testing) continue;;
+        *) ;;
+        esac
+        case "$branch" in
+        linux-arm-xen) ;;
+        linux-*) continue;;
+        qemu-*) continue;;
+        esac
+        ;;
   i386)
-	# 32-bit Xen is dropped from 4.3 onwards
-	case "$xenbranch" in
-	xen-3.*-testing) ;;
-	xen-4.0-testing) ;;
-	xen-4.1-testing) ;;
-	xen-4.2-testing) ;;
-	*) continue ;;
-	esac
-	case "$branch" in
-	linux-arm-xen) continue;;
-	esac
-	;;
+        # 32-bit Xen is dropped from 4.3 onwards
+        case "$xenbranch" in
+        xen-3.*-testing) ;;
+        xen-4.0-testing) ;;
+        xen-4.1-testing) ;;
+        xen-4.2-testing) ;;
+        *) continue ;;
+        esac
+        case "$branch" in
+        linux-arm-xen) continue;;
+        esac
+        ;;
   amd64)
-	case "$branch" in
-	linux-arm-xen) continue;;
-	esac
+        case "$branch" in
+        linux-arm-xen) continue;;
+        esac
   esac
 
   case "$xenarch" in
@@ -339,10 +339,10 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
   fi
 
   case "$xenbranch" in
-  xen-3.*-testing)	onetoolstack=xend ;;
-  xen-4.0-testing)	onetoolstack=xend ;;
-  xen-4.1-testing)	onetoolstack=xend ;;
-  *)			onetoolstack=xl ;;
+  xen-3.*-testing)      onetoolstack=xend ;;
+  xen-4.0-testing)      onetoolstack=xend ;;
+  xen-4.1-testing)      onetoolstack=xend ;;
+  *)                    onetoolstack=xl ;;
   esac
 
   for kern in ''; do
@@ -350,28 +350,28 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
     case $kern in
     '')
                 kernbuild=pvops
-		kernkind=pvops
-		;;
+                kernkind=pvops
+                ;;
     -xcpkern)
                 kernbuild=xcpkern
-		kernkind=2627
-		if [ "x$REVISION_LINUX_XCP" = xdisable ]; then continue; fi
-		;;
-    *)		echo >&2 "kernkind ?  $kern"; exit 1 ;;
+                kernkind=2627
+                if [ "x$REVISION_LINUX_XCP" = xdisable ]; then continue; fi
+                ;;
+    *)          echo >&2 "kernkind ?  $kern"; exit 1 ;;
     esac
 
     for dom0arch in i386 amd64 armhf; do
 
       case ${xenarch}_${dom0arch} in
-	  amd64_amd64) ;;
-	  amd64_i386) ;;
-	  i386_i386) ;;
-	  armhf_armhf) ;;
-	  *) continue ;;
+          amd64_amd64) ;;
+          amd64_i386) ;;
+          i386_i386) ;;
+          armhf_armhf) ;;
+          *) continue ;;
       esac
 
       eval "
-	  arch_runvars=\"\$ARCH_RUNVARS_$dom0arch\"
+          arch_runvars=\"\$ARCH_RUNVARS_$dom0arch\"
       "
 
       if [ x$kern = x-xcpkern -a $dom0arch != i386 ]; then continue; fi
@@ -384,35 +384,35 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
       most_hostflags="arch-$dom0arch,arch-xen-$xenarch,suite-$suite,purpose-test"
 
       most_runvars="
-		arch=$dom0arch			        	\
-		kernbuildjob=${bfi}build-$dom0arch-$kernbuild 	\
-		kernkind=$kernkind		        	\
-		$arch_runvars $suite_runvars
-		"
+                arch=$dom0arch                                  \
+                kernbuildjob=${bfi}build-$dom0arch-$kernbuild   \
+                kernkind=$kernkind                              \
+                $arch_runvars $suite_runvars
+                "
       if [ $dom0arch = armhf ]; then
-	  job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
-		$xenarch $dom0arch					  \
-		$debian_runvars all_hostflags=$most_hostflags
-	  continue
+          job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
+                $xenarch $dom0arch                                        \
+                $debian_runvars all_hostflags=$most_hostflags
+          continue
       fi
 
       job_create_test test-$xenarch$kern-$dom0arch-pv test-debian xend \
-		$xenarch $dom0arch					  \
-		$debian_runvars all_hostflags=$most_hostflags
+                $xenarch $dom0arch                                        \
+                $debian_runvars all_hostflags=$most_hostflags
 
       job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
-		$xenarch $dom0arch					  \
-		$debian_runvars all_hostflags=$most_hostflags
+                $xenarch $dom0arch                                        \
+                $debian_runvars all_hostflags=$most_hostflags
 
       if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
 
         for freebsdarch in amd64 i386; do
 
  job_create_test test-$xenarch$kern-$dom0arch$qemuu_suffix-freebsd10-$freebsdarch \
-			test-freebsd xl $xenarch $dom0arch \
-			freebsd_arch=$freebsdarch \
+                        test-freebsd xl $xenarch $dom0arch \
+                        freebsd_arch=$freebsdarch \
  freebsd_image=${FREEBSD_IMAGE_PREFIX-FreeBSD-10.0-BETA3-}$freebsdarch${FREEBSD_IMAGE_SUFFIX--20131103-r257580.qcow2.xz} \
-			all_hostflags=$most_hostflags
+                        all_hostflags=$most_hostflags
 
         done
 
@@ -456,8 +456,8 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
       job_create_test \
                 test-$xenarch$kern-$dom0arch-$toolstack$qemuu_suffix-winxpsp3$vcpus_suffix \
                 test-win $toolstack $xenarch $dom0arch $qemuu_runvar \
-		win_image=winxpsp3.iso $vcpus_runvars	\
-		all_hostflags=$most_hostflags,hvm
+                win_image=winxpsp3.iso $vcpus_runvars   \
+                all_hostflags=$most_hostflags,hvm
 
             fi
         done
@@ -466,32 +466,32 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
       job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-win7-amd64 \
                 test-win xl $xenarch $dom0arch $qemuu_runvar \
-		win_image=win7-x64.iso \
-		all_hostflags=$most_hostflags,hvm
+                win_image=win7-x64.iso \
+                all_hostflags=$most_hostflags,hvm
 
       fi
 
       if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
 
-	for cpuvendor in amd intel; do
+        for cpuvendor in amd intel; do
 
     job_create_test test-$xenarch$kern-$dom0arch$qemuu_suffix-rhel6hvm-$cpuvendor \
-						test-rhelhvm xl $xenarch $dom0arch \
-		redhat_image=rhel-server-6.1-i386-dvd.iso		\
-		all_hostflags=$most_hostflags,hvm-$cpuvendor \
+                                                test-rhelhvm xl $xenarch $dom0arch \
+                redhat_image=rhel-server-6.1-i386-dvd.iso               \
+                all_hostflags=$most_hostflags,hvm-$cpuvendor \
                 $qemuu_runvar
 
-	done
+        done
 
       fi
 
       done # qemuu_suffix
 
       job_create_test test-$xenarch$kern-$dom0arch-pair test-pair \
-		$onetoolstack $xenarch $dom0arch \
+                $onetoolstack $xenarch $dom0arch \
                 !host !host_hostflags \
-		$debian_runvars \
-		all_hostflags=$most_hostflags,equiv-1
+                $debian_runvars \
+                all_hostflags=$most_hostflags,equiv-1
 
       if [ $xenarch = amd64 -a $dom0arch = amd64 ]; then
 
@@ -499,8 +499,8 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
       job_create_test test-$xenarch$kern-$dom0arch-xl-sedf$pin  \
            test-debian xl $xenarch $dom0arch \
-		guests_vcpus=4 xen_boot_append="sched=sedf loglvl=all ${pin:+dom0_vcpus_pin}" linux_boot_append='loglevel=9 debug' \
-		$debian_runvars all_hostflags=$most_hostflags
+                guests_vcpus=4 xen_boot_append="sched=sedf loglvl=all ${pin:+dom0_vcpus_pin}" linux_boot_append='loglevel=9 debug' \
+                $debian_runvars all_hostflags=$most_hostflags
 
        done
 
@@ -510,12 +510,12 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
       job_create_test test-$xenarch$kern-$dom0arch-xl-multivcpu \
                         test-debian xl $xenarch $dom0arch guests_vcpus=4  \
-		        $debian_runvars all_hostflags=$most_hostflags
+                        $debian_runvars all_hostflags=$most_hostflags
 
       job_create_test test-$xenarch$kern-$dom0arch-xl-credit2  \
-           test-debian xl $xenarch $dom0arch				  \
-		guests_vcpus=4 xen_boot_append='sched=credit2'		  \
-		$debian_runvars all_hostflags=$most_hostflags
+           test-debian xl $xenarch $dom0arch                              \
+                guests_vcpus=4 xen_boot_append='sched=credit2'            \
+                $debian_runvars all_hostflags=$most_hostflags
 
       fi
 
@@ -524,10 +524,10 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
         for cpuvendor in intel; do
 
       job_create_test test-$xenarch$kern-$dom0arch-xl-pcipt-intel \
-                        test-debian-nomigr xl $xenarch $dom0arch	  \
-		guests_vcpus=4						  \
-		$debian_runvars debian_pcipassthrough_nic=host		  \
-		all_hostflags=$most_hostflags,hvm-$cpuvendor,pcipassthrough-nic
+                        test-debian-nomigr xl $xenarch $dom0arch          \
+                guests_vcpus=4                                            \
+                $debian_runvars debian_pcipassthrough_nic=host            \
+                all_hostflags=$most_hostflags,hvm-$cpuvendor,pcipassthrough-nic
 
         done
 
@@ -540,3 +540,9 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 done
 
 echo $flight
+
+# Local variables:
+# mode: sh
+# sh-basic-offset: 2
+# indent-tabs-mode: nil
+# End:
Signature · 1 line
1.8.5.2
#2 lore raw

PATCH 2/17 make-flight: refactor common function "stripy" into helper library

In reply to Ian Campbell

Will be useful for other make-flight variants.

---
 make-flight | 18 +-----------------
 mfi-common  | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 17 deletions(-)
 create mode 100644 mfi-common
make-flight +1 -17
index ddd4427..fdde3af 100755
@@ -28,6 +28,7 @@ flight=`./cs-flight-create $blessing $branch`
 
 . ap-common
 . cri-common
+. mfi-common
 
 defsuite=`getconfig DebianSuite`
 defguestsuite=`getconfig GuestDebianSuite`
@@ -208,23 +209,6 @@ else
 
 fi
 
-stripy () {
-        local out_vn="$1"; shift
-        local out_0="$1"; shift
-        local out_1="$1"; shift
-        local out_val=0
-        local this_val
-        local this_cmp
-        while [ $# != 0 ]; do
-                this_val="$1"; shift
-                this_cmp="$1"; shift
-                if [ "x$this_val" = "x$this_cmp" ]; then
-                        out_val=$(( $out_val ^ 1 ))
-                fi
-        done
-        eval "$out_vn=\"\$out_$out_val\""
-}
-
 job_create_test () {
         local job=$1; shift
         local recipe=$1; shift
mfi-common new file +38 -0
new file mode 100644
index 0000000..ec0beca
@@ -0,0 +1,38 @@
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2014 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program 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 Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+stripy () {
+  local out_vn="$1"; shift
+  local out_0="$1"; shift
+  local out_1="$1"; shift
+  local out_val=0
+  local this_val
+  local this_cmp
+  while [ $# != 0 ]; do
+    this_val="$1"; shift
+    this_cmp="$1"; shift
+    if [ "x$this_val" = "x$this_cmp" ]; then
+      out_val=$(( $out_val ^ 1 ))
+    fi
+  done
+  eval "$out_vn=\"\$out_$out_val\""
+}
+
+# Local variables:
+# mode: sh
+# sh-basic-offset: 2
+# indent-tabs-mode: nil
+# End:
Signature · 1 line
1.8.5.2
#3 lore raw

PATCH 3/17 make-flight: Drop obsolete/unused xenrt_images variable.

In reply to Ian Campbell
---
 make-flight | 2 --
 1 file changed, 2 deletions(-)
make-flight +0 -2
index fdde3af..19f60f1 100755
@@ -33,8 +33,6 @@ flight=`./cs-flight-create $blessing $branch`
 defsuite=`getconfig DebianSuite`
 defguestsuite=`getconfig GuestDebianSuite`
 
-xenrt_images=/usr/groups/images/autoinstall
-
 if [ x$buildflight = x ]; then
 
   if [ "x$BUILD_LVEXTEND_MAX" != x ]; then
Signature · 1 line
1.8.5.2
#4 lore raw

PATCH 4/17 make-flight: refactor build job creation into mfi-common

In reply to Ian Campbell

This is pure code motion *except* I have aligned the backslash continuation lines at the same time -- I was unable to resist doing so.

---
 make-flight | 162 +---------------------------------------------------------
 mfi-common  | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 166 insertions(+), 161 deletions(-)
make-flight +1 -161
index 19f60f1..5136d09 100755
@@ -39,167 +39,7 @@ if [ x$buildflight = x ]; then
      BUILD_RUNVARS+=" build_lvextend_max=$BUILD_LVEXTEND_MAX "
   fi
 
-  for arch in ${BUILD_ARCHES- i386 amd64 armhf }; do
-
-    if [ "x$arch" = xdisable ]; then continue; fi
-
-    case "$arch" in
-    armhf)
-      case "$branch" in
-      linux-arm-xen) ;;
-      linux-*) continue;;
-      qemu-*) continue;;
-      esac
-      case "$xenbranch" in
-      xen-3.*-testing) continue;;
-      xen-4.0-testing) continue;;
-      xen-4.1-testing) continue;;
-      xen-4.2-testing) continue;;
-      esac
-      pvops_kernel="
-        tree_linux=$TREE_LINUX_ARM
-        revision_linux=${REVISION_LINUX_ARM:-${DEFAULT_REVISION_LINUX_ARM}}
-      "
-      pvops_kconfig_overrides="
-        kconfig_override_y=CONFIG_EXT4_FS
-      "
-      ;;
-    *)
-      case "$branch" in
-      linux-arm-xen) continue;;
-      esac
-      pvops_kernel="
-        tree_linux=$TREE_LINUX
-        revision_linux=${REVISION_LINUX:-${DEFAULT_REVISION_LINUX}}
-      "
-      ;;
-    esac
-
-    case "$arch" in
-    armhf) suite="wheezy";;
-    *)     suite=$defsuite;;
-    esac
-
-    if [ $suite != $defsuite ] ; then
-        suite_runvars="host_suite=$suite"
-    else
-        suite_runvars=
-    fi
-
-    # In 4.4 onwards xend is off by default. If necessary we build a
-    # separate set of binaries with xend enabled in order to run those
-    # tests which use xend.
-    case "$arch" in
-    i386|amd64) want_xend=true;;
-    *) want_xend=false;;
-    esac
-
-    case "$xenbranch" in
-    xen-3.*-testing) build_defxend=$want_xend; build_extraxend=false;;
-    xen-4.0-testing) build_defxend=$want_xend; build_extraxend=false;;
-    xen-4.1-testing) build_defxend=$want_xend; build_extraxend=false;;
-    xen-4.2-testing) build_defxend=$want_xend; build_extraxend=false;;
-    xen-4.3-testing) build_defxend=$want_xend; build_extraxend=false;;
-    *) build_defxend=false;
-       build_extraxend=$want_xend
-    esac
-
-    case "$xenbranch" in
-    xen-3.*-testing) enable_ovmf=false;;
-    xen-4.0-testing) enable_ovmf=false;;
-    xen-4.1-testing) enable_ovmf=false;;
-    xen-4.2-testing) enable_ovmf=false;;
-    xen-4.3-testing) enable_ovmf=false;;
-    *) enable_ovmf=true;
-    esac
-
-    eval "
-        arch_runvars=\"\$ARCH_RUNVARS_$arch\"
-    "
-
-    build_hostflags=share-build-$suite-$arch,arch-$arch,suite-$suite,purpose-build
-
-    ./cs-job-create $flight build-$arch build                                \
-                arch=$arch enable_xend=$build_defxend enable_ovmf=$enable_ovmf       \
-        tree_qemu=$TREE_QEMU         \
-        tree_qemuu=$TREE_QEMU_UPSTREAM       \
-        tree_xen=$TREE_XEN                   \
-                $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars     \
-                $suite_runvars                                               \
-                host_hostflags=$build_hostflags    \
-                revision_xen=$REVISION_XEN                                   \
-                revision_qemu=$REVISION_QEMU                                 \
-                revision_qemuu=$REVISION_QEMU_UPSTREAM
-
-    if [ $build_extraxend = "true" ] ; then
-    ./cs-job-create $flight build-$arch-xend build                           \
-                arch=$arch enable_xend=true enable_ovmf=$enable_ovmf         \
-        tree_qemu=$TREE_QEMU         \
-        tree_qemuu=$TREE_QEMU_UPSTREAM       \
-        tree_xen=$TREE_XEN                   \
-                $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars     \
-                $suite_runvars                                               \
-                host_hostflags=$build_hostflags    \
-                revision_xen=$REVISION_XEN                                   \
-                revision_qemu=$REVISION_QEMU                                 \
-                revision_qemuu=$REVISION_QEMU_UPSTREAM
-    fi
-
-    ./cs-job-create $flight build-$arch-pvops build-kern                     \
-                arch=$arch kconfighow=xen-enable-xen-config                  \
-        tree_xen=$TREE_XEN                   \
-                $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_RUNVARS $arch_runvars   \
-                $suite_runvars                                               \
-                host_hostflags=$build_hostflags    \
-                xen_kernels=linux-2.6-pvops                                  \
-                revision_xen=$REVISION_XEN                                   \
-                $pvops_kernel $pvops_kconfig_overrides                       \
-                ${TREEVCS_LINUX:+treevcs_linux=}${TREEVCS_LINUX}        \
-                tree_linuxfirmware=$TREE_LINUXFIRMWARE                       \
-                revision_linuxfirmware=$REVISION_LINUXFIRMWARE
-
-    case "$arch" in
-    armhf) continue;; # don't do any other kernel builds
-    esac
-
-    if [ "x$REVISION_LINUX_OLD" != xdisable ]; then
-
-      ./cs-job-create $flight build-$arch-oldkern build                 \
-                arch=$arch                                              \
-        tree_qemu=$TREE_QEMU    \
-        tree_qemuu=$TREE_QEMU_UPSTREAM       \
-        tree_xen=$TREE_XEN              \
-                $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_OLD_RUNVARS        \
-                $arch_runvars $suite_runvars                            \
-                host_hostflags=$build_hostflags \
-                xen_kernels=linux-2.6-xen                               \
-                revision_xen=$REVISION_XEN                              \
-                revision_qemu=$REVISION_QEMU                            \
-                revision_qemuu=$REVISION_QEMU_UPSTREAM                  \
-        tree_linux=http://xenbits.xen.org/linux-2.6.18-xen.hg   \
-        revision_linux=$REVISION_LINUX_OLD
-
-    fi
-
-    if false && [ $arch = i386 -a "x$REVISION_LINUX_XCP" != xdisable ]; then
-      # XCP dom0 kernel is 32-bit only
-
-      ./cs-job-create $flight build-$arch-xcpkern build-kern                  \
-                $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_XCP_RUNVARS              \
-                $arch_runvars $suite_runvars                                  \
-                arch=$arch                                              \
-        kconfighow=intree-buildconfigs kimagefile=arch/x86/boot/vmlinuz \
-                host_hostflags=$build_hostflags     \
-                tree_xen=$TREE_XEN            \
-                revision_xen=$REVISION_XEN                                    \
-        tree_linux=$TREEBASE_LINUX_XCP.hg    \
-     tree_pq_linux=$TREEBASE_LINUX_XCP.pq.hg \
-        revision_linux=$REVISION_LINUX_XCP                                    \
-        revision_pq_linux=$REVISION_PQ_LINUX_XCP
-
-    fi
-
-  done
+  create_build_jobs
 
 else
 
mfi-common +165 -0

171 lines not on this page · raw message

Signature · 1 line
1.8.5.2
#5 lore raw

PATCH 5/17 Remove support for building the XCP kernel

In reply to Ian Campbell

This kernel is well and truly dead.

I've left some of the general support for using other kernel types in place even though it is now unused.

---
 cr-daily-branch   |  1 -
 cr-external-linux |  1 -
 make-flight       |  7 -------
 mfi-common        | 18 ------------------
 4 files changed, 27 deletions(-)
cr-daily-branch +0 -1
index e343a99..fa29045 100755
@@ -137,7 +137,6 @@ xen)
 linux)
         realtree=linux
 	NEW_REVISION=$REVISION_LINUX
-	export REVISION_LINUX_XCP=disable
 	export REVISION_LINUX_OLD=disable
 	: ${GITFORCEFLAG:=$GITFORCEFLAG_TREE_LINUX_THIS}
 	;;
cr-external-linux +0 -1
index 2d1a826..073fc86 100755
@@ -40,7 +40,6 @@ select_branch
 check_stop external-linux.
 
 export REVISION_LINUX_OLD=disable
-export REVISION_LINUX_XCP=disable
 export REVISION_XEN="`./ap-fetch-version-baseline $xenbranch`"
 export TREE_LINUX="$url"
 
make-flight +0 -7
index 5136d09..8eaec51 100755
@@ -174,11 +174,6 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
                 kernbuild=pvops
                 kernkind=pvops
                 ;;
-    -xcpkern)
-                kernbuild=xcpkern
-                kernkind=2627
-                if [ "x$REVISION_LINUX_XCP" = xdisable ]; then continue; fi
-                ;;
     *)          echo >&2 "kernkind ?  $kern"; exit 1 ;;
     esac
 
@@ -196,8 +191,6 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
           arch_runvars=\"\$ARCH_RUNVARS_$dom0arch\"
       "
 
-      if [ x$kern = x-xcpkern -a $dom0arch != i386 ]; then continue; fi
-
       debian_runvars="debian_kernkind=$kernkind debian_arch=$dom0arch"
       if [ $guestsuite != $defguestsuite ] ; then
           debian_runvars="$debian_runvars debian_suite=$guestsuite"
mfi-common +0 -18
index 97bc506..82bc875 100644
@@ -175,24 +175,6 @@ create_build_jobs () {
 
     fi
 
-    if false && [ $arch = i386 -a "x$REVISION_LINUX_XCP" != xdisable ]; then
-      # XCP dom0 kernel is 32-bit only
-
-      ./cs-job-create $flight build-$arch-xcpkern build-kern            \
-                $RUNVARS $BUILD_RUNVARS $BUILD_LINUX_XCP_RUNVARS        \
-                $arch_runvars $suite_runvars                            \
-                arch=$arch                                              \
-        kconfighow=intree-buildconfigs kimagefile=arch/x86/boot/vmlinuz \
-                host_hostflags=$build_hostflags                         \
-                tree_xen=$TREE_XEN                                      \
-                revision_xen=$REVISION_XEN                              \
-        tree_linux=$TREEBASE_LINUX_XCP.hg                               \
-     tree_pq_linux=$TREEBASE_LINUX_XCP.pq.hg                            \
-        revision_linux=$REVISION_LINUX_XCP                              \
-        revision_pq_linux=$REVISION_PQ_LINUX_XCP
-
-    fi
-
   done
 }
 
Signature · 1 line
1.8.5.2
#6 lore raw

PATCH 6/17 mfi-common: Allow caller of create_build_jobs to include/exclude xend builds

In reply to Ian Campbell
---
 mfi-common | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
mfi-common +8 -4
index 82bc875..3342acc 100644
@@ -83,10 +83,14 @@ create_build_jobs () {
     # In 4.4 onwards xend is off by default. If necessary we build a
     # separate set of binaries with xend enabled in order to run those
     # tests which use xend.
-    case "$arch" in
-    i386|amd64) want_xend=true;;
-    *) want_xend=false;;
-    esac
+    if [ -z "$WANT_XEND" ]; then
+      want_xend=$WANT_XEND
+    else
+      case "$arch" in
+        i386|amd64) want_xend=true;;
+        *) want_xend=false;;
+      esac
+    fi
 
     case "$xenbranch" in
     xen-3.*-testing) build_defxend=$want_xend; build_extraxend=false;;
Signature · 1 line
1.8.5.2
#7 lore raw

Re: [PATCH OSSTEST 06/17] mfi-common: Allow caller of create_build_jobs to include/exclude xend builds

Ian Campbell writes ("[PATCH OSSTEST 06/17] mfi-common: Allow caller of create_build_jobs to include/exclude xend builds"):

mfi-common create_build_jobs () { · line 88

Quoted 4 lines
mfi-common +3 -0
+    if [ -z "$WANT_XEND" ]; then
+      want_xend=$WANT_XEND
+    else

If $WANT_XEND is the empty string, also set want_xend to "" ?

Ian.

#8 lore raw

PATCH 7/17 mfi-common: restrict scope of local vars in create_build_jobs

In reply to Ian Campbell
---
 mfi-common | 7 +++++++
 1 file changed, 7 insertions(+)
mfi-common +7 -0
index 3342acc..28c3f3f 100644
@@ -33,6 +33,13 @@ stripy () {
 
 create_build_jobs () {
 
+  local arch
+  local pvops_kernel pvops_kconfig_overrides
+  local suite suite_runvars
+  local want_xend build_defxend build_extraxend
+  local enable_ovmf
+  local build_hostflags
+
   for arch in ${BUILD_ARCHES- i386 amd64 armhf }; do
 
     if [ "x$arch" = xdisable ]; then continue; fi
Signature · 1 line
1.8.5.2
#9 lore raw

PATCH 8/17 mfi-common: fixup

In reply to Ian Campbell
---
 mfi-common | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mfi-common +1 -1
index 28c3f3f..e7cae0a 100644
@@ -90,7 +90,7 @@ create_build_jobs () {
     # In 4.4 onwards xend is off by default. If necessary we build a
     # separate set of binaries with xend enabled in order to run those
     # tests which use xend.
-    if [ -z "$WANT_XEND" ]; then
+    if [ -n "$WANT_XEND" ]; then
       want_xend=$WANT_XEND
     else
       case "$arch" in
Signature · 1 line
1.8.5.2
#10 lore raw

Re: [PATCH OSSTEST 08/17] mfi-common: fixup

Ian Campbell writes ("[PATCH OSSTEST 08/17] mfi-common: fixup"):

mfi-common create_build_jobs () { · line 93

Quoted 2 lines
mfi-common +1 -1
-    if [ -z "$WANT_XEND" ]; then
+    if [ -n "$WANT_XEND" ]; then

Ah :-)

#11 lore raw

Re: [PATCH OSSTEST 08/17] mfi-common: fixup

Quoted 5 lines · Ian Jackson

Ian Campbell writes ("[PATCH OSSTEST 08/17] mfi-common: fixup"):

mfi-common create_build_jobs () { · line 93

Quoted 2 lines
mfi-common +1 -1
-    if [ -z "$WANT_XEND" ]; then
+    if [ -n "$WANT_XEND" ]; then

Ah :-)

Um, oops, sorry ;-)

Ian.

#12 lore raw

PATCH 9/17 make-flight: Remove md5sum based job filtering

In reply to Ian Campbell

JOB_MD5_PATTERN was intended to allow making randomly smaller flights, but is not used in practice.

The filtering of the qemmu*-win jobs was intended to reduce the number of combinations but ended up suppressing only:
test-amd64-i386-xl-qemuu-winxpsp3-vcpus1 test-amd64-i386-xl-qemuu-win7-amd64

Both of which seem useful so allow them to be enabled.

---
 make-flight | 18 ------------------
 1 file changed, 18 deletions(-)
make-flight +0 -18
index 8eaec51..7085dc2 100755
@@ -54,9 +54,6 @@ job_create_test () {
         local xenarch=$1; shift
         local dom0arch=$1; shift
 
-        local job_md5=`echo "$job" | md5sum`
-        job_md5="${job_md5%  -}"
-
         xenbuildjob="${bfi}build-$xenarch"
         buildjob="${bfi}build-$dom0arch"
 
@@ -71,13 +68,6 @@ job_create_test () {
                 ;;
         esac
 
-        if [ "x$JOB_MD5_PATTERN" != x ]; then
-                case "$job_md5" in
-                $JOB_MD5_PATTERN)       ;;
-                *)                      return;;
-                esac
-        fi
-
         case "$branch" in
         qemu-upstream-*)
                 case " $* " in
@@ -92,14 +82,6 @@ job_create_test () {
                 case "$job" in
                 *-qemuu-*)
                    if [ "x$toolstack" != xxl ]; then return; fi
-
-                   case "$job" in
-                   *-win*)
-                              case "$job_md5" in
-                              *[0-a]) return;;
-                              esac
-                              ;;
-                   esac
                    ;;
                 esac
                 ;;
Signature · 1 line
1.8.5.2
#13 lore raw

PATCH 10/17 make-flight: refactor job_create_test filters

In reply to Ian Campbell

This will allow job_create_test to be moved mfi-common.

No (intentional) change to the set of jobs which are created.

---
 make-flight | 50 +++++++++++++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 19 deletions(-)
make-flight +31 -19
index 7085dc2..34c1ce4 100755
@@ -47,7 +47,38 @@ else
 
 fi
 
+job_create_test_filter_callback () {
+  local job=$1; shift
+  local recipe=$1; shift
+  local toolstack=$1; shift
+  local xenarch=$1; shift
+  local dom0arch=$1; shift
+
+  case "$branch" in
+    qemu-upstream-*)
+      case " $* " in
+        *" device_model_version=qemu-xen "*)
+          ;;
+        *)
+          : "suppressed $job"
+          return 1;;
+      esac
+      ;;
+    *)
+      case "$job" in
+        *-qemuu-*)
+          if [ "x$toolstack" != xxl ]; then return 1; fi
+          ;;
+      esac
+      ;;
+  esac
+
+  return 0;
+}
+
 job_create_test () {
+        job_create_test_filter_callback "$@" || return 0
+
         local job=$1; shift
         local recipe=$1; shift
         local toolstack=$1; shift
@@ -68,25 +99,6 @@ job_create_test () {
                 ;;
         esac
 
-        case "$branch" in
-        qemu-upstream-*)
-                case " $* " in
-                *" device_model_version=qemu-xen "*)
-                        ;;
-                *)
-                        : "suppressed $job"
-                        return;;
-                esac
-                ;;
-        *)
-                case "$job" in
-                *-qemuu-*)
-                   if [ "x$toolstack" != xxl ]; then return; fi
-                   ;;
-                esac
-                ;;
-        esac
-
         ./cs-job-create $flight $job $recipe toolstack=$toolstack       \
                 $RUNVARS $TEST_RUNVARS $most_runvars                    \
                 xenbuildjob=$xenbuildjob buildjob=$buildjob "$@"
Signature · 1 line
1.8.5.2
#14 lore raw

PATCH 11/17 make-flight: refactor job_create_test into mfi-common

In reply to Ian Campbell

Now that it uses a callback it can trivially be moved to mfi-common

Arguably the setting of *buildjob could also be a callback, but my intended use case doesn't need that and it seems reasonable enough for now that users of the common job_create_test also use the common create_build_jobs (or produce something sufficiently similar).

---
 make-flight | 28 ----------------------------
 mfi-common  | 28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 28 deletions(-)
make-flight +0 -28
index 34c1ce4..8862be5 100755
@@ -76,34 +76,6 @@ job_create_test_filter_callback () {
   return 0;
 }
 
-job_create_test () {
-        job_create_test_filter_callback "$@" || return 0
-
-        local job=$1; shift
-        local recipe=$1; shift
-        local toolstack=$1; shift
-        local xenarch=$1; shift
-        local dom0arch=$1; shift
-
-        xenbuildjob="${bfi}build-$xenarch"
-        buildjob="${bfi}build-$dom0arch"
-
-        case "$xenbranch:$toolstack" in
-        xen-3.*-testing:*) ;;
-        xen-4.0-testing:*) ;;
-        xen-4.1-testing:*) ;;
-        xen-4.2-testing:*) ;;
-        xen-4.3-testing:*) ;;
-        *:xend) xenbuildjob="$xenbuildjob-xend"
-                buildjob="${bfi}build-$dom0arch-xend"
-                ;;
-        esac
-
-        ./cs-job-create $flight $job $recipe toolstack=$toolstack       \
-                $RUNVARS $TEST_RUNVARS $most_runvars                    \
-                xenbuildjob=$xenbuildjob buildjob=$buildjob "$@"
-}
-
 for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
   if [ "x$xenarch" = xdisable ]; then continue; fi
mfi-common +28 -0
index e7cae0a..373110b 100644
@@ -189,6 +189,34 @@ create_build_jobs () {
   done
 }
 
+job_create_test () {
+  job_create_test_filter_callback "$@" || return 0
+
+  local job=$1; shift
+  local recipe=$1; shift
+  local toolstack=$1; shift
+  local xenarch=$1; shift
+  local dom0arch=$1; shift
+
+  xenbuildjob="${bfi}build-$xenarch"
+  buildjob="${bfi}build-$dom0arch"
+
+  case "$xenbranch:$toolstack" in
+    xen-3.*-testing:*) ;;
+    xen-4.0-testing:*) ;;
+    xen-4.1-testing:*) ;;
+    xen-4.2-testing:*) ;;
+    xen-4.3-testing:*) ;;
+    *:xend) xenbuildjob="$xenbuildjob-xend"
+            buildjob="${bfi}build-$dom0arch-xend"
+            ;;
+  esac
+
+  ./cs-job-create $flight $job $recipe toolstack=$toolstack       \
+    $RUNVARS $TEST_RUNVARS $most_runvars                          \
+    xenbuildjob=$xenbuildjob buildjob=$buildjob "$@"
+}
+
 # Local variables:
 # mode: sh
 # sh-basic-offset: 2
Signature · 1 line
1.8.5.2
#15 lore raw

PATCH 12/17 make-flight: refactor test case filter over $branch

In reply to Ian Campbell
---
 make-flight | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)
make-flight +22 -11
index 8862be5..e1b65b2 100755
@@ -76,10 +76,31 @@ job_create_test_filter_callback () {
   return 0;
 }
 
+test_matrix_branch_filter_callback () {
+  case "$xenarch" in
+  armhf)
+        case "$branch" in
+        linux-arm-xen) ;;
+        linux-*) return 1;;
+        qemu-*) return 1;;
+        esac
+        ;;
+  i386|amd64)
+        case "$branch" in
+        linux-arm-xen) return 1;;
+        esac
+        ;;
+  esac
+
+  return 0
+}
+
 for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
   if [ "x$xenarch" = xdisable ]; then continue; fi
 
+  test_matrix_branch_filter_callback || continue
+
   case "$xenarch" in
   armhf)
         # Arm from 4.3 onwards only
@@ -90,11 +111,6 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
         xen-4.2-testing) continue;;
         *) ;;
         esac
-        case "$branch" in
-        linux-arm-xen) ;;
-        linux-*) continue;;
-        qemu-*) continue;;
-        esac
         ;;
   i386)
         # 32-bit Xen is dropped from 4.3 onwards
@@ -105,14 +121,9 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
         xen-4.2-testing) ;;
         *) continue ;;
         esac
-        case "$branch" in
-        linux-arm-xen) continue;;
-        esac
         ;;
   amd64)
-        case "$branch" in
-        linux-arm-xen) continue;;
-        esac
+        ;;
   esac
 
   case "$xenarch" in
Signature · 1 line
1.8.5.2
#16 lore raw

PATCH 13/17 make-flight: Separate matrix iteration from test job creation

In reply to Ian Campbell
---
 make-flight | 180 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 91 insertions(+), 89 deletions(-)
make-flight +91 -89
index e1b65b2..97421f2 100755
@@ -95,97 +95,12 @@ test_matrix_branch_filter_callback () {
   return 0
 }
 
-for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
-
-  if [ "x$xenarch" = xdisable ]; then continue; fi
-
-  test_matrix_branch_filter_callback || continue
-
-  case "$xenarch" in
-  armhf)
-        # Arm from 4.3 onwards only
-        case "$xenbranch" in
-        xen-3.*-testing) continue;;
-        xen-4.0-testing) continue;;
-        xen-4.1-testing) continue;;
-        xen-4.2-testing) continue;;
-        *) ;;
-        esac
-        ;;
-  i386)
-        # 32-bit Xen is dropped from 4.3 onwards
-        case "$xenbranch" in
-        xen-3.*-testing) ;;
-        xen-4.0-testing) ;;
-        xen-4.1-testing) ;;
-        xen-4.2-testing) ;;
-        *) continue ;;
-        esac
-        ;;
-  amd64)
-        ;;
-  esac
-
-  case "$xenarch" in
-  armhf) suite="wheezy";  guestsuite="wheezy";;
-  *)     suite=$defsuite; guestsuite=$defguestsuite;;
-  esac
-
-  if [ $suite != $defsuite ] ; then
-      suite_runvars="host_suite=$suite"
-  else
-      suite_runvars=
-  fi
-
-  case "$xenbranch" in
-  xen-3.*-testing)      onetoolstack=xend ;;
-  xen-4.0-testing)      onetoolstack=xend ;;
-  xen-4.1-testing)      onetoolstack=xend ;;
-  *)                    onetoolstack=xl ;;
-  esac
-
-  for kern in ''; do
-
-    case $kern in
-    '')
-                kernbuild=pvops
-                kernkind=pvops
-                ;;
-    *)          echo >&2 "kernkind ?  $kern"; exit 1 ;;
-    esac
-
-    for dom0arch in i386 amd64 armhf; do
-
-      case ${xenarch}_${dom0arch} in
-          amd64_amd64) ;;
-          amd64_i386) ;;
-          i386_i386) ;;
-          armhf_armhf) ;;
-          *) continue ;;
-      esac
-
-      eval "
-          arch_runvars=\"\$ARCH_RUNVARS_$dom0arch\"
-      "
-
-      debian_runvars="debian_kernkind=$kernkind debian_arch=$dom0arch"
-      if [ $guestsuite != $defguestsuite ] ; then
-          debian_runvars="$debian_runvars debian_suite=$guestsuite"
-      fi
-
-      most_hostflags="arch-$dom0arch,arch-xen-$xenarch,suite-$suite,purpose-test"
-
-      most_runvars="
-                arch=$dom0arch                                  \
-                kernbuildjob=${bfi}build-$dom0arch-$kernbuild   \
-                kernkind=$kernkind                              \
-                $arch_runvars $suite_runvars
-                "
+test_matrix_do_one () {
       if [ $dom0arch = armhf ]; then
           job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
                 $xenarch $dom0arch                                        \
                 $debian_runvars all_hostflags=$most_hostflags
-          continue
+          return
       fi
 
       job_create_test test-$xenarch$kern-$dom0arch-pv test-debian xend \
@@ -324,11 +239,98 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
         done
 
       fi
+}
 
-    done
+for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
-  done
+  if [ "x$xenarch" = xdisable ]; then continue; fi
+
+  test_matrix_branch_filter_callback || continue
+
+  case "$xenarch" in
+  armhf)
+        # Arm from 4.3 onwards only
+        case "$xenbranch" in
+        xen-3.*-testing) continue;;
+        xen-4.0-testing) continue;;
+        xen-4.1-testing) continue;;
+        xen-4.2-testing) continue;;
+        *) ;;
+        esac
+        ;;
+  i386)
+        # 32-bit Xen is dropped from 4.3 onwards
+        case "$xenbranch" in
+        xen-3.*-testing) ;;
+        xen-4.0-testing) ;;
+        xen-4.1-testing) ;;
+        xen-4.2-testing) ;;
+        *) continue ;;
+        esac
+        ;;
+  amd64)
+        ;;
+  esac
+
+  case "$xenarch" in
+  armhf) suite="wheezy";  guestsuite="wheezy";;
+  *)     suite=$defsuite; guestsuite=$defguestsuite;;
+  esac
+
+  if [ $suite != $defsuite ] ; then
+      suite_runvars="host_suite=$suite"
+  else
+      suite_runvars=
+  fi
+
+  case "$xenbranch" in
+  xen-3.*-testing)      onetoolstack=xend ;;
+  xen-4.0-testing)      onetoolstack=xend ;;
+  xen-4.1-testing)      onetoolstack=xend ;;
+  *)                    onetoolstack=xl ;;
+  esac
+
+  for kern in ''; do
+
+    case $kern in
+    '')
+                kernbuild=pvops
+                kernkind=pvops
+                ;;
+    *)          echo >&2 "kernkind ?  $kern"; exit 1 ;;
+    esac
+
+    for dom0arch in i386 amd64 armhf; do
+
+      case ${xenarch}_${dom0arch} in
+          amd64_amd64) ;;
+          amd64_i386) ;;
+          i386_i386) ;;
+          armhf_armhf) ;;
+          *) continue ;;
+      esac
+
+      eval "
+          arch_runvars=\"\$ARCH_RUNVARS_$dom0arch\"
+      "
+
+      debian_runvars="debian_kernkind=$kernkind debian_arch=$dom0arch"
+      if [ $guestsuite != $defguestsuite ] ; then
+          debian_runvars="$debian_runvars debian_suite=$guestsuite"
+      fi
 
+      most_hostflags="arch-$dom0arch,arch-xen-$xenarch,suite-$suite,purpose-test"
+
+      most_runvars="
+                arch=$dom0arch                                  \
+                kernbuildjob=${bfi}build-$dom0arch-$kernbuild   \
+                kernkind=$kernkind                              \
+                $arch_runvars $suite_runvars
+                "
+
+      test_matrix_do_one
+    done
+  done
 done
 
 echo $flight
Signature · 1 line
1.8.5.2
#17 lore raw

PATCH 14/17 make-flight: reduce indentation in test_matrix_do_one

In reply to Ian Campbell

Now that the body of the multiple nested loops is in a function it doesn't need to be so deeply indented. This wasn't done in the previous patch for clarity.

---
 make-flight | 198 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 99 insertions(+), 99 deletions(-)
make-flight +99 -99
index 97421f2..177523b 100755
@@ -96,24 +96,24 @@ test_matrix_branch_filter_callback () {
 }
 
 test_matrix_do_one () {
-      if [ $dom0arch = armhf ]; then
-          job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
-                $xenarch $dom0arch                                        \
-                $debian_runvars all_hostflags=$most_hostflags
-          return
-      fi
+  if [ $dom0arch = armhf ]; then
+      job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
+            $xenarch $dom0arch                                        \
+            $debian_runvars all_hostflags=$most_hostflags
+      return
+  fi
 
-      job_create_test test-$xenarch$kern-$dom0arch-pv test-debian xend \
-                $xenarch $dom0arch                                        \
-                $debian_runvars all_hostflags=$most_hostflags
+  job_create_test test-$xenarch$kern-$dom0arch-pv test-debian xend \
+            $xenarch $dom0arch                                        \
+            $debian_runvars all_hostflags=$most_hostflags
 
-      job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
-                $xenarch $dom0arch                                        \
-                $debian_runvars all_hostflags=$most_hostflags
+  job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
+            $xenarch $dom0arch                                        \
+            $debian_runvars all_hostflags=$most_hostflags
 
-      if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
+  if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
 
-        for freebsdarch in amd64 i386; do
+    for freebsdarch in amd64 i386; do
 
  job_create_test test-$xenarch$kern-$dom0arch$qemuu_suffix-freebsd10-$freebsdarch \
                         test-freebsd xl $xenarch $dom0arch \
@@ -121,124 +121,124 @@ test_matrix_do_one () {
  freebsd_image=${FREEBSD_IMAGE_PREFIX-FreeBSD-10.0-BETA3-}$freebsdarch${FREEBSD_IMAGE_SUFFIX--20131103-r257580.qcow2.xz} \
                         all_hostflags=$most_hostflags
 
-        done
-
-      fi
+    done
 
-        for qemuu_suffix in '' -qemut -qemuu; do
-          case "$qemuu_suffix" in
-          '')
-                qemuu_runvar=''
-                ;;
-          -qemut)
-                qemuu_runvar=device_model_version=qemu-xen-traditional
-                ;;
-          -qemuu)
-                case $xenbranch in
-                xen-3.*-testing) continue;;
-                xen-4.0-testing) continue;;
-                xen-4.1-testing) continue;;
-                esac
-                qemuu_runvar=device_model_version=qemu-xen
-                ;;
-          esac
+  fi
 
-        for vcpus in '' 1; do
-            case "$vcpus" in
-            '') vcpus_runvars=''; vcpus_suffix='' ;;
-            *) vcpus_runvars=guests_vcpus=$vcpus; vcpus_suffix=-vcpus$vcpus ;;
+    for qemuu_suffix in '' -qemut -qemuu; do
+      case "$qemuu_suffix" in
+      '')
+            qemuu_runvar=''
+            ;;
+      -qemut)
+            qemuu_runvar=device_model_version=qemu-xen-traditional
+            ;;
+      -qemuu)
+            case $xenbranch in
+            xen-3.*-testing) continue;;
+            xen-4.0-testing) continue;;
+            xen-4.1-testing) continue;;
             esac
+            qemuu_runvar=device_model_version=qemu-xen
+            ;;
+      esac
 
-            if [ "x$vcpus" = x ] || \
-               [ "$xenarch$kern-$dom0arch" = "amd64-i386" ]; then
+    for vcpus in '' 1; do
+        case "$vcpus" in
+        '') vcpus_runvars=''; vcpus_suffix='' ;;
+        *) vcpus_runvars=guests_vcpus=$vcpus; vcpus_suffix=-vcpus$vcpus ;;
+        esac
 
-        stripy toolstack xend xl \
-                "$vcpus" 1 \
-                "$kern" '' \
-                "$xenarch" i386 \
-                "$dom0arch" i386
+        if [ "x$vcpus" = x ] || \
+           [ "$xenarch$kern-$dom0arch" = "amd64-i386" ]; then
 
-        toolstack_runvars="toolstack=$toolstack"
+    stripy toolstack xend xl \
+            "$vcpus" 1 \
+            "$kern" '' \
+            "$xenarch" i386 \
+            "$dom0arch" i386
 
-      job_create_test \
-                test-$xenarch$kern-$dom0arch-$toolstack$qemuu_suffix-winxpsp3$vcpus_suffix \
-                test-win $toolstack $xenarch $dom0arch $qemuu_runvar \
-                win_image=winxpsp3.iso $vcpus_runvars   \
-                all_hostflags=$most_hostflags,hvm
+    toolstack_runvars="toolstack=$toolstack"
 
-            fi
-        done
+  job_create_test \
+            test-$xenarch$kern-$dom0arch-$toolstack$qemuu_suffix-winxpsp3$vcpus_suffix \
+            test-win $toolstack $xenarch $dom0arch $qemuu_runvar \
+            win_image=winxpsp3.iso $vcpus_runvars   \
+            all_hostflags=$most_hostflags,hvm
 
-      if [ $xenarch = amd64 ]; then
+        fi
+    done
 
-      job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-win7-amd64 \
-                test-win xl $xenarch $dom0arch $qemuu_runvar \
-                win_image=win7-x64.iso \
-                all_hostflags=$most_hostflags,hvm
+  if [ $xenarch = amd64 ]; then
 
-      fi
+  job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-win7-amd64 \
+            test-win xl $xenarch $dom0arch $qemuu_runvar \
+            win_image=win7-x64.iso \
+            all_hostflags=$most_hostflags,hvm
+
+  fi
 
-      if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
+  if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
 
-        for cpuvendor in amd intel; do
+    for cpuvendor in amd intel; do
 
     job_create_test test-$xenarch$kern-$dom0arch$qemuu_suffix-rhel6hvm-$cpuvendor \
-                                                test-rhelhvm xl $xenarch $dom0arch \
-                redhat_image=rhel-server-6.1-i386-dvd.iso               \
-                all_hostflags=$most_hostflags,hvm-$cpuvendor \
-                $qemuu_runvar
+                                            test-rhelhvm xl $xenarch $dom0arch \
+            redhat_image=rhel-server-6.1-i386-dvd.iso               \
+            all_hostflags=$most_hostflags,hvm-$cpuvendor \
+            $qemuu_runvar
 
-        done
+    done
 
-      fi
+  fi
 
-      done # qemuu_suffix
+  done # qemuu_suffix
 
-      job_create_test test-$xenarch$kern-$dom0arch-pair test-pair \
-                $onetoolstack $xenarch $dom0arch \
-                !host !host_hostflags \
-                $debian_runvars \
-                all_hostflags=$most_hostflags,equiv-1
+  job_create_test test-$xenarch$kern-$dom0arch-pair test-pair \
+            $onetoolstack $xenarch $dom0arch \
+            !host !host_hostflags \
+            $debian_runvars \
+            all_hostflags=$most_hostflags,equiv-1
 
-      if [ $xenarch = amd64 -a $dom0arch = amd64 ]; then
+  if [ $xenarch = amd64 -a $dom0arch = amd64 ]; then
 
-       for pin in '' -pin; do
+   for pin in '' -pin; do
 
-      job_create_test test-$xenarch$kern-$dom0arch-xl-sedf$pin  \
-           test-debian xl $xenarch $dom0arch \
-                guests_vcpus=4 xen_boot_append="sched=sedf loglvl=all ${pin:+dom0_vcpus_pin}" linux_boot_append='loglevel=9 debug' \
-                $debian_runvars all_hostflags=$most_hostflags
+  job_create_test test-$xenarch$kern-$dom0arch-xl-sedf$pin  \
+       test-debian xl $xenarch $dom0arch \
+            guests_vcpus=4 xen_boot_append="sched=sedf loglvl=all ${pin:+dom0_vcpus_pin}" linux_boot_append='loglevel=9 debug' \
+            $debian_runvars all_hostflags=$most_hostflags
 
-       done
+   done
 
-      fi
+  fi
 
-      if [ $xenarch = amd64 -a $dom0arch = i386 ]; then
+  if [ $xenarch = amd64 -a $dom0arch = i386 ]; then
 
-      job_create_test test-$xenarch$kern-$dom0arch-xl-multivcpu \
-                        test-debian xl $xenarch $dom0arch guests_vcpus=4  \
-                        $debian_runvars all_hostflags=$most_hostflags
+  job_create_test test-$xenarch$kern-$dom0arch-xl-multivcpu \
+                    test-debian xl $xenarch $dom0arch guests_vcpus=4  \
+                    $debian_runvars all_hostflags=$most_hostflags
 
-      job_create_test test-$xenarch$kern-$dom0arch-xl-credit2  \
-           test-debian xl $xenarch $dom0arch                              \
-                guests_vcpus=4 xen_boot_append='sched=credit2'            \
-                $debian_runvars all_hostflags=$most_hostflags
+  job_create_test test-$xenarch$kern-$dom0arch-xl-credit2  \
+       test-debian xl $xenarch $dom0arch                              \
+            guests_vcpus=4 xen_boot_append='sched=credit2'            \
+            $debian_runvars all_hostflags=$most_hostflags
 
-      fi
+  fi
 
-      if [ $xenarch = amd64 -a $dom0arch = amd64 -a "$kern" = "" ]; then
+  if [ $xenarch = amd64 -a $dom0arch = amd64 -a "$kern" = "" ]; then
 
-        for cpuvendor in intel; do
+    for cpuvendor in intel; do
 
-      job_create_test test-$xenarch$kern-$dom0arch-xl-pcipt-intel \
-                        test-debian-nomigr xl $xenarch $dom0arch          \
-                guests_vcpus=4                                            \
-                $debian_runvars debian_pcipassthrough_nic=host            \
-                all_hostflags=$most_hostflags,hvm-$cpuvendor,pcipassthrough-nic
+  job_create_test test-$xenarch$kern-$dom0arch-xl-pcipt-intel \
+                    test-debian-nomigr xl $xenarch $dom0arch          \
+            guests_vcpus=4                                            \
+            $debian_runvars debian_pcipassthrough_nic=host            \
+            all_hostflags=$most_hostflags,hvm-$cpuvendor,pcipassthrough-nic
 
-        done
+    done
 
-      fi
+  fi
 }
 
 for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
Signature · 1 line
1.8.5.2
#18 lore raw

PATCH 15/17 make-flight: Refactor test matrix iteration into mfi-common

In reply to Ian Campbell
---
 make-flight |  92 +-----------------------------------------------------
 mfi-common  | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 91 deletions(-)
make-flight +1 -91
index 177523b..4a144ec 100755
@@ -241,97 +241,7 @@ test_matrix_do_one () {
   fi
 }
 
-for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
-
-  if [ "x$xenarch" = xdisable ]; then continue; fi
-
-  test_matrix_branch_filter_callback || continue
-
-  case "$xenarch" in
-  armhf)
-        # Arm from 4.3 onwards only
-        case "$xenbranch" in
-        xen-3.*-testing) continue;;
-        xen-4.0-testing) continue;;
-        xen-4.1-testing) continue;;
-        xen-4.2-testing) continue;;
-        *) ;;
-        esac
-        ;;
-  i386)
-        # 32-bit Xen is dropped from 4.3 onwards
-        case "$xenbranch" in
-        xen-3.*-testing) ;;
-        xen-4.0-testing) ;;
-        xen-4.1-testing) ;;
-        xen-4.2-testing) ;;
-        *) continue ;;
-        esac
-        ;;
-  amd64)
-        ;;
-  esac
-
-  case "$xenarch" in
-  armhf) suite="wheezy";  guestsuite="wheezy";;
-  *)     suite=$defsuite; guestsuite=$defguestsuite;;
-  esac
-
-  if [ $suite != $defsuite ] ; then
-      suite_runvars="host_suite=$suite"
-  else
-      suite_runvars=
-  fi
-
-  case "$xenbranch" in
-  xen-3.*-testing)      onetoolstack=xend ;;
-  xen-4.0-testing)      onetoolstack=xend ;;
-  xen-4.1-testing)      onetoolstack=xend ;;
-  *)                    onetoolstack=xl ;;
-  esac
-
-  for kern in ''; do
-
-    case $kern in
-    '')
-                kernbuild=pvops
-                kernkind=pvops
-                ;;
-    *)          echo >&2 "kernkind ?  $kern"; exit 1 ;;
-    esac
-
-    for dom0arch in i386 amd64 armhf; do
-
-      case ${xenarch}_${dom0arch} in
-          amd64_amd64) ;;
-          amd64_i386) ;;
-          i386_i386) ;;
-          armhf_armhf) ;;
-          *) continue ;;
-      esac
-
-      eval "
-          arch_runvars=\"\$ARCH_RUNVARS_$dom0arch\"
-      "
-
-      debian_runvars="debian_kernkind=$kernkind debian_arch=$dom0arch"
-      if [ $guestsuite != $defguestsuite ] ; then
-          debian_runvars="$debian_runvars debian_suite=$guestsuite"
-      fi
-
-      most_hostflags="arch-$dom0arch,arch-xen-$xenarch,suite-$suite,purpose-test"
-
-      most_runvars="
-                arch=$dom0arch                                  \
-                kernbuildjob=${bfi}build-$dom0arch-$kernbuild   \
-                kernkind=$kernkind                              \
-                $arch_runvars $suite_runvars
-                "
-
-      test_matrix_do_one
-    done
-  done
-done
+test_matrix_iterate
 
 echo $flight
 
mfi-common +101 -0

107 lines not on this page · raw message

Signature · 1 line
1.8.5.2
#19 lore raw

PATCH 16/17 mfi-common: onetoolstack does not vary for a given $xenbranch

In reply to Ian Campbell
---
 mfi-common | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
mfi-common +8 -7
index 5529979..60802ef 100644
@@ -225,6 +225,14 @@ job_create_test () {
 # Provides various convenience variables for the callback.
 #
 test_matrix_iterate () {
+
+  case "$xenbranch" in
+  xen-3.*-testing)      onetoolstack=xend ;;
+  xen-4.0-testing)      onetoolstack=xend ;;
+  xen-4.1-testing)      onetoolstack=xend ;;
+  *)                    onetoolstack=xl ;;
+  esac
+
   for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do
 
     if [ "x$xenarch" = xdisable ]; then continue; fi
@@ -267,13 +275,6 @@ test_matrix_iterate () {
         suite_runvars=
     fi
 
-    case "$xenbranch" in
-    xen-3.*-testing)      onetoolstack=xend ;;
-    xen-4.0-testing)      onetoolstack=xend ;;
-    xen-4.1-testing)      onetoolstack=xend ;;
-    *)                    onetoolstack=xl ;;
-    esac
-
     for kern in ''; do
 
       case $kern in
Signature · 1 line
1.8.5.2
#20 lore raw

PATCH 17/17 make-flight: refactor test_matrix_do_one

In reply to Ian Campbell

Pull some test creation out into their own subdirectories. This allows the total level of indentation to be reduced.

It also allows us to invert the pre-condition test and simply return at the top of the subroutine, which further reduces indentation.

---
 make-flight | 201 +++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 118 insertions(+), 83 deletions(-)
make-flight +118 -83
index 4a144ec..092a0cf 100755
@@ -95,25 +95,13 @@ test_matrix_branch_filter_callback () {
   return 0
 }
 
-test_matrix_do_one () {
-  if [ $dom0arch = armhf ]; then
-      job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
-            $xenarch $dom0arch                                        \
-            $debian_runvars all_hostflags=$most_hostflags
-      return
-  fi
-
-  job_create_test test-$xenarch$kern-$dom0arch-pv test-debian xend \
-            $xenarch $dom0arch                                        \
-            $debian_runvars all_hostflags=$most_hostflags
-
-  job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
-            $xenarch $dom0arch                                        \
-            $debian_runvars all_hostflags=$most_hostflags
+do_freebsd_tests () {
 
-  if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
+  if [ $xenarch != amd64 -o $dom0arch != i386 -o "$kern" != "" ]; then
+    return
+  fi
 
-    for freebsdarch in amd64 i386; do
+  for freebsdarch in amd64 i386; do
 
  job_create_test test-$xenarch$kern-$dom0arch$qemuu_suffix-freebsd10-$freebsdarch \
                         test-freebsd xl $xenarch $dom0arch \
@@ -121,36 +109,20 @@ test_matrix_do_one () {
  freebsd_image=${FREEBSD_IMAGE_PREFIX-FreeBSD-10.0-BETA3-}$freebsdarch${FREEBSD_IMAGE_SUFFIX--20131103-r257580.qcow2.xz} \
                         all_hostflags=$most_hostflags
 
-    done
-
-  fi
-
-    for qemuu_suffix in '' -qemut -qemuu; do
-      case "$qemuu_suffix" in
-      '')
-            qemuu_runvar=''
-            ;;
-      -qemut)
-            qemuu_runvar=device_model_version=qemu-xen-traditional
-            ;;
-      -qemuu)
-            case $xenbranch in
-            xen-3.*-testing) continue;;
-            xen-4.0-testing) continue;;
-            xen-4.1-testing) continue;;
-            esac
-            qemuu_runvar=device_model_version=qemu-xen
-            ;;
-      esac
+  done
+}
 
-    for vcpus in '' 1; do
-        case "$vcpus" in
-        '') vcpus_runvars=''; vcpus_suffix='' ;;
-        *) vcpus_runvars=guests_vcpus=$vcpus; vcpus_suffix=-vcpus$vcpus ;;
-        esac
+do_hvm_winxp_tests () {
+  for vcpus in '' 1; do
+    case "$vcpus" in
+      '') vcpus_runvars=''; vcpus_suffix='' ;;
+      *) vcpus_runvars=guests_vcpus=$vcpus; vcpus_suffix=-vcpus$vcpus ;;
+    esac
 
-        if [ "x$vcpus" = x ] || \
-           [ "$xenarch$kern-$dom0arch" = "amd64-i386" ]; then
+    if [ "x$vcpus" != x ] && \
+       [ "$xenarch$kern-$dom0arch" != "amd64-i386" ]; then
+      continue
+    fi
 
     stripy toolstack xend xl \
             "$vcpus" 1 \
@@ -160,85 +132,148 @@ test_matrix_do_one () {
 
     toolstack_runvars="toolstack=$toolstack"
 
-  job_create_test \
+    job_create_test \
             test-$xenarch$kern-$dom0arch-$toolstack$qemuu_suffix-winxpsp3$vcpus_suffix \
             test-win $toolstack $xenarch $dom0arch $qemuu_runvar \
             win_image=winxpsp3.iso $vcpus_runvars   \
             all_hostflags=$most_hostflags,hvm
 
-        fi
-    done
+  done
+}
 
-  if [ $xenarch = amd64 ]; then
+do_hvm_win7_x64_tests () {
+  if [ $xenarch != amd64 ]; then
+    return
+  fi
 
   job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-win7-amd64 \
             test-win xl $xenarch $dom0arch $qemuu_runvar \
             win_image=win7-x64.iso \
             all_hostflags=$most_hostflags,hvm
+}
 
+do_hvm_rhel6_tests () {
+  if [ $xenarch != amd64 -o $dom0arch != i386 -o "$kern" != "" ]; then
+    return
   fi
 
-  if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
-
-    for cpuvendor in amd intel; do
+  for cpuvendor in amd intel; do
 
     job_create_test test-$xenarch$kern-$dom0arch$qemuu_suffix-rhel6hvm-$cpuvendor \
                                             test-rhelhvm xl $xenarch $dom0arch \
-            redhat_image=rhel-server-6.1-i386-dvd.iso               \
+            redhat_image=rhel-server-6.1-i386-dvd.iso \
             all_hostflags=$most_hostflags,hvm-$cpuvendor \
             $qemuu_runvar
 
-    done
+  done
+}
 
+do_sedf_tests () {
+  if [ $xenarch != amd64 -o $dom0arch != amd64 ]; then
+    return
   fi
 
-  done # qemuu_suffix
+  for pin in '' -pin; do
+    job_create_test test-$xenarch$kern-$dom0arch-xl-sedf$pin  \
+       test-debian xl $xenarch $dom0arch                      \
+            guests_vcpus=4                                    \
+            xen_boot_append="sched=sedf loglvl=all ${pin:+dom0_vcpus_pin}" \
+            linux_boot_append='loglevel=9 debug'              \
+            $debian_runvars all_hostflags=$most_hostflags
+  done
+}
 
-  job_create_test test-$xenarch$kern-$dom0arch-pair test-pair \
-            $onetoolstack $xenarch $dom0arch \
-            !host !host_hostflags \
-            $debian_runvars \
-            all_hostflags=$most_hostflags,equiv-1
+do_credit2_tests () {
+  if [ $xenarch != amd64 -o $dom0arch != i386 ]; then
+    return
+  fi
 
-  if [ $xenarch = amd64 -a $dom0arch = amd64 ]; then
+  job_create_test test-$xenarch$kern-$dom0arch-xl-credit2             \
+       test-debian xl $xenarch $dom0arch                              \
+            guests_vcpus=4 xen_boot_append='sched=credit2'            \
+            $debian_runvars all_hostflags=$most_hostflags
+}
 
-   for pin in '' -pin; do
+do_passthrough_tests () {
+  if [ $xenarch != amd64 -o $dom0arch != amd64 -o "$kern" != "" ]; then
+    return
+  fi
 
-  job_create_test test-$xenarch$kern-$dom0arch-xl-sedf$pin  \
-       test-debian xl $xenarch $dom0arch \
-            guests_vcpus=4 xen_boot_append="sched=sedf loglvl=all ${pin:+dom0_vcpus_pin}" linux_boot_append='loglevel=9 debug' \
+  for cpuvendor in intel; do
+    job_create_test test-$xenarch$kern-$dom0arch-xl-pcipt-intel       \
+                    test-debian-nomigr xl $xenarch $dom0arch          \
+            guests_vcpus=4                                            \
+            $debian_runvars debian_pcipassthrough_nic=host            \
+            all_hostflags=$most_hostflags,hvm-$cpuvendor,pcipassthrough-nic
+
+  done
+}
+
+test_matrix_do_one () {
+
+  # Basic PV Linux test with xl
+
+  job_create_test test-$xenarch$kern-$dom0arch-xl test-debian xl \
+            $xenarch $dom0arch                                   \
             $debian_runvars all_hostflags=$most_hostflags
 
-   done
+  # No further arm tests at the moment
+  if [ $dom0arch = armhf ]; then
+      return
+  fi
 
+  # xend PV guest test on x86 only
+  if [ $dom0arch = "i386" -o $dom0arch = "amd64" ]; then
+    job_create_test test-$xenarch$kern-$dom0arch-pv test-debian xend \
+            $xenarch $dom0arch                                       \
+            $debian_runvars all_hostflags=$most_hostflags
   fi
 
-  if [ $xenarch = amd64 -a $dom0arch = i386 ]; then
+  do_freebsd_tests
 
-  job_create_test test-$xenarch$kern-$dom0arch-xl-multivcpu \
-                    test-debian xl $xenarch $dom0arch guests_vcpus=4  \
-                    $debian_runvars all_hostflags=$most_hostflags
+  for qemuu_suffix in '' -qemut -qemuu; do
+    case "$qemuu_suffix" in
+    '')
+          qemuu_runvar=''
+          ;;
+    -qemut)
+          qemuu_runvar=device_model_version=qemu-xen-traditional
+          ;;
+    -qemuu)
+          case $xenbranch in
+          xen-3.*-testing) continue;;
+          xen-4.0-testing) continue;;
+          xen-4.1-testing) continue;;
+          esac
+          qemuu_runvar=device_model_version=qemu-xen
+          ;;
+    esac
 
-  job_create_test test-$xenarch$kern-$dom0arch-xl-credit2  \
-       test-debian xl $xenarch $dom0arch                              \
-            guests_vcpus=4 xen_boot_append='sched=credit2'            \
-            $debian_runvars all_hostflags=$most_hostflags
+    do_hvm_winxp_tests
+    do_hvm_win7_x64_tests
+    do_hvm_rhel6_tests
 
-  fi
+  done # qemuu_suffix
 
-  if [ $xenarch = amd64 -a $dom0arch = amd64 -a "$kern" = "" ]; then
+  # Test live migration
+  job_create_test test-$xenarch$kern-$dom0arch-pair test-pair \
+            $onetoolstack $xenarch $dom0arch \
+            !host !host_hostflags \
+            $debian_runvars \
+            all_hostflags=$most_hostflags,equiv-1
 
-    for cpuvendor in intel; do
+  do_sedf_tests
+  do_credit2_tests
 
-  job_create_test test-$xenarch$kern-$dom0arch-xl-pcipt-intel \
-                    test-debian-nomigr xl $xenarch $dom0arch          \
-            guests_vcpus=4                                            \
-            $debian_runvars debian_pcipassthrough_nic=host            \
-            all_hostflags=$most_hostflags,hvm-$cpuvendor,pcipassthrough-nic
+  if [ $xenarch = amd64 -a $dom0arch = i386 ]; then
 
-    done
+  job_create_test test-$xenarch$kern-$dom0arch-xl-multivcpu \
+                    test-debian xl $xenarch $dom0arch guests_vcpus=4  \
+                    $debian_runvars all_hostflags=$most_hostflags
 
   fi
+
+  do_passthrough_tests
 }
 
 test_matrix_iterate
Signature · 1 line
1.8.5.2
#21 lore raw
In reply to Ian Campbell
Quoted 1 line · Ian Campbell

The following series refactors make-flight to move some of the useful

Perhaps I should have just done this instead of the massive patch spam:

The following changes since commit c12c2ef4fb9de6bef51f52916b398b3e6b6c5382:

ts-kernel-build: override kernel config from runvars (2014-01-10 16:48:59 +0000)

are available in the git repository at:

git://xenbits.xen.org/people/ianc/osstest.git make-flight-refactor

for you to fetch changes up to dcf4332148275d332ad94181a5983023029b5556:

make-flight: refactor test_matrix_do_one (2014-01-22 09:55:50 +0000)

----------------------------------------------------------------
Ian Campbell (17):
make-flight: expand hard tabs
make-flight: refactor common function "stripy" into helper library
make-flight: Drop obsolete/unused xenrt_images variable.
make-flight: refactor build job creation into mfi-common
Remove support for building the XCP kernel
mfi-common: Allow caller of create_build_jobs to include/exclude xend builds
mfi-common: restrict scope of local vars in create_build_jobs
mfi-common: fixup
make-flight: Remove md5sum based job filtering
make-flight: refactor job_create_test filters
make-flight: refactor job_create_test into mfi-common
make-flight: refactor test case filter over $branch
make-flight: Separate matrix iteration from test job creation
make-flight: reduce indentation in test_matrix_do_one
make-flight: Refactor test matrix iteration into mfi-common
mfi-common: onetoolstack does not vary for a given $xenbranch
make-flight: refactor test_matrix_do_one

 cr-daily-branch   |   1 -
 cr-external-linux |   1 -
 make-flight       | 635 ++++++++++++++++--------------------------------------
 mfi-common        | 326 ++++++++++++++++++++++++++++
 4 files changed, 516 insertions(+), 447 deletions(-)
 create mode 100644 mfi-common
#22 lore raw

Ian Campbell writes ("Re: [Xen-devel] [PATCH OSSTEST 00/17] refactor and clean up make-flight"):

Quoted 4 lines · Ian Campbell
Quoted 1 line

The following series refactors make-flight to move some of the useful

Perhaps I should have just done this instead of the massive patch spam:

Thanks.

Well, I've read some of the meat and all of the commit messages and it looks reasonable. I suggest you push it after I've had that other go at the switch wheezy.

Ian.

#23 lore raw
Quoted 11 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH OSSTEST 00/17] refactor and clean up make-flight"):

Quoted 4 lines · Ian Campbell
Quoted 1 line

The following series refactors make-flight to move some of the useful

Perhaps I should have just done this instead of the massive patch spam:

Thanks.

Well, I've read some of the meat and all of the commit messages and it looks reasonable. I suggest you push it after I've had that other go at the switch wheezy.

OK. I'll keep an eye out for the results of that.

Thanks.

Ian.