diff mbox

[Xen-devel,OSSTEST,10/17] make-flight: refactor job_create_test filters

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

Commit Message

Ian Campbell Jan. 22, 2014, 9:54 a.m. UTC
This will allow job_create_test to be moved mfi-common.

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

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 make-flight | 50 +++++++++++++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 19 deletions(-)
diff mbox

Patch

diff --git a/make-flight b/make-flight
index 7085dc2..34c1ce4 100755
--- a/make-flight
+++ b/make-flight
@@ -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 "$@"