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 2/6] TestSupport: allow multiple host serial methods
Date: Fri, 11 Oct 2013 16:54:19 +0100	[thread overview]
Message-ID: <1381506863-1888-2-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1381506785.24708.66.camel@kazak.uk.xensource.com>

---
 Osstest/TestSupport.pm |   25 ++++++++++++++++++++++---
 ts-logs-capture        |    2 +-
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index e5343c8..75fb7cc 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -63,6 +63,7 @@ BEGIN {
 
                       selecthost get_hostflags get_host_property
                       power_state power_cycle power_cycle_time
+                      serial_fetch_logs
                       propname_massage
          
                       get_stashed open_unique_stashfile
@@ -620,6 +621,26 @@ sub guest_check_ip ($) {
     $gho->{DhcpWatch}->check_ip($gho);
 }
 
+#-------------- serial -------------
+
+sub serial_host_setup ($) {
+    my ($ho) = @_;
+    my $methobjs = [ ];
+    my $serialmeth = get_host_property($ho,'serial','noop');
+    foreach my $meth (split /\;\s*/, $serialmeth) {
+	push @$methobjs, get_host_method_object($ho,'Serial',$meth);
+    }
+    $ho->{SerialMethobjs} = $methobjs;
+}
+
+sub serial_fetch_logs ($) {
+    my ($ho) = @_;
+    logm("serial: collecting logs for $ho->{Name}");
+    foreach my $mo (@{ $ho->{SerialMethobjs} }) {
+	$mo->fetch_logs();
+    }
+}
+
 #---------- power cycling ----------
 
 sub power_cycle_host_setup ($) {
@@ -721,9 +742,7 @@ sub selecthost ($) {
 
     dhcp_watch_setup($ho,$ho);
     power_cycle_host_setup($ho);
-
-    my $serialmeth = get_host_property($ho,'serial','noop');
-    $ho->{SerialMethobj} = get_host_method_object($ho,'Serial',$serialmeth);
+    serial_host_setup($ho);
 
     $ho->{IpStatic} = get_host_property($ho,'ip-addr');
     if (!defined $ho->{IpStatic}) {
diff --git a/ts-logs-capture b/ts-logs-capture
index 9a71db0..2dd95ea 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -211,6 +211,6 @@ sub fetch_logs_guest ($) {
     }
 }
 
-$ho->{SerialMethobj}->fetch_logs();
+serial_fetch_logs($ho);
 fetch_logs_host_guests();
 logm("logs captured to $stash");
-- 
1.7.10.4

  parent reply	other threads:[~2013-10-11 15:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 15:53 [PATCH OSSTEST 0/6] Support for serial logs from marilith boxes Ian Campbell
2013-10-11 15:54 ` [PATCH OSSTEST 1/6] Standalone: Collect logs modified in the last hour Ian Campbell
2013-10-11 15:54 ` Ian Campbell [this message]
2013-10-11 15:54 ` [PATCH OSSTEST 3/6] Serial: Refactor debug key sending into separate request_debug function Ian Campbell
2013-10-11 15:54 ` [PATCH OSSTEST 4/6] Serial: collect serial logs from an http server Ian Campbell
2013-10-11 15:54 ` [PATCH OSSTEST 5/6] Serial: new module to send debug keys via xenuse Ian Campbell
2013-10-11 15:54 ` [PATCH OSSTEST 6/6] Serial/http: use mkdtemp instead of File::Temp->newdir Ian Campbell
2013-10-11 17:22 ` [PATCH OSSTEST 0/6] Support for serial logs from marilith boxes Ian Jackson
2013-10-13  9:19   ` Ian Campbell
2013-10-13  9:51     ` 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=1381506863-1888-2-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).