Skip to contentSkip to conversation

Un-pushed support patches for new colo

PATCH In review Ian Jackson 2 participants 8 messages Mar 31, 2015

lore
Share & tools
lore
#0 lore raw

cover Un-pushed support patches for new colo

These 6 patches were developed as part of deploying the new colo, and have been used ad-hoc by me in my own ~, but not yet sent into production.

They can also be found in:
xenbits.xen.org:/home/iwj/ext/osstest#colo.2015-03-31

Thanks,
Ian.

#1 lore raw

PATCH 1/6 config: turn off HostnameSortSwapWords by default

---
 Osstest.pm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Osstest.pm +1 -1
index 449f312..f619b10 100644
@@ -74,7 +74,7 @@ our %c = qw(
 
     DebianNonfreeFirmware firmware-bnx2
 
-    HostnameSortSwapWords 1
+    HostnameSortSwapWords 0
 );
 
 $c{$_}='' foreach qw(
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/6 cs-adjust-flight: Support negation of foo-specs

In reply to Ian Jackson
---
 cs-adjust-flight |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
cs-adjust-flight +5 -3
index 9bd8757..9e011c6 100755
@@ -93,10 +93,12 @@ sub for_things ($$$$$$$) {
     my $things_q = $things_q{$table} ||= $dbh_tests->prepare
         ("SELECT * FROM $table WHERE $basecond");
 
+    my $not = ($spec =~ s/^\!//) ? 'NOT' : '';
     my $re = spec_re($spec);
-    debug("FOR_THINGS $table.$keycol \`$spec' RE ",
+    debug("FOR_THINGS $table.$keycol $not \`$spec' RE ",
           (defined($re) ? "/$re/" : "<undef>"), "\n");
     if (!defined $re) {
+	die "cannot negate <foo-name>" if $not;
         $thing_q->execute(@$basecondvals, $spec);
         my $row = $thing_q->fetchrow_hashref();
         if ($row) {
@@ -112,8 +114,8 @@ sub for_things ($$$$$$$) {
         $things_q->execute(@$basecondvals);
         while (my $row = $things_q->fetchrow_hashref()) {
             my $thing = $row->{$keycol};
-            next unless $thing =~ m/$re/;
-            debug("FOR_THINGS $table.$keycol \`$spec' FOUND $row->{$keycol}\n");
+            next unless $thing =~ m/$re/ xor $not;
+            debug("FOR_THINGS $table.$keycol $not \`$spec' FOUND $row->{$keycol}\n");
             $fn->($thing, $row);
         }
     }
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/6 sg-report-flight: Sort email output by results, not job name

In reply to Ian Jackson
---
 sg-report-flight |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
sg-report-flight +9 -4
index d2aff58..2adc8a8 100755
@@ -541,16 +541,21 @@ END
 
         my $text= (sprintf" %-${jl}s %2s %-${sl}s %-${rl}s ",
                    $j->{job}, $s->{stepno}, $s->{testid}, $s->{status});
-        $text .= "in $failv->{Flight} " if $heisenflightp;
-        $text .= $failv->{Summary} if defined $failv->{Summary};
+	my $xstatus = '';
+        $xstatus .= "in $failv->{Flight} " if $heisenflightp;
+        $xstatus .= $failv->{Summary} if defined $failv->{Summary};
+	$text .= $xstatus;
         $text =~ s/ *$//;
         while (length($text) > $cw) { last unless $text =~ s/(.* ) /$1/; }
 
-        $notsucceeds{$cat} .= $text."\n";
+	push @{ $notsucceeds{$cat} }, [ "$s->{status} $xstatus", $text ];
     }
     foreach my $cat (sort keys %notsucceeds) {
         $cat =~ m/^\w+ / or die;
-        print "\n$'\n$notsucceeds{$cat}" or die $!;
+        print "\n$'\n" or die $!;
+	foreach (sort { $a->[0] cmp $b->[0] } @{ $notsucceeds{$cat} }) {
+	    print $_->[1], "\n" or die $!;
+	}
     }
 
     if (!%{ $r->{Failures} }) {
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 4/6 sg-report-flight: Produce better output for running jobs.

In reply to Ian Jackson
---
 sg-report-flight |    8 ++++++++
 1 file changed, 8 insertions(+)
sg-report-flight +8 -0
index 2adc8a8..18a5afa 100755
@@ -664,6 +664,14 @@ END
 	    print MRO "broken-step $s->{job} $s->{testid}\n";
 	}
 
+	if ($st eq 'running') {
+	    print MRO "running $j->{job} $s->{testid}\n";
+	    print DEBUG " running, unjustifiable\n";
+	    $failv->{Summary}= '';
+	    $failv->{Blocker}= 'unfinished';
+	    next;
+	}
+
         if (!($st eq 'fail' or $st eq 'broken')) {
             print MRO "broken $j->{job} $s->{testid} $st\n";
             print DEBUG " not a fail, unjustifiable\n";
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 5/6 ts-host-ping-check: New ubiquitous test step

In reply to Ian Jackson

Check that packet loss is within acceptable levels.

---
 sg-run-job         |    2 ++
 ts-host-ping-check |   39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100755 ts-host-ping-check
sg-run-job +2 -0
index a1ff24b..3bdb5aa 100755
@@ -51,8 +51,10 @@ proc run-job {job} {
     if {$ok} { setstatus running                                          }
 
     per-host-ts broken  host-install/@(*) ts-host-install-twice
+    per-host-ts .       host-ping-check-native/@ ts-host-ping-check
     per-host-ts .       xen-install/@     ts-xen-install
     per-host-ts .       xen-boot/@        ts-host-reboot
+    per-host-ts .       host-ping-check-xen/@ ts-host-ping-check
 
     per-host-ts .       =(*)             {ts-leak-check basis}
 
ts-host-ping-check new file +39 -0
new file mode 100755
index 0000000..74c008c
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use Osstest;
+use DBI;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+
+$_ = `ping -D -i 0.2 -c 100 $ho->{Ip} | tee /dev/stderr`;
+
+m/\b([0-9.]+)% packet loss\b/ or die "$_ ?";
+
+my $loss= $1;
+
+logm("packet loss $loss\%");
+
+die if $loss > 1;
+
+logm("ok.");
Signature · 1 line
1.7.10.4
#6 lore raw

PATCH 6/6 ts-host-install: honour arch-specific boot append properties

In reply to Ian Jackson
---
 ts-host-install |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
ts-host-install +4 -2
index 9656079..a8543a4 100755
@@ -235,7 +235,8 @@ END
                            "domain=$c{TestHostDomain}",
                            );
     push @installcmdline,
-        get_host_property($ho, "install-append $ho->{Suite}", '');
+        get_host_property($ho, "install-append $ho->{Suite}", ''),
+        get_host_property($ho, "install-append $ho->{Suite} $r{arch}", '');
 
     my $console = get_host_native_linux_console($ho);
 
@@ -248,7 +249,8 @@ END
     push @installcmdline, "console=$console" unless $console eq "NONE";
 
     push @installcmdline,
-        get_host_property($ho, "linux-boot-append $ho->{Suite}", '');
+        get_host_property($ho, "linux-boot-append $ho->{Suite}", ''),
+        get_host_property($ho, "linux-boot-append $ho->{Suite} $r{arch}", '');
 
     my $installcmdline= join ' ', @installcmdline;
 
Signature · 1 line
1.7.10.4
#7 lore raw
In reply to Ian Jackson
Quoted 3 lines · Ian Jackson

These 6 patches were developed as part of deploying the new colo, and have been used ad-hoc by me in my own ~, but not yet sent into production.

Since I was preparing a push to pretest (of the stuff which was already in Cambridge pretest and never made it through before the switch) you asked me to include these too, which I have done.

So I have just pushed to the new colo's pretest:

$ git log --oneline dce7456..5ae027f
5ae027f Merge branch 'colo.2015-03-31' of xenbits.xen.org:/home/iwj/ext/osstest into queue
4bf33f8 production-config*: Set HostnameSortSwapWords as appropriate
e2008dc (Re)Add production config for Cambridge instance
f89d6ac Osstest.pm: Add "use IO::File"
0ab790c ts-host-install: honour arch-specific boot append properties
e654ecc ts-host-ping-check: New ubiquitous test step
a80d215 sg-report-flight: Produce better output for running jobs.
6ec412e sg-report-flight: Sort email output by results, not job name
6cbaf65 cs-adjust-flight: Support negation of foo-specs
fdddba7 config: turn off HostnameSortSwapWords by default
ea335bc start/stop the guest 10 times in the standard test jobs
4d6bbe0 README.dev: Document steps after restarting ms-ownerdaemon
97fa466 uboot: make flask loading address host property
ab441f3 uboot: do not use readlink on xsm policy

Note that I have omitted "standalone: Add --dry-run option for run-job." for now while I sort out the feedback from "sg-run-job: Only consider $OSSTEST_SIMULATE > 0"

Quoted 5 lines

They can also be found in:
xenbits.xen.org:/home/iwj/ext/osstest#colo.2015-03-31

Thanks,
Ian.