[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v3 6/6] sg-run-job: check for prerequisite builds when running build jobs



For example build-$ARCH-libvirt depends on build-$ARCH for the Xen bits.
Performing this check early saves allocating, installing, preparating etc a
host just to find the prerequisite is missing.

Rename ts-xen-build-check to ts-build-check while we are there. The script
checks all prerequisite builds, not just Xen.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 sg-run-job         |  6 ++++--
 ts-build-check     | 37 +++++++++++++++++++++++++++++++++++++
 ts-xen-build-check | 37 -------------------------------------
 3 files changed, 41 insertions(+), 39 deletions(-)
 create mode 100755 ts-build-check
 delete mode 100755 ts-xen-build-check

diff --git a/sg-run-job b/sg-run-job
index 560fead..13f2c70 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -87,7 +87,7 @@ proc catching-otherwise {failst script} {
 }
 
 proc check-not-blocked {} {
-    run-ts blocked * ts-xen-build-check
+    run-ts blocked * ts-build-check
 }
 
 proc setstatus {st} {
@@ -327,7 +327,9 @@ proc run-job/build-libvirt {} {
 }
 
 proc prepare-build-host {} {
-    global jobinfo
+    global jobinfo ok
+    catching-otherwise blocked check-not-blocked
+    if {!$ok} return
     run-ts broken = ts-hosts-allocate + host
     run-ts broken host-install(*) ts-host-install-twice
     run-ts . host-build-prep ts-xen-build-prep
diff --git a/ts-build-check b/ts-build-check
new file mode 100755
index 0000000..0ae3be8
--- /dev/null
+++ b/ts-build-check
@@ -0,0 +1,37 @@
+#!/usr/bin/perl -w
+# 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/>.
+
+use Osstest;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+die if @ARGV && $ARGV[0] =~ m/^-/;
+
+logm("checking builds ...");
+
+foreach my $k (sort keys %r) {
+    next unless $k =~ m/^(?:.*_)?([^_]*)buildjob$/;
+    my $part= $1;
+    my $path= "path_${part}dist";
+    logm("checking $k $path");
+    get_stashed($path, $r{$k});
+}
+
+logm("all ok.");
+
+exit 0;
diff --git a/ts-xen-build-check b/ts-xen-build-check
deleted file mode 100755
index 0ae3be8..0000000
--- a/ts-xen-build-check
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/perl -w
-# 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/>.
-
-use Osstest;
-use Osstest::TestSupport;
-
-tsreadconfig();
-
-die if @ARGV && $ARGV[0] =~ m/^-/;
-
-logm("checking builds ...");
-
-foreach my $k (sort keys %r) {
-    next unless $k =~ m/^(?:.*_)?([^_]*)buildjob$/;
-    my $part= $1;
-    my $path= "path_${part}dist";
-    logm("checking $k $path");
-    get_stashed($path, $r{$k});
-}
-
-logm("all ok.");
-
-exit 0;
-- 
1.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.