Skip to contentSkip to conversation

Miscellaneous minor fixes

PATCH New Ian Jackson 1 participant 5 messages Aug 19, 2014

lore
Share & tools
lore
#0 lore raw

cover Miscellaneous minor fixes

1/4 rump kernel tests: Get upstream from rumprun-xen 2/4 sg-report-flight: New --branches-also option 3/4 Fix mg-hosts mkpxedir
4/4 mg-hosts mkpxedir: honour $OSSTEST_SUDO

Ian C is away so I am going to push this right away rather than wait for a review from him.

#1 lore raw

PATCH 1/4 rump kernel tests: Get upstream from rumprun-xen

Replace https://github.com/rumpkernel/rumpuser-xen
with https://github.com/rumpkernel/rumprun-xen
as the source for the pre-test version. The repo has been renamed upstream.

We do not change, at this time:

* The name of the post-test output repo on xenbits,
git://xenbits.xen.org/rumpuser-xen.git#xen-tested-master

Changing those would be a bit fiddly.

And we don't change the following, which contain `rumpuserxen':

* osstest branch', recipe', and `jobs' which are used to correlate and specify aspects of the different production test runs of different versions of the code. The branch name appears in the Subject lines of email reports, and the job names in the body (and as column names in the html test report matrix).

* The osstest tree' names (which are used to specify and correlate the different versions and urls of the same' codebase in the various tests). Also, we leave unchanged the corresponding osstest tree plumbing environment variable names.

* The osstest build output identifiers from ts-rumpuser-xen-build including the runvar name and the dist part name. (These are used to communicate between the build and test jobs.)

Changing those would break cross-change comparison of test results and osstest's automatic bisection across the change.

We also don't change:

* The names of the ts-rumpuserxen-* test scripts.

While this could be changed by renaming the files and editing sg-run-job to match, it doesn't seem sensible to rename these while leaving everything else unchanged.

---
 ap-common |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ap-common +1 -1
index 6c7e654..ab8d884 100644
@@ -39,7 +39,7 @@
 
 : ${TREE_GNULIB_LIBVIRT:=$(besteffort_repo git://git.sv.gnu.org/gnulib.git)}
 
-: ${TREE_RUMPUSERXEN:=https://github.com/rumpkernel/rumpuser-xen}
+: ${TREE_RUMPUSERXEN:=https://github.com/rumpkernel/rumprun-xen}
 : ${TREEVCS_RUMPUSERXEN:=git}
 : ${BASE_TREE_RUMPUSERXEN:=git://xenbits.xen.org/rumpuser-xen.git}
 : ${PUSH_TREE_RUMPUSERXEN:=$XENBITS:/home/xen/git/rumpuser-xen.git}
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/4 sg-report-flight: New --branches-also option

In reply to Ian Jackson

This allows easy comparison of relevant flights (specified by tree versions) from one branch with relevant flights from another.

---
 sg-report-flight |   22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
sg-report-flight +16 -6
index 4f900c5..4760656 100755
@@ -34,10 +34,10 @@ use Osstest::Executive;
 
 our $specflight;
 our %specver;
-our @blessings;
+our (@blessings, @branches_also);
 our $mro;
 our $htmldir;
-our $branch;
+our ($branch, $branches_cond_q);
 our @allows;
 our (@includebeginfiles,@includefiles);
 
@@ -58,6 +58,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         $htmldir= $1;
     } elsif (m/^--blessings?=(.*)$/) {
         push @blessings, split ',', $1;
+    } elsif (m/^--branches-also?=(.*)$/) {
+        push @branches_also, split ',', $1;
     } elsif (m/^--include-begin=(.*)$/) {
         push @includebeginfiles, $1;
     } elsif (m/^--include=(.*)$/) {
@@ -135,6 +137,12 @@ sub displayflightnum ($) {
     }
 }
 
+sub compute_branches_cond () {
+    $branches_cond_q = "(".(join ' OR ',
+			    map { "branch='$_'" }
+			    ($branch, @branches_also)).")";
+}
+
 sub findaflight ($$$$$) {
     my ($thisthat, $exceptflight, $job, $testid, $sub) = @_;
 
@@ -166,7 +174,7 @@ END
     my $flightsq= <<END;
       SELECT * FROM (
         SELECT flight, blessing FROM flights
-            WHERE branch=?
+            WHERE $branches_cond_q
               AND $blessingscond
             ORDER BY flight DESC
             LIMIT 1000
@@ -175,7 +183,7 @@ END
 END
     #print DEBUG "===\n$flightsq\n===\n";
     $flightsq= $dbh_tests->prepare($flightsq);
-    $flightsq->execute($branch, @blessings);
+    $flightsq->execute(@blessings);
 
     my $buildflightsq= $dbh_tests->prepare(<<END);
         SELECT val FROM runvars
@@ -263,7 +271,9 @@ sub findspecflight () {
             SELECT branch FROM flights WHERE flight=?
 END
         die "$specflight branch ?" unless defined $branch;
+	compute_branches_cond();
     } else {
+	compute_branches_cond();
         $specflight= findaflight('this', undef,undef,undef,
                                  sub { return undef; });
         die unless defined $specflight;
@@ -596,7 +606,7 @@ sub justifyfailures ($;$) {
 
     my $anypassq= <<END;
         SELECT * FROM flights JOIN steps USING (flight)
-            WHERE branch=?
+            WHERE $branches_cond_q
               AND job=? and testid=? and status='pass'
               AND $blessingscond
             LIMIT 1
@@ -645,7 +655,7 @@ END
             next;
         }
 
-        $anypassq->execute($branch, $j->{job}, $s->{testid}, @blessings);
+        $anypassq->execute($j->{job}, $s->{testid}, @blessings);
         if (!$anypassq->fetchrow_hashref()) {
             print MRO "never-passed $j->{job} $s->{testid} $st\n";
             print DEBUG " never passed\n";
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/4 Fix mg-hosts mkpxedir

In reply to Ian Jackson

* Have selecthost no longer demand that $job is set; if it is not, simply do not set Suite (which of course ultimately comes from runvars and hence the job).

* Add missing use Osstest::TestSupport.

* Mention the need to run it in README.dev.

---
 Osstest/TestSupport.pm |    5 ++++-
 README.dev             |    2 ++
 mg-hosts               |    9 +++++----
 3 files changed, 11 insertions(+), 5 deletions(-)
Osstest/TestSupport.pm +4 -1
index fea54d5..1d77933 100644
@@ -751,8 +751,11 @@ sub selecthost ($) {
         Name => $name,
         TcpCheckPort => 22,
         Info => [],
-        Suite => get_runvar_default("${ident}_suite",$job,$c{DebianSuite}),
     };
+    if (defined $job) {
+	$ho->{Suite} = get_runvar_default("${ident}_suite",$job,
+					  $c{DebianSuite});
+    }
 
     #----- calculation of the host's properties -----
 
README.dev +2 -0
index d99c5c7..eb72659 100644
@@ -42,6 +42,8 @@ $ mg-hosts setprops marilith-n4 -- dhcp-watch-method 'leases dhcp3 dns-cam1.uk.x
 Handles multiple hosts:
 $ mg-hosts setprops HOSTA HOSTB -- "PROP" "VALUE"
 
+$ mg-hosts mkpxedir HOSTA HOSTB
+
 Create a flight:
 $ FLIGHT=`OSSTEST_CONFIG=production-config ./cs-flight-create commission xen-unstable`
 $ echo $FLIGHT
mg-hosts +5 -4
index c9d31df..2643548 100755
@@ -85,6 +85,7 @@
 use strict qw(vars refs);
 use DBI;
 use Osstest;
+use Osstest::TestSupport;
 
 csreadconfig();
 
@@ -110,10 +111,10 @@ sub cmd_mkpxedir () {
         system_checked(<<END);
             set -e
 	    cd $ho->{Tftp}{Path}$ho->{Tftp}{PxeDir}
-            sudo chown root.$ho->{Tftp}{PxeGroup} $macdir
-            sudo chmod 2775 $macdir
-            sudo rm -f $hn
-            sudo ln -s $macdir $hn
+            $sudo chown root.$ho->{Tftp}{PxeGroup} $macdir
+            $sudo chmod 2775 $macdir
+            $sudo rm -f $hn
+            $sudo ln -s $macdir $hn
             ls -ald $hn $macdir
 END
     }
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 4/4 mg-hosts mkpxedir: honour $OSSTEST_SUDO

In reply to Ian Jackson
---
 mg-hosts |    1 +
 1 file changed, 1 insertion(+)
mg-hosts +1 -0
index 2643548..c49be79 100755
@@ -104,6 +104,7 @@ sub l ($) { return split /,/, $_[0]; }
 
 sub cmd_mkpxedir () {
     die unless @ARGV>=1;
+    my $sudo = $ENV{'OSSTEST_SUDO'} // 'sudo';
     foreach my $hn (@ARGV) {
         my $ho= selecthost("host=$hn");
         my $macdir= $ho->{Ether};
Signature · 1 line
1.7.10.4