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

[Xen-devel] [PATCH OSSTEST 2/6] TestSupport: allow multiple host serial methods



---
 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


_______________________________________________
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®.