]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
TestSupport: allow multiple host serial methods
authorIan Campbell <ian.campbell@citrix.com>
Wed, 9 Oct 2013 09:03:41 +0000 (10:03 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 11 Oct 2013 15:40:03 +0000 (16:40 +0100)
Osstest/TestSupport.pm
ts-logs-capture

index e5343c85cfe51d047db1c88f56a8968ba39a7c8f..75fb7cc179dbaefb8816d3103b8f6eaf63438eb8 100644 (file)
@@ -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}) {
index 9a71db0151cc44910d3df02f605a9abf4c77ff25..2dd95ea81745277e8994c6c1288bb5806420f76a 100755 (executable)
@@ -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");