xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH OSSTEST 1/4] ts-hosts-allocate-Executive: Allow dry-run
Date: Tue, 15 Sep 2015 17:05:15 +0100	[thread overview]
Message-ID: <1442333118-843-1-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1442333100.18856.16.camel@citrix.com>

Provide a new -n command line option which causes no allocations to be
done, for debugging.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 ts-hosts-allocate-Executive | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index 781ddaf..c9aae88 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -30,6 +30,7 @@ tsreadconfig();
 open DEBUG, ">/dev/null" or die $!;
 
 our $compressdebug=1;
+our $fake; # never allocate
 
 while (@ARGV and $ARGV[0] =~ m/^-/) {
     $_= shift @ARGV;
@@ -37,6 +38,8 @@ while (@ARGV and $ARGV[0] =~ m/^-/) {
     while (m/^-./) {
         if (s/^-U/-/) {
 	    $compressdebug=0;
+	} elsif (s/^-n/-/) {
+	    $fake=1;
         } else {
             die "$_ ?";
         }
@@ -610,6 +613,8 @@ sub attempt_allocation {
     ($plan, $mayalloc) = @_;
     undef $best;
 
+    $mayalloc = undef if $fake;
+
     logm("allocating hosts: ".join(' ', map { $_->{Ident} } @hids));
 
     prepare_statements();
@@ -654,6 +659,11 @@ sub attempt_allocation {
 	logm("host allocation: planned start in $best->{Start} seconds.");
     }
 
+    if ($fake) {
+	logm("Fake allocation, returning error");
+	$retval = -1;
+    }
+
     my $booklist= compute_booking_list();
 
     return ($retval, $booklist);
-- 
2.5.1

  reply	other threads:[~2015-09-15 16:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 16:05 [PATCH OSSTEST 0/4] Avoid running Linux on hosts for the given version lacks drivers Ian Campbell
2015-09-15 16:05 ` Ian Campbell [this message]
2015-09-15 17:04   ` [PATCH OSSTEST 1/4] ts-hosts-allocate-Executive: Allow dry-run Ian Jackson
2015-09-15 16:05 ` [PATCH OSSTEST 2/4] ts-hosts-allocate-Executive: add a label to loop over candidates Ian Campbell
2015-09-15 17:04   ` Ian Jackson
2015-09-16  8:51     ` Ian Campbell
2015-09-15 16:05 ` [PATCH OSSTEST 3/4] Add support for selecting resources based on their properties Ian Campbell
2015-09-15 17:18   ` Ian Jackson
2015-09-16  8:57     ` Ian Campbell
2015-09-15 16:05 ` [PATCH OSSTEST 4/4] make-flight: Add a minimum linux version requirement to all linux-* branches Ian Campbell
2015-09-15 17:19   ` Ian Jackson
2015-09-15 17:21 ` [PATCH OSSTEST 0/4] Avoid running Linux on hosts for the given version lacks drivers Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442333118-843-1-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).