* [OSSTEST PATCH 02/24] sg-report-flight: Do not report <none executed> unless it's true
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 03/24] cs-flight-create: Fix usage error message Ian Jackson
` (22 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
This fallback $storefail->() call is normally run because the job
failed without running any steps. But it can also happen because the
job execution itself failed (eg, sg-run-job crashed).
If there were any steps, replace the <none executed> text with
<job status>. This is accurate, if rather uninformative.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
sg-report-flight | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sg-report-flight b/sg-report-flight
index 5e362b9..b7cd03a 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -454,8 +454,11 @@ END
};
my $gridrow= 0;
+ my $foundsteps= 0;
while (my $s= $stepsq->fetchrow_hashref()) {
+ $foundsteps++;
+
$jobtext .= sprintf "%2d %-${sl}s %-${rl}s\n",
$s->{stepno}, $s->{testid}, $s->{status};
@@ -493,7 +496,7 @@ END
$storefail->({
stepno => '',
status => "$j->{status}",
- testid => '<none executed>'
+ testid => $foundsteps ? '<job status>' : '<none executed>'
});
}
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 03/24] cs-flight-create: Fix usage error message
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 02/24] sg-report-flight: Do not report <none executed> unless it's true Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-23 13:58 ` Roger Pau Monné
2017-05-18 11:01 ` [OSSTEST PATCH 04/24] ts-hosts-allocate-Executive: tolerate lack of hostflags Ian Jackson
` (21 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
This spuriously prints $!. It's still a poor message.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
cs-flight-create | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cs-flight-create b/cs-flight-create
index a412396..dc61e62 100755
--- a/cs-flight-create
+++ b/cs-flight-create
@@ -24,7 +24,7 @@ use Osstest;
csreadconfig();
-@ARGV==2 or die $!;
+@ARGV==2 or die;
our ($intended,$branch) = @ARGV;
my ($flight) =
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OSSTEST PATCH 03/24] cs-flight-create: Fix usage error message
2017-05-18 11:01 ` [OSSTEST PATCH 03/24] cs-flight-create: Fix usage error message Ian Jackson
@ 2017-05-23 13:58 ` Roger Pau Monné
0 siblings, 0 replies; 33+ messages in thread
From: Roger Pau Monné @ 2017-05-23 13:58 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, May 18, 2017 at 12:01:13PM +0100, Ian Jackson wrote:
> This spuriously prints $!. It's still a poor message.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
> cs-flight-create | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cs-flight-create b/cs-flight-create
> index a412396..dc61e62 100755
> --- a/cs-flight-create
> +++ b/cs-flight-create
> @@ -24,7 +24,7 @@ use Osstest;
>
> csreadconfig();
>
> -@ARGV==2 or die $!;
> +@ARGV==2 or die;
Maybe a "Invalid number of arguments provided, expected 2"?
In any case:
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread
* [OSSTEST PATCH 04/24] ts-hosts-allocate-Executive: tolerate lack of hostflags
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 02/24] sg-report-flight: Do not report <none executed> unless it's true Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 03/24] cs-flight-create: Fix usage error message Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""' Ian Jackson
` (20 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Jobs generated by make-hosts-flight do not need to (and therefore do
not) set any hostflags: they set a `host' runvar instead, for the
specific host. Do not pointlessly bomb out in this situation.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
ts-hosts-allocate-Executive | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index 9417226..0987e2b 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -232,7 +232,8 @@ sub compute_hids () {
print DEBUG "HID $ident OVERRIDE $hid->{OverrideUse}\n";
}
my @flags= get_hostflags($ident);
- die "no hostflags?!" unless @flags;
+ die "no hostflags?!" unless @flags or
+ $hid->{OverrideUse} or $r{$ident};
print DEBUG "HID $ident FLAGS @flags\n";
$hid->{Ident}= $ident;
my %flags;
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""'
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (2 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 04/24] ts-hosts-allocate-Executive: tolerate lack of hostflags Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-23 13:16 ` Roger Pau Monné
2017-05-18 11:01 ` [OSSTEST PATCH 06/24] cs-hosts-list: New utility Ian Jackson
` (19 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Jackson
This runs an interactive shell session on the host, rathern than
running `sh -c ""' on it.
Evidently ssh checks for the presence of a command line specification
after (foolishly, but now historically unavoidably) concatenating all
the command line arguments with spaces in between.
Turn ssh host "" into ssh host " " which is the expected no-op.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
---
Osstest/TestSupport.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 19bdd23..b947a0c 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -676,6 +676,7 @@ sub tcmd { # $tcmd will be put between '' but not escaped
my ($stdin,$stdout,$user,$ho,$tcmd,$timeout,$extrasshopts) = @_;
$timeout=30 if !defined $timeout;
target_adjust_timeout($ho,\$timeout);
+ $tcmd = ' ' if $tcmd eq ''; # ssh host '' logs in !
tcmdex($timeout,$stdin,$stdout,
'ssh', sshopts(), @{ $extrasshopts || [] },
sshuho($user,$ho), $tcmd);
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""'
2017-05-18 11:01 ` [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""' Ian Jackson
@ 2017-05-23 13:16 ` Roger Pau Monné
2017-05-23 13:53 ` Ian Jackson
0 siblings, 1 reply; 33+ messages in thread
From: Roger Pau Monné @ 2017-05-23 13:16 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel, Ian Jackson
On Thu, May 18, 2017 at 12:01:15PM +0100, Ian Jackson wrote:
> This runs an interactive shell session on the host, rathern than
> running `sh -c ""' on it.
>
> Evidently ssh checks for the presence of a command line specification
> after (foolishly, but now historically unavoidably) concatenating all
> the command line arguments with spaces in between.
>
> Turn ssh host "" into ssh host " " which is the expected no-op.
>
> Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
SoB doesn't match "From:", apart from that:
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""'
2017-05-23 13:16 ` Roger Pau Monné
@ 2017-05-23 13:53 ` Ian Jackson
0 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-23 13:53 UTC (permalink / raw)
To: Roger Pau Monné; +Cc: xen-devel
Roger Pau Monné writes ("Re: [Xen-devel] [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""'"):
> On Thu, May 18, 2017 at 12:01:15PM +0100, Ian Jackson wrote:
> > This runs an interactive shell session on the host, rathern than
> > running `sh -c ""' on it.
> >
> > Evidently ssh checks for the presence of a command line specification
> > after (foolishly, but now historically unavoidably) concatenating all
> > the command line arguments with spaces in between.
> >
> > Turn ssh host "" into ssh host " " which is the expected no-op.
> >
> > Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
>
> SoB doesn't match "From:", apart from that:
>
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks for the reviews. Sadly I already pushed this with the wrong
From:. I'm not sure exactly how that snuck in. I probably committed
that on my laptop but the tree has a user.email config...
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread
* [OSSTEST PATCH 06/24] cs-hosts-list: New utility
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (3 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 05/24] tcmd: Work around ssh bug with `ssh host ""' Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-23 13:23 ` Roger Pau Monné
2017-05-18 11:01 ` [OSSTEST PATCH 07/24] cs-hosts-list: Support --arches and --kernels Ian Jackson
` (18 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
No callers yet.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
cs-hosts-list | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
create mode 100755 cs-hosts-list
diff --git a/cs-hosts-list b/cs-hosts-list
new file mode 100755
index 0000000..1fea3cd
--- /dev/null
+++ b/cs-hosts-list
@@ -0,0 +1,64 @@
+#!/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/>.
+
+
+# usage:
+# ./cs-hosts-list HOSTFLAG[,...]
+# prints the names of all hosts which have all of the HOSTFLAGs set,
+# one per line
+
+use strict qw(vars);
+use DBI;
+unshift @INC, qw(.);
+use Osstest;
+
+csreadconfig();
+
+@ARGV == 1 or die $!;
+my ($flags) = @ARGV;
+$flags =~ m/^-/ and die $!;
+
+my @qargs;
+my $qtxt= <<END;
+ SELECT resname
+ FROM resources
+ WHERE restype='host'
+END
+foreach my $flag (grep { length} split /\,/, $flags) {
+ $qtxt.= <<END;
+ AND EXISTS (SELECT 1 FROM HOSTFLAGS f
+ WHERE resname=f.hostname
+ AND f.hostflag=?)
+END
+ push @qargs, $flag;
+}
+
+my $q= $dbh_tests->prepare($qtxt);
+my $o;
+
+db_retry($dbh_tests,[],sub {
+ $o='';
+ $q->execute(@qargs);
+ while (my ($host) = $q->fetchrow_array()) {
+ $o .= $host;
+ $o .= "\n";
+ }
+});
+
+print $o or die $!;
+close STDOUT or die $!;
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OSSTEST PATCH 06/24] cs-hosts-list: New utility
2017-05-18 11:01 ` [OSSTEST PATCH 06/24] cs-hosts-list: New utility Ian Jackson
@ 2017-05-23 13:23 ` Roger Pau Monné
2017-05-23 13:54 ` Ian Jackson
0 siblings, 1 reply; 33+ messages in thread
From: Roger Pau Monné @ 2017-05-23 13:23 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, May 18, 2017 at 12:01:16PM +0100, Ian Jackson wrote:
> No callers yet.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
> cs-hosts-list | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
> create mode 100755 cs-hosts-list
>
> diff --git a/cs-hosts-list b/cs-hosts-list
> new file mode 100755
> index 0000000..1fea3cd
> --- /dev/null
> +++ b/cs-hosts-list
> @@ -0,0 +1,64 @@
> +#!/usr/bin/perl -w
> +
> +# This is part of "osstest", an automated testing framework for Xen.
> +# Copyright (C) 2009-2013 Citrix Inc.
^ 2017?
> +# 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/>.
> +
> +
> +# usage:
> +# ./cs-hosts-list HOSTFLAG[,...]
> +# prints the names of all hosts which have all of the HOSTFLAGs set,
> +# one per line
> +
> +use strict qw(vars);
> +use DBI;
> +unshift @INC, qw(.);
> +use Osstest;
> +
> +csreadconfig();
> +
> +@ARGV == 1 or die $!;
> +my ($flags) = @ARGV;
> +$flags =~ m/^-/ and die $!;
> +
> +my @qargs;
> +my $qtxt= <<END;
> + SELECT resname
> + FROM resources
> + WHERE restype='host'
> +END
> +foreach my $flag (grep { length} split /\,/, $flags) {
> + $qtxt.= <<END;
> + AND EXISTS (SELECT 1 FROM HOSTFLAGS f
> + WHERE resname=f.hostname
> + AND f.hostflag=?)
There seems to be a mix between hard tabs and spaces above.
> +END
> + push @qargs, $flag;
> +}
> +
> +my $q= $dbh_tests->prepare($qtxt);
> +my $o;
> +
> +db_retry($dbh_tests,[],sub {
> + $o='';
> + $q->execute(@qargs);
> + while (my ($host) = $q->fetchrow_array()) {
> + $o .= $host;
> + $o .= "\n";
> + }
> +});
> +
> +print $o or die $!;
> +close STDOUT or die $!;
Don't know that much about osstest DB (or DB's in general), but I don't see
anything obviously wrong:
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OSSTEST PATCH 06/24] cs-hosts-list: New utility
2017-05-23 13:23 ` Roger Pau Monné
@ 2017-05-23 13:54 ` Ian Jackson
2017-05-23 14:12 ` Roger Pau Monné
0 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2017-05-23 13:54 UTC (permalink / raw)
To: Roger Pau Monné; +Cc: xen-devel
Roger Pau Monné writes ("Re: [Xen-devel] [OSSTEST PATCH 06/24] cs-hosts-list: New utility"):
> On Thu, May 18, 2017 at 12:01:16PM +0100, Ian Jackson wrote:
> > +foreach my $flag (grep { length} split /\,/, $flags) {
> > + $qtxt.= <<END;
> > + AND EXISTS (SELECT 1 FROM HOSTFLAGS f
> > + WHERE resname=f.hostname
> > + AND f.hostflag=?)
>
> There seems to be a mix between hard tabs and spaces above.
Indeed. Does that bother you ? osstest is full of that and it
doesn't bothere me...
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread* Re: [OSSTEST PATCH 06/24] cs-hosts-list: New utility
2017-05-23 13:54 ` Ian Jackson
@ 2017-05-23 14:12 ` Roger Pau Monné
0 siblings, 0 replies; 33+ messages in thread
From: Roger Pau Monné @ 2017-05-23 14:12 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Tue, May 23, 2017 at 02:54:16PM +0100, Ian Jackson wrote:
> Roger Pau Monné writes ("Re: [Xen-devel] [OSSTEST PATCH 06/24] cs-hosts-list: New utility"):
> > On Thu, May 18, 2017 at 12:01:16PM +0100, Ian Jackson wrote:
> > > +foreach my $flag (grep { length} split /\,/, $flags) {
> > > + $qtxt.= <<END;
> > > + AND EXISTS (SELECT 1 FROM HOSTFLAGS f
> > > + WHERE resname=f.hostname
> > > + AND f.hostflag=?)
> >
> > There seems to be a mix between hard tabs and spaces above.
>
> Indeed. Does that bother you ? osstest is full of that and it
> doesn't bothere me...
Not really, but for new scripts I've tried to keep a more uniform style,
although vim was very confused about whether it should use hard tabs or spaces
:).
Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread
* [OSSTEST PATCH 07/24] cs-hosts-list: Support --arches and --kernels
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (4 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 06/24] cs-hosts-list: New utility Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 08/24] cs-hosts-list: Support --suites Ian Jackson
` (17 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
cs-hosts-list | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/cs-hosts-list b/cs-hosts-list
index 1fea3cd..92f44ee 100755
--- a/cs-hosts-list
+++ b/cs-hosts-list
@@ -29,9 +29,25 @@ use Osstest;
csreadconfig();
+our @kernels = qw(xen linux);
+our @arches;
+
+while (@ARGV && $ARGV[0] =~ m/^-/) {
+ $_ = shift @ARGV;
+ last if m/^--$/;
+ while (m/^-./) {
+ if (s/^--arches=(.*)/-/) {
+ @arches = split /\,/, $1;
+ } elsif (s/^--kernels=(.*)/-/) {
+ @kernels = split /\,/, $1;
+ } else {
+ die "bad option $_ ?";
+ }
+ }
+}
+
@ARGV == 1 or die $!;
my ($flags) = @ARGV;
-$flags =~ m/^-/ and die $!;
my @qargs;
my $qtxt= <<END;
@@ -49,13 +65,36 @@ END
}
my $q= $dbh_tests->prepare($qtxt);
+
+my $flagq = $dbh_tests->prepare(<<END);
+ SELECT 1
+ FROM hostflags
+ WHERE hostname=? AND hostflag=?
+END
+
my $o;
+sub report_arch ($) {
+ my ($host) = @_;
+ foreach my $kernel (@kernels) {
+ my $kernprefix = $kernel eq 'linux' ? '' : "$kernel-";
+ foreach my $arch (@arches) {
+ $flagq->execute($host,"arch-$kernprefix$arch");
+ if ($flagq->fetchrow_arrayref()) {
+ $o .= " $kernel $arch";
+ return;
+ }
+ }
+ }
+ $o .= " NONE NONE";
+}
+
db_retry($dbh_tests,[],sub {
$o='';
$q->execute(@qargs);
while (my ($host) = $q->fetchrow_array()) {
$o .= $host;
+ report_arch($host) if @arches;
$o .= "\n";
}
});
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 08/24] cs-hosts-list: Support --suites
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (5 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 07/24] cs-hosts-list: Support --arches and --kernels Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-23 14:25 ` Roger Pau Monné
2017-05-18 11:01 ` [OSSTEST PATCH 09/24] cs-hosts-list, standalone-generate-dump-flight-runvars: make compatible Ian Jackson
` (16 subsequent siblings)
23 siblings, 1 reply; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
cs-hosts-list | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/cs-hosts-list b/cs-hosts-list
index 92f44ee..9b82d51 100755
--- a/cs-hosts-list
+++ b/cs-hosts-list
@@ -31,6 +31,7 @@ csreadconfig();
our @kernels = qw(xen linux);
our @arches;
+our @suites;
while (@ARGV && $ARGV[0] =~ m/^-/) {
$_ = shift @ARGV;
@@ -40,6 +41,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
@arches = split /\,/, $1;
} elsif (s/^--kernels=(.*)/-/) {
@kernels = split /\,/, $1;
+ } elsif (s/^--suites=(.*)/-/) {
+ @suites = split /\,/, $1;
} else {
die "bad option $_ ?";
}
@@ -89,12 +92,25 @@ sub report_arch ($) {
$o .= " NONE NONE";
}
+sub report_suite ($) {
+ my ($host) = @_;
+ foreach my $suite (@suites) {
+ $flagq->execute($host,"suite-$suite");
+ if ($flagq->fetchrow_arrayref()) {
+ $o .= " $suite";
+ return;
+ }
+ }
+ $o .= " NONE";
+}
+
db_retry($dbh_tests,[],sub {
$o='';
$q->execute(@qargs);
while (my ($host) = $q->fetchrow_array()) {
$o .= $host;
report_arch($host) if @arches;
+ report_suite($host) if @suites;
$o .= "\n";
}
});
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OSSTEST PATCH 08/24] cs-hosts-list: Support --suites
2017-05-18 11:01 ` [OSSTEST PATCH 08/24] cs-hosts-list: Support --suites Ian Jackson
@ 2017-05-23 14:25 ` Roger Pau Monné
2017-05-23 17:11 ` Ian Jackson
0 siblings, 1 reply; 33+ messages in thread
From: Roger Pau Monné @ 2017-05-23 14:25 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, May 18, 2017 at 12:01:18PM +0100, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
> cs-hosts-list | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/cs-hosts-list b/cs-hosts-list
> index 92f44ee..9b82d51 100755
> --- a/cs-hosts-list
> +++ b/cs-hosts-list
> @@ -31,6 +31,7 @@ csreadconfig();
>
> our @kernels = qw(xen linux);
> our @arches;
> +our @suites;
>
> while (@ARGV && $ARGV[0] =~ m/^-/) {
> $_ = shift @ARGV;
> @@ -40,6 +41,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
> @arches = split /\,/, $1;
> } elsif (s/^--kernels=(.*)/-/) {
> @kernels = split /\,/, $1;
> + } elsif (s/^--suites=(.*)/-/) {
> + @suites = split /\,/, $1;
I should add a --freebsd=... option.
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread
* [OSSTEST PATCH 09/24] cs-hosts-list, standalone-generate-dump-flight-runvars: make compatible
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (6 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 08/24] cs-hosts-list: Support --suites Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 10/24] sg-run-job: new run-ts iffail syntax - Ian Jackson
` (15 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Honour OSSTEST_HOSTSLIST_DUMMY, to cause cs-hosts-list to produce
dummy output. This means that standalone-generate-dump-flight-runvars
can now try generating flights whose contents depend on the host
database, and which are therefore normally only useable in Executive
mode.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
cs-hosts-list | 18 ++++++++++++++++--
standalone-generate-dump-flight-runvars | 1 +
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/cs-hosts-list b/cs-hosts-list
index 9b82d51..16b5219 100755
--- a/cs-hosts-list
+++ b/cs-hosts-list
@@ -52,6 +52,22 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
@ARGV == 1 or die $!;
my ($flags) = @ARGV;
+my $o;
+
+if ($ENV{'OSSTEST_HOSTSLIST_DUMMY'}) {
+ $o .= "SOMEHOST";
+ if (@arches) {
+ $o .= " $kernels[0]";
+ $o .= " {".join(',',@arches)."}";
+ }
+ if (@suites) {
+ $o .= " $suites[0]";
+ }
+ $o .= "\n";
+ print $o or die $!;
+ exit 0;
+}
+
my @qargs;
my $qtxt= <<END;
SELECT resname
@@ -75,8 +91,6 @@ my $flagq = $dbh_tests->prepare(<<END);
WHERE hostname=? AND hostflag=?
END
-my $o;
-
sub report_arch ($) {
my ($host) = @_;
foreach my $kernel (@kernels) {
diff --git a/standalone-generate-dump-flight-runvars b/standalone-generate-dump-flight-runvars
index 8fcc852..04631b3 100755
--- a/standalone-generate-dump-flight-runvars
+++ b/standalone-generate-dump-flight-runvars
@@ -41,6 +41,7 @@ fi
: ${AP_FETCH_PLACEHOLDERS:=y}
export AP_FETCH_PLACEHOLDERS
+export OSSTEST_HOSTSLIST_DUMMY=1
if [ "x$AP_FETCH_PLACEHOLDERS" != xy ]; then
if [ "x$AP_FETCH_MEMO_KEEP" = x ]; then
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 10/24] sg-run-job: new run-ts iffail syntax -...
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (7 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 09/24] cs-hosts-list, standalone-generate-dump-flight-runvars: make compatible Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 11/24] host examination: Initial skeleton Ian Jackson
` (14 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Indicates not to throw a Tcl exception if the step fails.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
sg-run-job | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/sg-run-job b/sg-run-job
index 8e625d9..4fd7505 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -146,9 +146,11 @@ proc testid_matches_globs {testid globs} {
#---------- test script handling ----------
-proc run-ts {args} {
- set reap [eval spawn-ts $args]
- if {![reap-ts $reap]} { error "test script failed" }
+proc run-ts {iffail args} {
+ set wantstatus pass
+ if {[regsub {^-} $iffail {} iffail]} { set wantstatus * }
+ set reap [eval [list spawn-ts $iffail] $args]
+ if {![reap-ts $reap $wantstatus]} { error "test script failed" }
}
proc repeat-ts {reps testid args} {
@@ -261,7 +263,7 @@ proc spawn-ts {iffail testid args} {
return [list fh $fh $details]
}
-proc reap-ts {reap} {
+proc reap-ts {reap {wantstatus pass}} {
global truncate truncate_globs
switch -exact [lindex $reap 0] {
@@ -288,7 +290,7 @@ proc reap-ts {reap} {
jobdb::logputs stdout "truncating job now as instructed"
set truncate 1
}
- return [expr {![string compare $result pass]}]
+ return [string match $wantstatus $result]
}
#---------- per-host infrastructure (non-build tests only) ----------
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 11/24] host examination: Initial skeleton
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (8 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 10/24] sg-run-job: new run-ts iffail syntax - Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 12/24] Debian.pm: Break out setupboot_bootloader_edited_rune Ian Jackson
` (13 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Introduce an initial cut of job recipies host-examine-linux and
host-examine-xen, and a flight generation script which can make a
flight to examine all hosts with a particular blessing.
So far all this does is provide a way to make a flight which:
* Allocates each relevant host
* Installs Debian and, if applicable, Xen
* Reboots (if applicable, into Xen)
* Collects the logs to the flight log directory
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
make-hosts-flight | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
sg-run-job | 30 +++++++++++++++
2 files changed, 143 insertions(+)
create mode 100755 make-hosts-flight
diff --git a/make-hosts-flight b/make-hosts-flight
new file mode 100755
index 0000000..bbd3343
--- /dev/null
+++ b/make-hosts-flight
@@ -0,0 +1,113 @@
+#!/bin/bash
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2017 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/>.
+
+
+set -e -o posix
+
+branch=$1
+xenbranch=$2
+hostflags=$3
+blessing=$4
+buildflight=$5
+
+: ${ALL_ARCHES:=amd64 i386 arm64 armhf}
+: ${ALL_SUITES:=jessie stretch}
+
+flight=`./cs-flight-create $blessing $branch`
+
+. ./cri-common
+. ./ap-common
+. ./mfi-common
+
+defsuite=`getconfig DebianSuite`
+
+job_create_build_filter_callback () {
+ local job=$1; shift
+
+ case "$job" in
+ build-*-libvirt) return 1;;
+ esac
+ case " $* " in
+ *" enable_xsm=true "*) return 1;;
+ esac
+ return 0
+}
+
+build_matrix_branch_filter_callback () {
+ :
+}
+
+hosts_iterate () {
+ ./cs-hosts-list --arches=${ALL_ARCHES// /,} \
+ --suites=${ALL_SUITES// /,} \
+ $hostflags >tmp/$flight.hosts-list
+ exec 3<tmp/$flight.hosts-list
+
+ while read <&3 host kern arch suite; do
+ runvars="
+ arch=$arch host=$host
+ "
+
+ case $kern in
+ xen|linux)
+ local di_version=`getconfig_TftpDiVersion_suite $suite`
+ runvars+="
+ kernkind=pvops
+ all_host_di_version=$di_version
+ all_host_suite=$suite
+ "
+ ;;
+ esac
+
+ case $kern in
+ xen)
+ runvars+="
+ enable_xsm=false
+ buildjob=${bfi}build-$arch
+ xenbuildjob=${bfi}build-$arch
+ kernbuildjob=${bfi}build-$arch-pvops
+ toolstack=xl
+ "
+ ;;
+ esac
+
+ ./cs-job-create $flight examine-$host host-examine-$kern $runvars
+ done
+}
+
+if [ x$buildflight = x ]; then
+
+ WANT_XEND=false REVISION_LINUX_OLD=disable
+
+ create_build_jobs
+
+else
+
+ bfi=$buildflight.
+
+fi
+
+hosts_iterate
+
+echo $flight
+
+# Local variables:
+# mode: sh
+# sh-basic-offset: 2
+# indent-tabs-mode: nil
+# End:
diff --git a/sg-run-job b/sg-run-job
index 4fd7505..51dc2ec 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -498,6 +498,36 @@ if {[file exists sg-run-job-adhoc]} {
source sg-run-job-adhoc
}
+#---------- host examination recipes ----------
+
+proc examine-host-install-debian {} {
+ run-ts broken = ts-hosts-allocate + host
+ run-ts broken host-install ts-host-install-twice + host
+}
+proc examine-host-install-xen {} {
+ examine-host-install-debian
+ run-ts . = ts-xen-install + host
+ # examine-hosts-examine will do reboot
+}
+
+proc examine-host-examine {install} {
+ catching-otherwise fail {
+ examine-host-install-$install
+ run-ts . reboot ts-host-reboot + host
+ }
+ run-ts !broken capture-logs ts-logs-capture + host
+}
+
+proc need-hosts/host-examine-xen {} { return {} }
+proc run-job/host-examine-xen {} {
+ examine-host-examine xen
+}
+
+proc need-hosts/host-examine-linux {} { return {} }
+proc need-hosts/host-examine-linux {} {
+ examine-host-examine debian
+}
+
#---------- builds ----------
proc need-hosts/build {} { return BUILD }
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 12/24] Debian.pm: Break out setupboot_bootloader_edited_rune
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (9 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 11/24] host examination: Initial skeleton Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 13/24] TestSupport, Executive: Provide intended_blessing Ian Jackson
` (12 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
The host examination scripts are going to want this.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
Osstest/Debian.pm | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 4155056..8ba48bf 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -34,6 +34,7 @@ BEGIN {
$VERSION = 1.00;
@ISA = qw(Exporter);
@EXPORT = qw(debian_boot_setup
+ setupboot_bootloader_edited_rune
debian_overlays
debian_guest_suite debian_guest_di_version
%preseed_cmds
@@ -165,6 +166,19 @@ fi
END
}
+sub setupboot_bootloader_edited_rune ($) {
+ my ($ho) = @_;
+ # returns script to run after actual bootloader file is edited
+ if ($ho->{Flags}{'need-uboot-bootscr'}) {
+ return <<END;
+mkimage -A arm -T script -d /boot/boot.xen /boot/boot.scr.xen
+cp /boot/boot.scr.xen /boot/boot.scr
+END
+ } else {
+ return '';
+ }
+}
+
sub setupboot_uboot ($$$$) {
my ($ho,$want_kernver,$want_xsm,$xenhopt,$xenkopt) = @_;
my $bl= { };
@@ -247,6 +261,8 @@ END
my $set_xen_addr_r =
$xen_addr_r ? "setenv xen_addr_r $xen_addr_r" : "";
+ my $edited_rune = setupboot_bootloader_edited_rune($ho);
+
target_cmd_root($ho, <<END);
if test ! -f /boot/$kern ; then
exit 1
@@ -297,8 +313,7 @@ fdt print /chosen
echo Booting \\\${xen_addr_r} - \\\${fdt_addr}
bootz \\\${xen_addr_r} - \\\${fdt_addr}
EOF
-mkimage -A arm -T script -d /boot/boot.xen /boot/boot.scr.xen
-cp /boot/boot.scr.xen /boot/boot.scr
+$edited_rune
# Create boot.scr.nat for convenience too
cat >/boot/boot.nat <<EOF
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 13/24] TestSupport, Executive: Provide intended_blessing
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (10 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 12/24] Debian.pm: Break out setupboot_bootloader_edited_rune Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 14/24] host examination: Check that serial output is working Ian Jackson
` (11 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
This will be used by a ts script which permanently saves some logs in
a host-specific rather than flight-specific directory. Non-real
flights ought not to mess up real data.
The function is not provided for Standalone mode, so a test step that
tries to use it will fail.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
Osstest/JobDB/Executive.pm | 8 ++++++++
Osstest/TestSupport.pm | 11 ++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 83e19e4..45aabd4 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -196,6 +196,14 @@ END
}
}
+sub dbfl_intended ($) { #method
+ my ($jd, $fl) = @_;
+ my ($intended) = $dbh_tests->selectrow_array(<<END, {}, $fl);
+ SELECT intended FROM flights WHERE flight=?
+END
+ return $intended;
+}
+
sub flight_create ($$$) { #method
my ($jd,$intended,$branch) = @_;
die "OSSTEST_FLIGHT set on entry to JobDB::Executive::flight_create\n"
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index b947a0c..c23ac13 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -43,7 +43,7 @@ BEGIN {
ts_get_host_guest ts_check_done
fail broken logm $logm_handle $logm_prefix
- substep_start substep_finish
+ substep_start substep_finish intended_blessing
get_filecontents
report_once
@@ -245,6 +245,15 @@ sub substep_finish ($$) {
$mjobdb->step_finish($testid,$stepstatus);
}
+sub intended_blessing () {
+ # must be run outside transaction
+ my $intended;
+ db_retry($flight,'running',$dbh_tests,[], sub {
+ $intended = $mjobdb->dbfl_intended($flight);
+ });
+ return $intended;
+}
+
sub get_filecontents ($;$) {
my ($path, $ifnoent) = @_; # $ifnoent=undef => is error
my $data= get_filecontents_core_quiet($path);
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 14/24] host examination: Check that serial output is working
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (11 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 13/24] TestSupport, Executive: Provide intended_blessing Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 15/24] host examination: Permanently save the logs Ian Jackson
` (10 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Check that both the output from the bootloader, and from the host
(dom0, if applicable), appears in the serial logs.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
sg-run-job | 5 +++
ts-examine-serial-post | 81 +++++++++++++++++++++++++++++++++++++++++
ts-examine-serial-pre | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 183 insertions(+)
create mode 100755 ts-examine-serial-post
create mode 100755 ts-examine-serial-pre
diff --git a/sg-run-job b/sg-run-job
index 51dc2ec..ceb7980 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -511,11 +511,16 @@ proc examine-host-install-xen {} {
}
proc examine-host-examine {install} {
+ global ok
catching-otherwise fail {
examine-host-install-$install
+ run-ts . = ts-examine-serial-pre + host
run-ts . reboot ts-host-reboot + host
}
run-ts !broken capture-logs ts-logs-capture + host
+ if {$ok} {
+ run-ts -. = ts-examine-serial-post + host
+ }
}
proc need-hosts/host-examine-xen {} { return {} }
diff --git a/ts-examine-serial-post b/ts-examine-serial-post
new file mode 100755
index 0000000..2d5c103
--- /dev/null
+++ b/ts-examine-serial-post
@@ -0,0 +1,81 @@
+#!/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/>.
+
+# usage
+# ./ts-examine-serial-pre [host]
+# creates some random cookies to be printed to the serial console
+# $r{examine_serial_cookie_kernel} printed once by this script
+# $r{examine_serial_cookie_bootloader} will be printed on later boots
+#
+# These are later used by ts-examine-serial-post
+
+use strict qw(vars);
+use DBI;
+unshift @INC, qw(.);
+use Osstest;
+use POSIX;
+use Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+
+our @cookies;
+
+sub cookies () {
+ foreach my $rv (sort keys %r) {
+ next unless $rv =~ /^examine_serial_cookie_(\w+)$/;
+ my $key = $1;
+ my $substep = "examine-serial/$key";
+ my $ci = { K => $key, C => $r{$rv}, Substep => $substep };
+ substep_start($ci->{Substep}, 'ts-examine-serial-post');
+ push @cookies, $ci;
+ }
+}
+
+sub scan () {
+ foreach my $lf (<$stash/serial-*>) {
+ if ($lf =~ m/\.gz$/) {
+ open L, '-|', qw(zcat --), $lf or die $!;
+ } else {
+ open L, '<', $lf or die "$lf $!";
+ }
+ logm("examining logfile $lf");
+ while (<L>) {
+ foreach my $ci (@cookies) {
+ next if $ci->{Found};
+ next unless index($_,$ci->{C}) >= 0;
+ logm("found cookie for $ci->{K}");
+ $ci->{Found} = 1;
+ }
+ }
+ $!=0; $?=0; close L or die "$lf $? $!";
+ }
+}
+
+sub report () {
+ foreach my $ci (@cookies) {
+ substep_finish($ci->{Substep},
+ $ci->{Found} ? 'pass' : 'fail');
+ }
+}
+
+cookies();
+scan();
+report();
diff --git a/ts-examine-serial-pre b/ts-examine-serial-pre
new file mode 100755
index 0000000..01134ad
--- /dev/null
+++ b/ts-examine-serial-pre
@@ -0,0 +1,97 @@
+#!/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/>.
+
+# usage
+# ./ts-examine-serial-pre [host]
+# creates some random cookies to be printed to the serial console
+# $r{examine_serial_cookie_kernel} printed once by this script
+# $r{examine_serial_cookie_bootloader} will be printed on later boots
+
+use strict qw(vars);
+use DBI;
+unshift @INC, qw(.);
+use Osstest;
+use POSIX;
+use Osstest::TestSupport;
+use Osstest::Debian;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+
+die "do not want to mess up a shared host" if
+ $ho->{SharedReady} or
+ $ho->{Flags}{'no-reinstall'};
+
+sub get_cookie ($) {
+ my ($key) = @_;
+ my $rname = "examine_serial_cookie_$key";
+ return $r{$rname} if defined $r{$rname};
+ open R, "/dev/urandom";
+ my $v;
+ my $l = 16;
+ read(R, $v, $l) == $l or die;
+ $v = unpack "H*", $v;
+ store_runvar($rname, $v);
+ return $v;
+}
+
+sub ordinary_console () {
+ my $c = get_cookie('kernel');
+ target_cmd_root($ho, <<END);
+ echo 'osstest kernel cookie $c' >/dev/console
+END
+}
+
+sub bootloader () {
+ my $c = get_cookie('bootloader');
+ my $ed = sub {
+ my ($file,$script) = @_;
+ my $cmd = <<END;
+ ed $file <<EOF
+$script
+w
+q
+EOF
+END
+ $cmd .= setupboot_bootloader_edited_rune($ho);
+ target_cmd_root($ho, $cmd, 200);
+ };
+ my $edscript;
+ if ($ho->{Flags}{'need-uboot-bootscr'}) {
+ $ed->('/boot/boot.xen',<<END)
+/^echo Loaded
+i
+echo osstest uboot $c
+.
+END
+ } else {
+ $ed->('/boot/grub/grub.cfg',<<END); # no support for grub1
+\$
+?^terminal_
+a
+echo osstest grub2 $c
+sleep 2
+.
+END
+ }
+}
+
+ordinary_console();
+bootloader();
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 15/24] host examination: Permanently save the logs
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (12 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 14/24] host examination: Check that serial output is working Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 16/24] ts-hosts-allocate-Executive: Honour hostalloc_maxwait_max Ian Jackson
` (9 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
After this, we retain some of the logs from the last examination of
each host, in a directory in results/ named after the host.
The logic for computing the destination directory has similar env var
logic to that used in the invocation of sg-report-host-history but if
those are not set (as they usually won't be) has config-based
fallback.
In Standalone mode enough of these variables must be set to avoid
calling blessing_suffix, since we don't want the filename to depend on
a not-really-very-useful (and not implemented by intended_blessing)
Standalone flight's intended blessing.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
ts-examine-logs-save | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
create mode 100755 ts-examine-logs-save
diff --git a/ts-examine-logs-save b/ts-examine-logs-save
new file mode 100755
index 0000000..014522a
--- /dev/null
+++ b/ts-examine-logs-save
@@ -0,0 +1,106 @@
+#!/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);
+unshift @INC, qw(.);
+use Osstest;
+use Osstest::TestSupport;
+
+use POSIX;
+use File::Path qw(rmtree);
+
+tsreadconfig();
+
+if (!$mjobdb->jobdb_enable_log_capture) {
+ die "log capturing not enabled";
+}
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+
+our $dstdir;
+our $td;
+
+sub blessing_suffix () {
+ my $b = intended_blessing();
+ return $b eq 'real' ? '' : "-$b";
+}
+
+sub dstdir_prep () {
+ my $hdir =
+ ($ENV{OSSTEST_HTML_DIR} //
+ ($ENV{OSSTEST_HTML_DIR} // $c{PubBaseDir}).'/'.
+ ($ENV{OSSTEST_HTML_SUBDIR} // 'results'.
+ ($ENV{OSSTEST_HTML_SUFFIX} // blessing_suffix()))).
+ '/host';
+ if (!stat "$hdir") {
+ die "$hdir $!" unless $!==ENOENT;
+ logm("$hdir: $! - not saving logs");
+ exit 0;
+ }
+ # concurrency: lock is the host allocation
+ $dstdir = "$hdir/$ho->{Name}.examine";
+ $td = "$dstdir.tmp";
+ logm("constructing in $td");
+ rmtree $td;
+ mkdir $td or die "$td: $!";
+}
+
+sub mustrename ($$) {
+ rename $_[0],$_[1] or die "@_ $!";
+}
+
+sub dstdir_commit () {
+ mustrename "$td", "$dstdir.new";
+ rename "$dstdir", "$dstdir.old" or $!==ENOENT or die "$dstdir $!";
+ mustrename "$dstdir.new", "$dstdir";
+ rmtree "$dstdir.old";
+ logm("installed new $dstdir");
+}
+
+sub save_logs () {
+ my @re;
+ no warnings qw(qw);
+ foreach my $pat (qw(---var-log-dmesg
+ ---var-log-dmesg\.0
+ -output-cat_#proc#cpuinfo
+ -output-cat_#proc#modules
+ -output-cat_#proc#partitions
+ -output-ifconfig
+ -output-lspci_-tv)) {
+ my $re = $pat;
+ $re =~ s/^-/\Q$ho->{Name}\E-/;
+ push @re, "^$re\$";
+ }
+ my $re = join '|', @re;
+ logm("saving files matching $re");
+
+ opendir D, $stash or die "$stash $!";
+ while ($!=0, defined (my $f = readdir D)) {
+ #print STDERR ">$f<\n";
+ next unless $f =~ m/$re/o;
+ logm("saving $f");
+ link "$stash/$f", "$td/$f" or die "$stash $td $f $!";
+ }
+ die "$stash $!" if $!;
+ closedir D;
+}
+
+dstdir_prep();
+save_logs();
+dstdir_commit();
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 16/24] ts-hosts-allocate-Executive: Honour hostalloc_maxwait_max
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (13 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 15/24] host examination: Permanently save the logs Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 17/24] make-hosts-flight: Impose a timeout Ian Jackson
` (8 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
No functional change with existing flights.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
ts-hosts-allocate-Executive | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index 0987e2b..9955cba 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -56,6 +56,7 @@ if ($ENV{'OSSTEST_NOALLOCATE'}) {
}
# initialised by setup:
+our $alloc_start_time;
our $taskid;
our %magictaskid;
our $fi;
@@ -109,6 +110,8 @@ END
WHERE type='magic' AND refkey=?
END
}
+
+ $alloc_start_time = time // die $!;
}
#---------- prepared sql statements ----------
@@ -748,6 +751,16 @@ sub attempt_allocation {
logm("host allocation: successful, reporting to planner.");
} else {
logm("host allocation: planned start in $best->{Start} seconds.");
+ my $maxwait = $r{hostalloc_maxwait_max};
+ if (defined $maxwait) {
+ # We quit if:
+ # * we have been waiting at least $maxwait/2
+ # * we estimate it will take at least $maxwait overall
+ my $wait_sofar = (time // die $!) - $alloc_start_time;
+ die "timed out: $wait_sofar, $best->{Start}, $maxwait"
+ if $wait_sofar > $maxwait/2
+ && $wait_sofar + $best->{Start} > $maxwait;
+ }
}
if ($fake) {
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 17/24] make-hosts-flight: Impose a timeout
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (14 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 16/24] ts-hosts-allocate-Executive: Honour hostalloc_maxwait_max Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 18/24] cr-daily-branch: Move harness_rev definition Ian Jackson
` (7 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
If we cannot acquire a particular host for more than 20ks (~5.5h),
give up on it. This allows flights to complete if hosts are blocked
for a long time.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
make-hosts-flight | 3 +++
1 file changed, 3 insertions(+)
diff --git a/make-hosts-flight b/make-hosts-flight
index bbd3343..d619de6 100755
--- a/make-hosts-flight
+++ b/make-hosts-flight
@@ -28,6 +28,8 @@ buildflight=$5
: ${ALL_ARCHES:=amd64 i386 arm64 armhf}
: ${ALL_SUITES:=jessie stretch}
+: ${PERHOST_MAXWAIT:=20000} # seconds
+
flight=`./cs-flight-create $blessing $branch`
. ./cri-common
@@ -61,6 +63,7 @@ hosts_iterate () {
while read <&3 host kern arch suite; do
runvars="
arch=$arch host=$host
+ hostalloc_maxwait_max=$PERHOST_MAXWAIT
"
case $kern in
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 18/24] cr-daily-branch: Move harness_rev definition
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (15 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 17/24] make-hosts-flight: Impose a timeout Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 19/24] host examination: Add a check to many flights Ian Jackson
` (6 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
And also adjust some formatting.
No functional change.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
cr-daily-branch | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/cr-daily-branch b/cr-daily-branch
index 158554d..f0c6718 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -272,9 +272,9 @@ if [ "x$OLD_REVISION" = xdetermine-late ]; then
fi
case $branch in
-distros-*) makeflight=./make-distros-flight ;;
-xen-*-coverity)makeflight=./make-coverity-flight ;;
-*) makeflight=./make-flight ;;
+distros-*) makeflight=./make-distros-flight ;;
+xen-*-coverity) makeflight=./make-coverity-flight ;;
+*) makeflight=./make-flight ;;
esac
if [ "x$NEW_REVISION" = "x$OLD_REVISION" ]; then
@@ -294,10 +294,12 @@ $DAILY_BRANCH_PREMAKE_HOOK
flight=`$makeflight $branch $xenbranch $OSSTEST_BLESSING "$@"`
+harness_rev=$(perl -e 'use Osstest; print get_harness_rev();')
+narness_rev=${harness_rev%+}
+
case $branch in
xen-unstable-smoke)
- harness_rev=$(perl -e 'use Osstest; print get_harness_rev();')
- : ${SMOKE_HARNESS_REV:=${harness_rev%+}}
+ : ${SMOKE_HARNESS_REV:=$harness_rev}
./mg-adjust-flight-makexrefs -v $flight \
'!build-amd64 !build-amd64-libvirt !build-armhf build-*' \
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 19/24] host examination: Add a check to many flights
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (16 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 18/24] cr-daily-branch: Move harness_rev definition Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 20/24] host examination: Run a regular exam flight Ian Jackson
` (5 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Check that nothing in the principal other branches is likely to
regress the host examination machinery. This is particularly relevant
for osstest itself, of course.
Runvars look like this (e.g., from test-amd64-amd64-examine):
all_host_di_version current
all_host_suite jessie
all_hostflags arch-amd64,arch-xen-amd64,suite-jessie,purpose-test,PropMinVer:LinuxKernelMin:3.0
arch amd64
buildjob build-amd64
kernbuildjob build-amd64-pvops
kernkind pvops
toolstack xl
xenbuildjob build-amd64
New jobs are:
test-amd64-amd64-examine linux-3.16
test-amd64-i386-examine linux-3.18
test-arm64-arm64-examine X linux-4.1
test-armhf-armhf-examine linux-4.9
linux-linus
linux-next
osstest
xen-unstable
test-amd64-amd64-examine linux-3.0
test-amd64-i386-examine X linux-3.4
linux-3.10
linux-3.14
test-arm64-arm64-examine X linux-arm-xen
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
make-flight | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/make-flight b/make-flight
index 6dd0e5f..39ef6de 100755
--- a/make-flight
+++ b/make-flight
@@ -642,6 +642,18 @@ do_pv_debian_tests () {
$endfmt$dom0arch
}
+do_examine_one () {
+ case "$branch" in
+ xen-unstable) ;; # only likely to regress on -unstable
+ osstest) ;; # very likely to regress
+ linux-*) ;; # often seems to regress
+ *) return ;; # stuff used for guests is irrelevant
+ esac
+ job_create_test test-$xenarch$kern-$dom0arch-examine \
+ host-examine-xen xl $xenarch $dom0arch \
+ all_hostflags=$most_hostflags
+}
+
test_matrix_do_one () {
do_pv_debian_tests
@@ -663,6 +675,8 @@ test_matrix_do_one () {
do_rtds_tests
do_credit2_tests
+ do_examine_one
+
# No further arm tests at the moment
if [ $dom0arch = armhf -o $dom0arch = arm64 ]; then
return
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 20/24] host examination: Run a regular exam flight
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (17 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 19/24] host examination: Add a check to many flights Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 21/24] host examination: serial, grub2: put cookie in menu lines Ian Jackson
` (4 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Examine every host, once a month.
This flight contains these jobs:
build-amd64 build-amd64-pvops
build-arm64 build-arm64-pvops
build-armhf build-armhf-pvops
build-i386 build-i386-pvops
examine-*
The build jobs are very similar to normal build jobs and I won't
recount their contents here. In any case, normally they will be
replaced with build jobs from a recent xen-unstable or osstest flight.
The examine-SOMEHOST job looks like this:
all_host_di_version current
all_host_suite jessie
arch {amd64,i386,arm64,armhf}
buildjob build-{amd64,i386,arm64,armhf}
enable_xsm false
host SOMEHOST
hostalloc_maxwait_max 20000
kernbuildjob build-{amd64,i386,arm64,armhf}-pvops
kernkind pvops
toolstack xl
xenbuildjob build-{amd64,i386,arm64,armhf}
The above is from standalone-generate-dump-flight-runvars so contains
dummy data. The suite, architectures, host and recipe will vary
depending on the output from cs-list-hosts.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
cr-daily-branch | 15 ++++++++++++++-
cri-common | 2 +-
crontab | 1 +
crontab-cambridge | 2 ++
4 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/cr-daily-branch b/cr-daily-branch
index f0c6718..8a314ce 100755
--- a/cr-daily-branch
+++ b/cr-daily-branch
@@ -69,7 +69,7 @@ fetch_version () {
}
case $branch in
- distros-*)
+ distros-*|examine)
treeurl=none;;
*)
treeurl=`./ap-print-url $branch`;;
@@ -274,6 +274,11 @@ fi
case $branch in
distros-*) makeflight=./make-distros-flight ;;
xen-*-coverity) makeflight=./make-coverity-flight ;;
+examine) makeflight=make_hosts_flight
+ make_hosts_flight () {
+ ./make-hosts-flight $1 $2 blessed-$3 $3 $4
+ }
+ ;;
*) makeflight=./make-flight ;;
esac
@@ -309,6 +314,14 @@ xen-unstable-smoke)
# Even adhoc or play flights ought to reuse only real
# previous builds.
;;
+examine)
+ ./mg-adjust-flight-makexrefs -v $flight \
+ 'build-*' \
+ --debug --blessings=real \
+ --branch=xen-unstable,osstest \
+ --revision-xen=$REVISION_XEN \
+ --revision-osstest=$harness_rev
+ ;;
esac
$DAILY_BRANCH_POSTMAKE_HOOK
diff --git a/cri-common b/cri-common
index ac360de..903fb4e 100644
--- a/cri-common
+++ b/cri-common
@@ -80,7 +80,7 @@ select_xenbranch () {
seabios) tree=seabios; xenbranch=xen-unstable ;;
xtf) tree=xtf; xenbranch=xen-unstable ;;
ovmf) tree=ovmf; xenbranch=xen-unstable ;;
- distros-*) tree=none; xenbranch=xen-unstable ;;
+ distros-*|examine) tree=none; xenbranch=xen-unstable ;;
osstest) tree=osstest; xenbranch=xen-unstable ;;
esac
if [ "x$tree" = xlinux ]; then
diff --git a/crontab b/crontab
index 62047f3..4856569 100755
--- a/crontab
+++ b/crontab
@@ -9,6 +9,7 @@ MAILTO=ian.jackson@citrix.com,ian.campbell@eu.citrix.com
4-59/30 * * * * cd testing.git && ./cr-for-branches branches -q "./cr-daily-branch --real"
18 9 * * 1,3,5 cd testing.git && BRANCHES=linux-next ./cr-for-branches branches -w "./cr-daily-branch --real"
18 9 * * 3,7 cd testing.git && BRANCHES=xen-unstable-coverity ./cr-for-branches branches -w "./cr-daily-branch --real"
+34 15 23 * * cd testing.git && BRANCHES=examine ./cr-for-branches branches -w "./cr-daily-branch --real"
18 4 * * * cd testing.git && BRANCHES='linux-3.0 libvirt rumprun' ./cr-for-branches branches -w "./cr-daily-branch --real"
6-59/15 * * * * cd testing.git && EXTRA_BRANCHES='linux-3.0 rumprun libvirt' ./cr-for-branches bisects -w "./cr-try-bisect --real"
#8-59/5 * * * * cd bisects/adhoc.git && with-lock-ex -q data-tree-lock bash -c "./cr-try-bisect-adhoc; exit $?"
diff --git a/crontab-cambridge b/crontab-cambridge
index 2ababb0..3c197de 100755
--- a/crontab-cambridge
+++ b/crontab-cambridge
@@ -15,6 +15,8 @@ MAILTO=ian.jackson@citrix.com,ian.campbell@eu.citrix.com
46 7 * * 5 cd testing.git && BRANCHES='distros-debian-jessie' ./cr-for-branches branches -w "./cr-daily-branch --real"
46 7 * * 6 cd testing.git && BRANCHES='distros-debian-stretch' ./cr-for-branches branches -w "./cr-daily-branch --real"
+34 15 25 * * cd testing.git && BRANCHES=examine ./cr-for-branches branches -w "./cr-daily-branch --real"
+
#8-59/5 * * * * cd bisects/adhoc.git && with-lock-ex -q data-tree-lock bash -c "./cr-try-bisect-adhoc; exit $?"
22 8 * * * cd testing.git && BRANCHES=maintjobs ./cr-for-branches . -w ./cr-all-branch-statuses ''
3 4 * * * savelog -c28 testing.git/tmp/cr-for-branches.log >/dev/null
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 21/24] host examination: serial, grub2: put cookie in menu lines
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (18 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 20/24] host examination: Run a regular exam flight Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 22/24] host examination: bootloader: Do not use ed Ian Jackson
` (3 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
Empirically, the message printed by `echo' is not always shown. It
seems to depend on the host BIOS. I suspect that there's a
VGA-to-serial conversion step which only triggers when grub asks for
keyboard input, or something. In any case, empirically, increasing
the sleep (and sleeping before) did not work on the godellos.
Instead, stuff the cookie into the start of grub menu entries.
This is gross but effective.
We put it in the first menu, and the first submenu, which means it
will appear on the screen somewhere.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
ts-examine-serial-pre | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ts-examine-serial-pre b/ts-examine-serial-pre
index 01134ad..26fbc56 100755
--- a/ts-examine-serial-pre
+++ b/ts-examine-serial-pre
@@ -83,12 +83,12 @@ echo osstest uboot $c
END
} else {
$ed->('/boot/grub/grub.cfg',<<END); # no support for grub1
-\$
-?^terminal_
-a
-echo osstest grub2 $c
-sleep 2
-.
+1
+/^ *menuentry *
+s/'\([^']*\)'/'$c \1'
+1
+/^ *submenu *
+s
END
}
}
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 22/24] host examination: bootloader: Do not use ed
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (19 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 21/24] host examination: serial, grub2: put cookie in menu lines Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 23/24] host examination: bootloader: edit all grub2 menu entries Ian Jackson
` (2 subsequent siblings)
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
These ed runes are what I used to develop this approach, but they are
rather opaque to those very few programmers who are not proficient
users of ed, the standard text editor.
Also, using target_editfile_root means we keep a record of the
bootloader config in the logs, which is desirable.
The regexps used to edit the grub2 confiug are slightly more
sophisticated than the ed ones were.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
ts-examine-serial-pre | 49 ++++++++++++++++++++++++-------------------------
1 file changed, 24 insertions(+), 25 deletions(-)
diff --git a/ts-examine-serial-pre b/ts-examine-serial-pre
index 26fbc56..86f332f 100755
--- a/ts-examine-serial-pre
+++ b/ts-examine-serial-pre
@@ -61,35 +61,34 @@ END
sub bootloader () {
my $c = get_cookie('bootloader');
- my $ed = sub {
- my ($file,$script) = @_;
- my $cmd = <<END;
- ed $file <<EOF
-$script
-w
-q
-EOF
-END
- $cmd .= setupboot_bootloader_edited_rune($ho);
- target_cmd_root($ho, $cmd, 200);
+ my $edit = sub {
+ my ($file,$editor) = @_;
+ target_editfile_root($ho,$file,$editor);
+ target_cmd_root($ho, setupboot_bootloader_edited_rune($ho), 200);
};
my $edscript;
if ($ho->{Flags}{'need-uboot-bootscr'}) {
- $ed->('/boot/boot.xen',<<END)
-/^echo Loaded
-i
-echo osstest uboot $c
-.
-END
+ $edit->('/boot/boot.xen', sub {
+ my $done;
+ while (<::EI>) {
+ if (m/^echo Loaded/ && !$done++) {
+ print ::EO "echo osstest uboot $c\n";
+ }
+ print ::EO;
+ }
+ });
} else {
- $ed->('/boot/grub/grub.cfg',<<END); # no support for grub1
-1
-/^ *menuentry *
-s/'\([^']*\)'/'$c \1'
-1
-/^ *submenu *
-s
-END
+ # no support for grub1
+ $edit->('/boot/grub/grub.cfg', sub {
+ my %done;
+ while (<::EI>) {
+ s{^(\s* ( menuentry | submenu ) \s+
+ (['"]) )( [^'"]+ \3) }{
+ $done{$2}++ ? $& : "$1$c $4"
+ }xe;
+ print ::EO;
+ }
+ });
}
}
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 23/24] host examination: bootloader: edit all grub2 menu entries
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (20 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 22/24] host examination: bootloader: Do not use ed Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-18 11:01 ` [OSSTEST PATCH 24/24] host examination: bootloader: better handling of multiple runs Ian Jackson
2017-05-23 13:24 ` [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Roger Pau Monné
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
edit all the menuentry and submenu entries.
This is a good idea because in princple the first menu and submenu
entries in the autogenerated grub.cfg might be in a function which is
not actually called.
The resulting grub menu now looks even sillier.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
ts-examine-serial-pre | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/ts-examine-serial-pre b/ts-examine-serial-pre
index 86f332f..90037c6 100755
--- a/ts-examine-serial-pre
+++ b/ts-examine-serial-pre
@@ -80,12 +80,9 @@ sub bootloader () {
} else {
# no support for grub1
$edit->('/boot/grub/grub.cfg', sub {
- my %done;
while (<::EI>) {
- s{^(\s* ( menuentry | submenu ) \s+
- (['"]) )( [^'"]+ \3) }{
- $done{$2}++ ? $& : "$1$c $4"
- }xe;
+ s{^(\s* (?: menuentry | submenu ) \s+
+ (['"]) )( [^'"]+ \2) }{$1$c $3}x;
print ::EO;
}
});
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* [OSSTEST PATCH 24/24] host examination: bootloader: better handling of multiple runs
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (21 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 23/24] host examination: bootloader: edit all grub2 menu entries Ian Jackson
@ 2017-05-18 11:01 ` Ian Jackson
2017-05-23 13:24 ` [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Roger Pau Monné
23 siblings, 0 replies; 33+ messages in thread
From: Ian Jackson @ 2017-05-18 11:01 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson
If ts-examine-serial-pre was run more than once (which happens by hand
during development, for example), it would reuse the same ids (which
is not idea for manual testing, since we normally want to know if the
last run was good). Instead, generate new cookies each time (and
overwrite the old ones in the runvars).
Also, it owuld keep adding new copies to the grub menu entries
(obscuring the actual interesting menu text completely). Instead,
prefix the mentries with a fixed string so they can be stripped out
again. They now look a bit sillier after one run, but less silly
after several.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
ts-examine-serial-pre | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ts-examine-serial-pre b/ts-examine-serial-pre
index 90037c6..3905e52 100755
--- a/ts-examine-serial-pre
+++ b/ts-examine-serial-pre
@@ -42,7 +42,6 @@ die "do not want to mess up a shared host" if
sub get_cookie ($) {
my ($key) = @_;
my $rname = "examine_serial_cookie_$key";
- return $r{$rname} if defined $r{$rname};
open R, "/dev/urandom";
my $v;
my $l = 16;
@@ -82,7 +81,9 @@ sub bootloader () {
$edit->('/boot/grub/grub.cfg', sub {
while (<::EI>) {
s{^(\s* (?: menuentry | submenu ) \s+
- (['"]) )( [^'"]+ \2) }{$1$c $3}x;
+ (['"]) )
+ (?: osstest \ cookie \ [0-9a-f]+ \ )?
+ ( [^'"]+ \2) }{$1osstest cookie $c $3}x;
print ::EO;
}
});
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 33+ messages in thread* Re: [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights
2017-05-18 11:01 [OSSTEST PATCH 01/24] README: Advise using `play' for playground flights Ian Jackson
` (22 preceding siblings ...)
2017-05-18 11:01 ` [OSSTEST PATCH 24/24] host examination: bootloader: better handling of multiple runs Ian Jackson
@ 2017-05-23 13:24 ` Roger Pau Monné
23 siblings, 0 replies; 33+ messages in thread
From: Roger Pau Monné @ 2017-05-23 13:24 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
On Thu, May 18, 2017 at 12:01:11PM +0100, Ian Jackson wrote:
> Any flight eventually blessed `adhoc' is supposed to contain, in the
> db, accurate information corresponding to a real clean run. This is
> not appropriate for playing about.
>
> Using `play' usefully disables a number of safety catches, including
> one which prevents post-startup flight modification.
>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 33+ messages in thread