[Xen-devel,OSSTEST,11/17] make-flight: refactor job_create_test into mfi-common

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

Commit Message

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

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 make-flight | 28 ----------------------------
 mfi-common  | 28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 28 deletions(-)

Patch

diff --git a/make-flight b/make-flight
index 34c1ce4..8862be5 100755
--- a/make-flight
+++ b/make-flight
@@ -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
diff --git a/mfi-common b/mfi-common
index e7cae0a..373110b 100644
--- a/mfi-common
+++ b/mfi-common
@@ -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