[Xen-devel,OSSTEST,14/17] make-flight: reduce indentation in test_matrix_do_one

Message ID 1390384501-20552-14-git-send-email-ian.campbell@citrix.com
State New
Headers show

Commit Message

Ian Campbell Jan. 22, 2014, 9:54 a.m.
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.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 make-flight | 198 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 99 insertions(+), 99 deletions(-)

Patch

diff --git a/make-flight b/make-flight
index 97421f2..177523b 100755
--- a/make-flight
+++ b/make-flight
@@ -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