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 v2 1/4] ts-hosts-allocate-Executive: Allow dry-run
Date: Wed, 16 Sep 2015 12:47:41 +0100 [thread overview]
Message-ID: <1442404064-16192-1-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1442404047.18856.51.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>
Acked-by: Ian Jackson <ian.jackson@eu.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
next prev parent reply other threads:[~2015-09-16 11:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 11:47 [PATCH OSSTEST v2 0/4] Avoid running Linux on hosts for the given version lacks drivers Ian Campbell
2015-09-16 11:47 ` Ian Campbell [this message]
2015-09-16 11:47 ` [PATCH OSSTEST v2 2/4] ts-hosts-allocate-Executive: add a label to loop over candidates Ian Campbell
2015-09-16 11:47 ` [PATCH OSSTEST v2 3/4] Add support for selecting resources based on their properties Ian Campbell
2015-09-16 13:50 ` Ian Jackson
2015-09-16 13:58 ` Ian Campbell
2015-09-16 14:00 ` Ian Jackson
2015-09-16 14:07 ` Ian Campbell
2015-09-16 11:47 ` [PATCH OSSTEST v2 4/4] make-flight: Add a minimum linux version requirement to all linux-* branches Ian Campbell
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=1442404064-16192-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).