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
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [PATCH OSSTEST v2 4/5] Osstest::Executive: Export get_plan
Date: Tue, 14 Jul 2015 14:58:51 +0100	[thread overview]
Message-ID: <1436882332-6978-4-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1436882318.25044.75.camel@citrix.com>

To retrieve the current plan from the queue daemon.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Osstest/Executive.pm | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index ecd38c3..f29f778 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -48,7 +48,7 @@ BEGIN {
                       findtask @all_lock_tables
                       report_run_getinfo report_altcolour
                       report_blessingscond report_find_push_age_info
-                      tcpconnect_queuedaemon plan_search
+                      tcpconnect_queuedaemon get_plan plan_search
                       alloc_resources alloc_resources_rollback_begin_work
                       resource_check_allocated resource_shared_mark_ready
                       duration_estimator
@@ -477,6 +477,18 @@ sub tcpconnect_queuedaemon () {
     return $qserv;
 }
 
+sub get_plan ($) {
+    my ($qserv) = @_;
+
+    print $qserv "get-plan\n" or die $!;
+    $_= <$qserv>; defined && m/^OK get-plan (\d+)\s/ or die "$_ ?";
+
+    my $jplanlen= $1;
+    my $jplan;
+    read($qserv, $jplan, $jplanlen) == $jplanlen or die $!;
+    return $jplan;
+}
+
 sub plan_search ($$$$) {
     my ($plan, $dbgprint, $duration, $requestlist) = @_;
     #
@@ -674,12 +686,7 @@ sub alloc_resources {
 
 	    db_retry($flight,'running', $dbh_tests, \@all_lock_tables,
 		     [ sub {
-		print $qserv "get-plan\n" or die $!;
-		$_= <$qserv>; defined && m/^OK get-plan (\d+)\s/ or die "$_ ?";
-
-		my $jplanlen= $1;
-		my $jplan;
-		read($qserv, $jplan, $jplanlen) == $jplanlen or die $!;
+		my $jplan = get_plan($qserv);
 		my $jplanprint= $jplan;
 		chomp $jplanprint;
 		logm("resource allocation: obtained base plan.");
-- 
2.1.4

  parent reply	other threads:[~2015-07-14 13:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 13:58 [PATCH OSSTEST v2 0/5] add a flight summary html report Ian Campbell
2015-07-14 13:58 ` [PATCH OSSTEST v2 1/5] ms-planner: Propagate a booking's Job to the plan Ian Campbell
2015-07-31 15:39   ` Ian Jackson
2015-07-14 13:58 ` [PATCH OSSTEST v2 2/5] ms-planner: Expose the plan start in json Ian Campbell
2015-07-31 15:38   ` Ian Jackson
2015-07-14 13:58 ` [PATCH OSSTEST v2 3/5] ts-hosts-allocate-Executive: Add the requesting Job to the booking Ian Campbell
2015-07-31 15:41   ` Ian Jackson
2015-07-14 13:58 ` Ian Campbell [this message]
2015-07-31 15:42   ` [PATCH OSSTEST v2 4/5] Osstest::Executive: Export get_plan Ian Jackson
2015-07-14 13:58 ` [PATCH OSSTEST v2 5/5] ms-flights-summary: Produce an HTML report of all active flights Ian Campbell
2015-07-16 16:55   ` Ian Campbell
2015-07-31 15:50   ` Ian Jackson
2015-07-31 15:58     ` Ian Campbell
2015-07-31 16:04       ` 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=1436882332-6978-4-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).