]> xenbits.xensource.com Git - osstest.git/log
osstest.git
9 years agocs-job-create: Permit creation of `synth' runvars
Ian Jackson [Thu, 2 Jul 2015 17:33:19 +0000 (18:33 +0100)]
cs-job-create: Permit creation of `synth' runvars

This will be useful for some hostalloc_* runvars which we are going to
introduce shortly.

This is going to be the way to set a runvar which is not copied by
cs-bisection-step or cs-adjust-flight.  Using `synth' for this is
arguably slightly wrong but it does the right thing in all existing
cases.  The alternative would be a schema change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Defer some of the discussion to later commit messages.

9 years agomg-debian-installer-update: download default armhf kernel as "linux" flight-62130 flight-62217 flight-62234 flight-62236 flight-62238 flight-62239 flight-62243 flight-62244 flight-62245 flight-62246 flight-62247 flight-62248 flight-62249 flight-62251 flight-62252 flight-62254 flight-62255 flight-62256 flight-62257 flight-62258 flight-62259 flight-62260 flight-62261 flight-62262 flight-62263 flight-62264 flight-62265 flight-62266 flight-62267 flight-62268 flight-62269 flight-62270 flight-62271 flight-62272 flight-62273 flight-62274 flight-62275 flight-62277 flight-62278 flight-62279 flight-62280 flight-62281 flight-62282 flight-62285 flight-62287 flight-62288 flight-62290 flight-62291 flight-62292 flight-62293 flight-62294 flight-62295 flight-62296 flight-62297 flight-62298 flight-62299 flight-62300 flight-62302 flight-62303 flight-62304 flight-62305 flight-62306 flight-62307 flight-62308 flight-62310 flight-62312 flight-62313 flight-62314 flight-62315 flight-62316 flight-62317 flight-62318 flight-62319 flight-62320 flight-62321 flight-62322 flight-62323 flight-62324 flight-62325 flight-62326 flight-62327 flight-62328 flight-62329 flight-62331 flight-62334 flight-62337 flight-62338 flight-62339 flight-62340 flight-62342 flight-62343 flight-62344 flight-62346 flight-62348 flight-62349 flight-62350
Ian Campbell [Fri, 18 Sep 2015 14:45:11 +0000 (15:45 +0100)]
mg-debian-installer-update: download default armhf kernel as "linux"

This is what the other arches do, and is what ts-host-install expects.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoREADME.dev: Some words on what is needed when updating the daemons.
Ian Campbell [Thu, 17 Sep 2015 15:09:37 +0000 (16:09 +0100)]
README.dev: Some words on what is needed when updating the daemons.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agomake-flight: Add a minimum linux version requirement to all linux-* branches
Ian Campbell [Wed, 16 Sep 2015 11:47:44 +0000 (12:47 +0100)]
make-flight: Add a minimum linux version requirement to all linux-* branches

We have some hosts in the colo which are not supported by older Linux
versions.

Add a suitable hostflag using the new resource conditions syntax to
cause this to occur.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoAdd support for selecting resources based on their properties.
Ian Campbell [Wed, 16 Sep 2015 11:47:43 +0000 (12:47 +0100)]
Add support for selecting resources based on their properties.

In particular for allocating hosts based on host properties.

To do this we extend the hostflags syntax with "condition:arg1:arg2".
This specifies that the candidate host must pass the condition given
the arguments.

Each "condition" is a new module in the Osstest::ResourceCondition
namespace. For each condition an object is constructed using the given
arguments (split on ':') and stored in $hid.

When allocating for each candidate host the object's ->check method is
called giving $restype and $resname and will return true or false
depending on whether the given host meets the condition.

Only a single condition is implemented here "PropMinVer" which
requires that a given property on the resource has at least the given
value when compared as a version string. Enforce that the database and
the resource property both use the canonical CamelCase naming through
the use of the newly added here propname_check function. Lack of the
property being compared is taken a "no restriction" and hence is
allowed.

Osstest::cfgvar_re is exported for use in the new propname_check
function.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-hosts-allocate-Executive: add a label to loop over candidates
Ian Campbell [Wed, 16 Sep 2015 11:47:42 +0000 (12:47 +0100)]
ts-hosts-allocate-Executive: add a label to loop over candidates

I'm going to want to "next CANDIDATE" from within a nested loop.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-hosts-allocate-Executive: Allow dry-run
Ian Campbell [Wed, 16 Sep 2015 11:47:41 +0000 (12:47 +0100)]
ts-hosts-allocate-Executive: Allow dry-run

Provide a new -n command line option which causes no allocations to be
done, for debugging.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agosg-run-job: support dropping in adhoc test recipes
Ian Campbell [Tue, 15 Sep 2015 09:00:46 +0000 (10:00 +0100)]
sg-run-job: support dropping in adhoc test recipes

By reading sg-run-job-adhoc if it exists.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agocs-adjust-flight: add recipe-set to adjust the recipe for a set of jobs
Ian Campbell [Tue, 15 Sep 2015 09:00:45 +0000 (10:00 +0100)]
cs-adjust-flight: add recipe-set to adjust the recipe for a set of jobs

When constructing an adhoc test it may be useful to copy an existing
job's configuration but run it with a custom recipe.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agocr-ensure-disk-space: Take the flights db lock
Ian Jackson [Fri, 3 Jul 2015 16:54:28 +0000 (17:54 +0100)]
cr-ensure-disk-space: Take the flights db lock

This eliminates the race with cs-bisection-step (and other
flight-construction tools which might reuse previous flights, provided
that they also do not pass previous flight numbers from hand to hand
with the db unlocked).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocr-ensure-disk-space: Make main loop body into a subroutine
Ian Jackson [Fri, 3 Jul 2015 16:50:46 +0000 (17:50 +0100)]
cr-ensure-disk-space: Make main loop body into a subroutine

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocr-ensure-disk-space: Look at referring flights
Ian Jackson [Fri, 3 Jul 2015 16:39:41 +0000 (17:39 +0100)]
cr-ensure-disk-space: Look at referring flights

Previously the flight to delete was simply the one with the lowest
flight number.  Now we sort flights not by their own flight number,
but by the highest flight number of any referencing flight.

This means that flights whose builds are being reused are kept as long
as the reusing flights.

This almost-entirely fixes a largely-theoretical race in the way
cs-bisection-step works (where the flight's logs and build outputs
might be deleted between the setup and execution of the referring
flight).

A smaller race still exists because the stash check in
cs-bisection-step occurs before the being-created flight is visible to
other db clients.  We will have to fix this by taking the flights
lock.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocr-ensure-disk-space: Honour -D
Ian Jackson [Fri, 3 Jul 2015 16:39:08 +0000 (17:39 +0100)]
cr-ensure-disk-space: Honour -D

Provide DEBUG and use db_prepare.  For now that is the only debugging
output.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoap-push: Use refs/heads/ for destinations
Ian Jackson [Thu, 27 Aug 2015 15:37:17 +0000 (16:37 +0100)]
ap-push: Use refs/heads/ for destinations

When the destination is a branch, specify refs/heads/ explicitly.
This makes ap-push work even if the ref does not yet exist on the
destination.

There is no functional change for an existing installation pushing to
an existing branch.  But for a hypothetical new installation, this
would be necessary.

And, more relevantly, when new "branches" are invented, the use of an
existing ap-push case as a template will generate a new case which
creates the branch as is necessary.

I leave the more complex osstest case alone.  It's not clear to me
whether the destination ref not existing is an installation problem of
such severity that indeed ap-push should fail.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoap-fetch-version*: Unwrap xen-unstable lines
Ian Jackson [Thu, 27 Aug 2015 15:11:35 +0000 (16:11 +0100)]
ap-fetch-version*: Unwrap xen-unstable lines

Whitespace and \ change only.  Makes the next patch a bit clearer.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agomfi-common: Use job_create_build for build-*-prev
Ian Jackson [Fri, 28 Aug 2015 17:47:10 +0000 (18:47 +0100)]
mfi-common: Use job_create_build for build-*-prev

This causes it to call job_create_build_filter_callback but has no
ultimate functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agostandalone mode: Fix two SQL `TRUE's
Ian Jackson [Thu, 17 Sep 2015 15:40:52 +0000 (16:40 +0100)]
standalone mode: Fix two SQL `TRUE's

SQL has no portable boolean true literal (really).  SQLite3 does not
understand `TRUE'.  Use `1=1' instead.

This means that mg-show-flight-runvars -a will work in standalone
mode.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: New patch

9 years agostandalone-generate-dump-flight-runvars: memoise ap-fetch
Ian Jackson [Fri, 28 Aug 2015 18:11:27 +0000 (19:11 +0100)]
standalone-generate-dump-flight-runvars: memoise ap-fetch

This makes it _much_ faster.

Also you can say AP_FETCH_MEMO_KEEP=1 to make it reuse old
information, which is useful for making comparisons.

For a further speed improvement, one can use `eatmydata'.  This is not
the default because it risks corruption of `standalone.db' which is
used for other purposes too.  Add a comment about possibly improving
this.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agomemoise: New utility
Ian Jackson [Fri, 28 Aug 2015 18:09:27 +0000 (19:09 +0100)]
memoise: New utility

Give this a GPLv2+ licence so that we can move it into some other
FLOSS package later.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Do not use FSF street address in copyright notice.
    Ship a copy of GPL-3.

9 years agocr-daily-branch: Honour AP_FETCH_PFX
Ian Jackson [Fri, 28 Aug 2015 17:53:18 +0000 (18:53 +0100)]
cr-daily-branch: Honour AP_FETCH_PFX

This environment variable is prefixed to all cr-daily-branch's command
lines involving ap-fetch.  We are going to use this for memoisation.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agostandalone: Set very long SQLite3 busy timeout in Perl
Ian Jackson [Tue, 15 Sep 2015 17:24:17 +0000 (18:24 +0100)]
standalone: Set very long SQLite3 busy timeout in Perl

Without this, big standalone-generate-dump-flight-runvars jobs may
trying to serialise so much work that SQLite3 times out.  And we are
about to introduce an optimisation which makes this much more likely.

In standalone mode we probably don't care much about this timeout at
all.  (It might even be that the user is using sqlite(3) and has
effectively locked the database interactively for an extended period.)

We would prefer to rely on the user to stop anything that seems to
have become stuck.  So set the timeout to 10ks.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agostandalone: Do not blunder on after errors
Ian Jackson [Wed, 16 Sep 2015 12:34:28 +0000 (13:34 +0100)]
standalone: Do not blunder on after errors

./standalone's with_logging function would _log_ errors, but it
wouldn't exit immediately.  As a result, the script would blunder on.

Normally it wouldn't do very much more since most of the with_logging
calls are the last thing it does - but the exit status would be wrong
(0, from echo).

As a result, for example, standalone-generate-dump-flight-runvars
would never properly report make-flight failures.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agomg-list-all-branches: Suppress `maintjobs'
Ian Jackson [Wed, 16 Sep 2015 13:00:42 +0000 (14:00 +0100)]
mg-list-all-branches: Suppress `maintjobs'

This is not a real branch; it's a cron working directory, only.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoExecutive: cs-job-create: Check that OSSTEST_FLIGHT is not set
Ian Jackson [Wed, 16 Sep 2015 12:28:54 +0000 (13:28 +0100)]
Executive: cs-job-create: Check that OSSTEST_FLIGHT is not set

If OSSTEST_FLIGHT is set on entry to JobDB::Executive::flight_create,
fail.  This obviously represents some kind of mistake.

One effect is that standalone-generate-dump-flight-runvars won't fill
an Executive database with test flights.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agodocs: Document OSSTEST_RESOURCE_PRIORITY values in README.planner
Ian Jackson [Wed, 16 Sep 2015 13:26:45 +0000 (14:26 +0100)]
docs: Document OSSTEST_RESOURCE_PRIORITY values in README.planner

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoExecutive: Abolish use of the `configdb' flight-61994 flight-62072 flight-62127 flight-62128 flight-62129 flight-62131 flight-62132 flight-62139 flight-62140 flight-62141 flight-62142 flight-62144 flight-62145 flight-62146 flight-62147 flight-62148 flight-62149 flight-62150 flight-62151 flight-62152 flight-62153 flight-62154 flight-62155 flight-62156 flight-62157 flight-62158 flight-62159 flight-62161 flight-62163 flight-62164 flight-62167 flight-62168 flight-62169 flight-62170 flight-62171 flight-62172 flight-62173 flight-62174 flight-62175 flight-62176 flight-62177 flight-62178 flight-62179 flight-62180 flight-62181 flight-62182 flight-62183 flight-62184 flight-62185 flight-62186 flight-62187 flight-62188 flight-62189 flight-62190 flight-62191 flight-62192 flight-62193 flight-62194 flight-62195 flight-62196 flight-62197 flight-62198 flight-62199 flight-62200 flight-62201 flight-62202 flight-62203 flight-62204 flight-62205 flight-62206 flight-62207 flight-62208 flight-62209 flight-62210 flight-62211 flight-62212 flight-62213 flight-62214 flight-62215 flight-62216 flight-62218 flight-62219 flight-62220 flight-62221 flight-62222 flight-62223 flight-62224 flight-62225 flight-62226 flight-62227 flight-62228 flight-62229 flight-62230
Ian Jackson [Mon, 14 Sep 2015 10:55:08 +0000 (11:55 +0100)]
Executive: Abolish use of the `configdb'

This was a database used by networking infrastructure on the
now-obsolete XenClient network in the Citrix Cambridge office (which
used some management tools developed by Mythic Beasts).

The production database in Cambridge no longer has the configdb, and
both instances have `HostDB_Executive_NoConfigDB 1' in the
configuration.  We think it very unlikely that anyone has as similar
arrangement.

Remove all the code for accessing this database.  We leave the config
settings `NoConfigDB' for now, for the benefit of ad-hoc trees which
are not immediately updated but which use their site's official
production-config.  They can be deleted later.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocs-bisection-step: Cope with graph-out (testids) containing ( ) etc.
Ian Jackson [Fri, 11 Sep 2015 15:27:08 +0000 (16:27 +0100)]
cs-bisection-step: Cope with graph-out (testids) containing ( ) etc.

cr-try-bisect launders / in the testid but relies on other characters
being handled appropriately by cs-bisection-step.  So for example it
can pass

  graph-out=/home/logs/results/bisect/linux-linus/test-armhf-armhf-xl-arndale.leak-check--basis(8)

But cs-bisection step foolishly assumed that the --graph-out argument
did not contain any shell metacharacters.  Fix this.

Specifically:

 * Change invocations of perl's open to use the 3-argument form
 * Change invocations of system to pass individual arguments rather
   than constructing a shell script fragment and relying on the shell
   to split it up.
 * In particular, in the png processing pipeline, use the "sh -ec
   <script> x <arg>..."  technique to pass the input and output
   filenames in a way that does not expose them to the shell's parser.
   To avoid making this code more tangled than it already is, also
   break out the construction of what is now $scriptlet.
 * Escape metacharacters in the URIs we put in the html output.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocrontab-cambridge: Add distros-debian-stretch
Ian Campbell [Mon, 14 Sep 2015 10:20:07 +0000 (11:20 +0100)]
crontab-cambridge: Add distros-debian-stretch

I thought I'd done this ages ago...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agocrontab-cambridge: Change the days when we run a given distro-debian suite
Ian Campbell [Mon, 14 Sep 2015 10:20:06 +0000 (11:20 +0100)]
crontab-cambridge: Change the days when we run a given distro-debian suite

The weekly CD images which are used by the snapshot flight are
generated Sunday-Monday, so running that on a Saturday as we have been
doing ensures that it will take at least two iterations/weeks to get
any issues fixed.

Also the current ordering of the existing releases made it hard to
decide where to insert a new release (e.g. Stretch).

So reorder as:
 - Run the Sid daily run on a Monday
 - Run the Snapshot run on a Tuesday (to pick up the weekly builds
   from Monday)
 - Run Squeeze on Wednesday and continue with newer releases
   chronologically from there.

New releases can then be added at the end (wrapping the days).

Also add some blank lines to aid clarity.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agocri-common: Refactor select_prevxenbranch to cri-getprevxenbranch
Ian Campbell [Fri, 11 Sep 2015 09:52:49 +0000 (10:52 +0100)]
cri-common: Refactor select_prevxenbranch to cri-getprevxenbranch

This moves it outside any prevailing set -x and reduces the amount of
noise in various logs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-xen-build: Do not set QEMU_REMOTE unless $r{tree_qemu} is set
Ian Campbell [Fri, 11 Sep 2015 10:07:03 +0000 (11:07 +0100)]
ts-xen-build: Do not set QEMU_REMOTE unless $r{tree_qemu} is set

4.4 and earlier do not check if QEMU_REMOTE is empty before using it.
From 4.5 onwards if QEMU_REMOTE is empty then default is used.

This should fix the build-*-prev job for 4.5 and earlier. In this job
we deliberately don't specify tree_qemu since we want whatever
that branch gives us.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-xen-install: Rewrite /etc/hosts to comment out 127.0.1.1 entry flight-61791 flight-61973 flight-61992 flight-61995 flight-61996 flight-61997 flight-61998 flight-61999 flight-62000 flight-62002 flight-62003 flight-62004 flight-62006 flight-62007 flight-62009 flight-62010 flight-62011 flight-62012 flight-62013 flight-62015 flight-62016 flight-62017 flight-62018 flight-62019 flight-62020 flight-62021 flight-62022 flight-62023 flight-62024 flight-62025 flight-62026 flight-62027 flight-62028 flight-62029 flight-62030 flight-62035 flight-62036 flight-62037 flight-62038 flight-62039 flight-62040 flight-62041 flight-62042 flight-62043 flight-62044 flight-62045 flight-62046 flight-62047 flight-62048 flight-62049 flight-62051 flight-62052 flight-62053 flight-62054 flight-62055 flight-62056 flight-62057 flight-62058 flight-62059 flight-62060 flight-62061 flight-62062 flight-62064 flight-62065 flight-62066 flight-62067 flight-62068 flight-62069 flight-62070 flight-62071 flight-62073 flight-62074 flight-62075 flight-62076 flight-62077 flight-62078 flight-62079 flight-62080 flight-62081 flight-62082 flight-62083 flight-62084 flight-62085 flight-62087 flight-62088 flight-62089 flight-62090 flight-62091 flight-62092 flight-62093 flight-62094 flight-62095 flight-62096 flight-62097 flight-62098 flight-62099 flight-62100 flight-62101 flight-62102 flight-62103 flight-62104 flight-62105 flight-62106 flight-62107 flight-62108 flight-62109 flight-62110 flight-62111 flight-62112 flight-62113 flight-62114 flight-62115 flight-62116 flight-62117 flight-62118
Ian Campbell [Mon, 7 Sep 2015 12:58:29 +0000 (13:58 +0100)]
ts-xen-install: Rewrite /etc/hosts to comment out 127.0.1.1 entry

Debian creates an entry such as:
127.0.1.1             lace-bug.xs.citrite.net         lace-bug

This causes local lookups of the FQDN to get 127.0.1.1, which is
unhelpful if you are looking for an address to bind to and were hoping
to get the public IP address, as libvirt does on the target host for
migration.

Here we remove (actually, comment) any 127.0.1.1 line in /etc/hosts.
This means that lookups of a hosts own name (fqdn or just dn) now rely
on DNS, which may not be ideal. However for a host which uses DHCP I'm
not aware of a way to keep /etc/hosts up to date with the actual IP
address the machine has.  In our infra the test host IP addresses are
all static, but I don't think we want to rely on at any more that we
already do.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agocambridge: arrange to test each new baseline
Ian Campbell [Thu, 13 Aug 2015 15:18:37 +0000 (16:18 +0100)]
cambridge: arrange to test each new baseline

Provide a new cr-daily-branch setting OSSTEST_BASELINES_ONLY which
causes it to only attempt to test the current baseline (if it is
untested) and never the tip version. Such tests will not result in any
push.

Each new baseline is tested exactly once (i.e. we aren't repeating
hoping for a pass), hence the correct revision is just the one tested
by the last run on the branch.

Add a cronjob to Cambridge which runs in this manner, ensuring that
there will usually be some sort of reasonably up to date baseline for
any given branch which can be used for comparisons in adhoc testing or
bisections.

This will also give us some data on the success of various branches on
the set of machines in Cambridge, which can be useful/interesting.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agocr-daily-branch: Begin to support other reasons for forcing a baseline.
Ian Campbell [Thu, 13 Aug 2015 15:18:36 +0000 (16:18 +0100)]
cr-daily-branch: Begin to support other reasons for forcing a baseline.

By converting the current boolean $force_baseline into a keyword
indicating the reason.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoOsstest/TestSupport: Hide $ho->{Toolstack} from casual use
Ian Campbell [Fri, 31 Jul 2015 10:58:48 +0000 (11:58 +0100)]
Osstest/TestSupport: Hide $ho->{Toolstack} from casual use

This should only be accessed via toolstack($ho), which is responsible
for caching the value. Rename the field to _Toolstack to deter code
from using it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-xen-install: Add dom0_mem runvar to control dom0 memory
Anthony PERARD [Thu, 6 Aug 2015 17:03:28 +0000 (18:03 +0100)]
ts-xen-install: Add dom0_mem runvar to control dom0 memory

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-kernel-build: Compile CONFIG_CRYPTO_XTS in
Anthony PERARD [Thu, 6 Aug 2015 17:03:27 +0000 (18:03 +0100)]
ts-kernel-build: Compile CONFIG_CRYPTO_XTS in

OpenStack Tempest is using aes-xts-plain64 cipher with cryptsetup to test
encrypted volumes and this is not configurable.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agots-kernel-build: Enable CONFIG_NETFILTER_XT_TARGET_CHECKSUM
Anthony PERARD [Thu, 6 Aug 2015 17:03:26 +0000 (18:03 +0100)]
ts-kernel-build: Enable CONFIG_NETFILTER_XT_TARGET_CHECKSUM

This iptables target CHECKSUM is used by OpenStack.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoproduction-config: Add my ssh key to AuthorizedKeysAppend
Ian Campbell [Wed, 9 Sep 2015 16:04:58 +0000 (17:04 +0100)]
production-config: Add my ssh key to AuthorizedKeysAppend

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agoproduction-config: Update TftpDiVersion
Ian Jackson [Wed, 9 Sep 2015 15:46:21 +0000 (16:46 +0100)]
production-config: Update TftpDiVersion

I have already run mg-debian-installer-update-all

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- also update production-config-cambridge ]

9 years agoXen 4.6 has branched flight-61707 flight-61708 flight-61711 flight-61712 flight-61719 flight-61720 flight-61721 flight-61722 flight-61723 flight-61724 flight-61725 flight-61726 flight-61727 flight-61728 flight-61729 flight-61730 flight-61731 flight-61732 flight-61733 flight-61734 flight-61735 flight-61736 flight-61737 flight-61738 flight-61739 flight-61740 flight-61741 flight-61742 flight-61743 flight-61745 flight-61746 flight-61750 flight-61751 flight-61754 flight-61755 flight-61756 flight-61767 flight-61768 flight-61769 flight-61770 flight-61771 flight-61772 flight-61773 flight-61774 flight-61775 flight-61776 flight-61777 flight-61778 flight-61779 flight-61780 flight-61781 flight-61782 flight-61784 flight-61786 flight-61787 flight-61789 flight-61790 flight-61792 flight-61793 flight-61794 flight-61796 flight-61797 flight-61798 flight-61799 flight-61801 flight-61802 flight-61803 flight-61804 flight-61805 flight-61807 flight-61809 flight-61810 flight-61817 flight-61818 flight-61819 flight-61820 flight-61821 flight-61822 flight-61823 flight-61824 flight-61825 flight-61826 flight-61827 flight-61828 flight-61839 flight-61841 flight-61843 flight-61844 flight-61845 flight-61881 flight-61882 flight-61883 flight-61884 flight-61886 flight-61887 flight-61888 flight-61889 flight-61890 flight-61891 flight-61892 flight-61893 flight-61894 flight-61911 flight-61912 flight-61925 flight-61926 flight-61927 flight-61928 flight-61929 flight-61930 flight-61931 flight-61932 flight-61933 flight-61934 flight-61935 flight-61936 flight-61937 flight-61938 flight-61939 flight-61940 flight-61941 flight-61942 flight-61943 flight-61944 flight-61945 flight-61946 flight-61947 flight-61948 flight-61949 flight-61950 flight-61951 flight-61952 flight-61953 flight-61955 flight-61956 flight-61957 flight-61958 flight-61959 flight-61960 flight-61961 flight-61963 flight-61964 flight-61965 flight-61966 flight-61967 flight-61968 flight-61969 flight-61970 flight-61971 flight-61972 flight-61974 flight-61975 flight-61976 flight-61977 flight-61978 flight-61979 flight-61980 flight-61981 flight-61982 flight-61983 flight-61985 flight-61986 flight-61987 flight-61988 flight-61991
Ian Jackson [Wed, 9 Sep 2015 15:10:27 +0000 (16:10 +0100)]
Xen 4.6 has branched

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agoms-queuedaemon: Increase default QueueThoughtsTimeout from 30 to 90s flight-61613 flight-61706
Ian Jackson [Mon, 7 Sep 2015 16:57:19 +0000 (17:57 +0100)]
ms-queuedaemon: Increase default QueueThoughtsTimeout from 30 to 90s

This was updated cowboy-fashion in the colo in July, and has been
working well there.  Formalise it.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agoManual allocation: Set $| in mg-blockage
Ian Jackson [Mon, 7 Sep 2015 15:38:01 +0000 (16:38 +0100)]
Manual allocation: Set $| in mg-blockage

This makes it slightly easier to see what it's happening if
mg-allocate or mg-blockage has no tty.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoManual allocation: Show tty in jobinfo
Ian Jackson [Mon, 7 Sep 2015 13:20:26 +0000 (14:20 +0100)]
Manual allocation: Show tty in jobinfo

Signed-off-by: Ian Jackson <iwj@osstest.xs.citrite.net>
---
v2: New patch

9 years agoManual allocation: Provide JobInfo in mg-allocate
Ian Jackson [Mon, 7 Sep 2015 13:19:24 +0000 (14:19 +0100)]
Manual allocation: Provide JobInfo in mg-allocate

Use manual_allocation_base_jobinfo to obtain some information which
will go into `job' in the planner, and show up everywhere.

Put just the request (from the command line) in the Xinfo.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoManual allocation: Provide JobInfo in mg-blockage
Ian Jackson [Tue, 8 Sep 2015 10:30:29 +0000 (11:30 +0100)]
Manual allocation: Provide JobInfo in mg-blockage

Supply most of the information about our allocations in JobInfo,
rather than Xinfo.  And, correspondingly, rename all the variables
`xinfo' to `info'.

Supply only the supplied hostname as the Xinfo.  This is slightly
redundant but it does at least tell us what came out of the db.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch
v3: Refreshed so no longer needs to incidentally fix `joinfo'.

9 years agoManual allocation: Break out manual_allocation_base_jobinfo from mg-blockage
Ian Jackson [Mon, 7 Sep 2015 13:00:51 +0000 (14:00 +0100)]
Manual allocation: Break out manual_allocation_base_jobinfo from mg-blockage

This is called `jobinfo' because it ought to be used in
alloc_resources's JobInfo xparam, rather than an Xinfo in the booking:
JobInfo is per planning client; Xinfo is per individual resource.

mg-blockage currently gets this wrong; we will fix that shortly.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: New patch
v3: Fix "joinfo" to "jobinfo".

9 years agoManual allocation: Report better info in plan for rogue tasks
Ian Jackson [Mon, 7 Sep 2015 13:15:25 +0000 (14:15 +0100)]
Manual allocation: Report better info in plan for rogue tasks

(This will only take effect as such tasks appear in the plan for the
first time.  Ie, once a rogue task is found, the plan is populated by
whatever version of the planner is running at that time.  So the
effect will not be immediately visible.)

Signed-off-by: Ian Jackson <iwj@osstest.xs.citrite.net>
---
v2: New patch

9 years agoPlanner: ms-queuedaemon: Reformat debugging output for more tasks
Ian Jackson [Mon, 7 Sep 2015 14:15:14 +0000 (15:15 +0100)]
Planner: ms-queuedaemon: Reformat debugging output for more tasks

These wider fields will work well for up to 999 tasks.

Cosmetic change only.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoPlanner: ms-queuedaemon: Better log message for Tcl `after idle'
Ian Jackson [Mon, 7 Sep 2015 14:14:10 +0000 (15:14 +0100)]
Planner: ms-queuedaemon: Better log message for Tcl `after idle'

This does not mean the planner is `idle' in any general sense of the
word.  It just means that the Tcl event loop has finished processing
outstanding events.  Change the debug message to be less confusing.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoPlanner: Remove O(n^2) problem from plan restart
Ian Jackson [Fri, 4 Sep 2015 16:44:21 +0000 (17:44 +0100)]
Planner: Remove O(n^2) problem from plan restart

Change `./ms-planner unprocessed' to take a file of infos on stdin,
and when we restart the planning, invoke it once.

(This would be an incompatible change to the planner, needing a
queuedaemon restart, if this patch were applied separately from the
previous "Report unprocessed planning clients".)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: New patch

9 years agoPlanner: ms-queuedaemon: Use chan-get-desc in chan-plan-info
Ian Jackson [Mon, 7 Sep 2015 14:45:42 +0000 (15:45 +0100)]
Planner: ms-queuedaemon: Use chan-get-desc in chan-plan-info

This relieves the callers of the need to provide a desc.  This is
helpful because chan-note-unprocessed doesn't have one.

Overall functional change is to show the chan desc (ie, the client TCP
connection info) in the list of unprocessed clients.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoTcl: Provide get-chan-desc in daemonlib
Ian Jackson [Mon, 7 Sep 2015 14:42:04 +0000 (15:42 +0100)]
Tcl: Provide get-chan-desc in daemonlib

Provide a facility for the daemon main program to get the channel
connection information.

No caller yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoPlanner: Report unprocessed planning clients
Ian Jackson [Mon, 7 Sep 2015 14:08:19 +0000 (15:08 +0100)]
Planner: Report unprocessed planning clients

With recent changes, it can happen that a queue daemon client is not
given an opportunity to report itself in the plan.  This makes the
plan incomplete.

(For resource-plan.html, because the planning run was restarted to try
to quickly allocate new resources; for resource-projection.html,
because it's an old client that doesn't support feature-noalloc.)

When this happens, provide an explicit indication of this in the plan:

* Invent a new entry Unprocessed in data-*.pl for this information.
* Display the first 50 in ms-planner show-html.
* Provide a new ms-planner invocation `unprocessed' to record one.
* Note unprocessed when we skip a client due to !feature-noalloc.
* Note unprocessed for remaining queue when we restart planning.

For now this algorithm can be rather unfortunately O(n^2) when
draining the planning queue, because each `ms-planner unprocessed'
invocation adds only one job but needs to read and write the whole
plan.   This will be fixed shortly.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoPlanner: ms-queuedaemon: Break out chan-plan-info
Ian Jackson [Mon, 7 Sep 2015 14:20:27 +0000 (15:20 +0100)]
Planner: ms-queuedaemon: Break out chan-plan-info

Also, refactor the space separator handling to use a list and `join'
(since we are going to maybe have desc be "").

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoPlan reporting: Provide get-last-plan queuedaemon command
Ian Jackson [Thu, 3 Sep 2015 11:46:27 +0000 (12:46 +0100)]
Plan reporting: Provide get-last-plan queuedaemon command

This allows retrieval, by monitoring clients which are not
participating in the planning queue, of the finished projection, or
the unfinished plan as it was at the time of last restart.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: Fix invocation of return-plan-to-client.
    Use data-W.final.pl, not data-W-final.pl, to fit
        with existing .gitignore, and be slightly neater.

9 years agoPlan reporting: Break out return-plan-to-client
Ian Jackson [Thu, 3 Sep 2015 11:45:32 +0000 (12:45 +0100)]
Plan reporting: Break out return-plan-to-client

We are going to want to reuse this.  No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: ms-queuedaemon: Restart planning when resources become free
Ian Jackson [Wed, 2 Sep 2015 14:12:48 +0000 (15:12 +0100)]
Planner: ms-queuedaemon: Restart planning when resources become free

This solves a performance problem with the existing planner.

The problem is that with a large installation, and a big queue, a full
plan can take a long time to prepare.  (In our current installation,
perhaps as long as half an hour.)  Any resource which becomes free
during one plan run cannot be allocated to a new job until the next
plan run starts.  This means resources (test machines) are often
sitting around idle.

Fix this by restarting the planning process as soon as any new
resource becomes free.  This means that jobs at the front of the queue
get a chance to allocate it right away, so it will probably be
allocated soon.

If it is only interesting to jobs later in the queue, then there may
be a delay in reallocating it, but presumably the resource is not much
in demand and those later jobs will allocate it when they get a bit
closer to the head.

But, there is a problem with this: it means that the plan is generally
never completed.  So we have no overview any more of when which
flights will finish and what the overall queue is like.  We solve this
problem by running a second instance of the planner algorithm, all the
way to completion, in a `dummy' mode where no actual resource
allocation takes place.  This second `projection' instance comes into
being whenever the main `plan' instance is restarted, and it inherits
the planning state from the main `plan' instance.

Global livelock (where we keep restarting the plan but never manage to
allocate anything) is not possible because each restart involves a new
resource becoming free.  If nothing gets allocated because we can't
get that far before being restarted, then eventually there will be
nothing left allocated to become newly free.

Starvation, of a form, is possible: a late-in-queue job which wants a
resource available right now might have difficulty allocating it
because the planner is spending its effort rescheduling early-in-queue
jobs which want resources which are in greater demand - so that the
late-in-queue job never gets called.  Arguably this is an appropriate
allocation of planning time.

With this arrangement we can generate two reports: a `plan' report
containing the short term plan which was used for actual resource
allocation, and which is frequently restarted and therefore not
necessarily complete; and a `projection' report which contains a
complete plan for all work the system is currently aware of, but which
is less-frequently updated.

Because planner clients do not contain the planning algorithm state,
the only client change needed is the ability to run in a `dummy' mode
without actual allocation; this is the `noalloc' feature earlier in
this series.

The main work is in ms-queuedaemon.  We have prepared the ground for
multiple instances of the planning algorithm; from the point of view
of ms-queuedaemon, an instance of the planning algorithm is mainly a
walk over the job queue.  So we call them `walkers'.

Therefore, what we do here is introduce a new `projection' walker,
as follows:

Add `projection' to the global list of possible walkers.

Invent a new section of code, the `restarter', which is responsible
for managing the relationship between the two walkers.  (It uses
direct knowledge of the queue state data structures, etc., to avoid
having to invent a complete formal interface to a walker.)

If we ever finish the plan walker's queue, we update both the
projection report output and the plan report output, from the same
plan.  Finishing the projection walker's queue means we have a
complete projection, but we don't touch the plan.

In principle it might happen that the plan walker might overtake the
projection walker, and then complete, write out a complete and up to
date plan as the projection, and that the projection walker would then
complete and overwrite the projection with less-up-to-date
information.  We don't explicitly exclude this.  Of course such a
result will be rectified soon enough by another planning run.

The restarter can ask the database for the list of currently-available
resources, and can therefore detect when new become newly-free.

The rest of the code remains largely ignorant of the operation of the
restarter.  There are a few hooks:

runneeded-perhaps-start notifies the restarter when we start the
plan; this is used by the restarter to record the set of free
resources at the start of a planning run, so that it can see later
whether any /new/ resources have become free.

restarter-maybe-provoke-restart is called when we get notification
from the the owner daemon that resources may have become idle.  We
look for newly-idle resources, and if there are any, and we are
running the plan walker, we directly edit the plan walker's queue to
put RESTART at the front.

queuerun-perhaps-step spots the special entry RESTART in its queue and
calls into back the restarter when it finds it.  This deferred
approach is necessary because we can't do the restart operation while
a client is thinking (because we would have to change that client's
cogitation from the `live, can allocate' mode to the `dummy, cannot
allocate' mode; and because that would make the code more complex).

The main work is done in the restarter-restart-now hook.  It reports
the current (incomplete) plan, and then checks to see if a projection
walker is running; if it is, it leaves it alone, and simply abandons
the current plan run and arranges for a new run to started.  If a
projection walker is not running it copies all the plan walker's state
(including the data-plan.pl disk file containing the plan-in-progress)
to the projection walker, and sets the projection walker going.

We update .gitignore to ignore data-plan.* and data-projection.*.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: Update .gitignore too.
    Use `walker-globals' not `walker-runvars' (which does not exist).
    Remove wrap damage `#' from comment.
    Fix typo in commit message.
    Fix several silly bugs in for-free-resources
    Fix three silly bugs relating to handling of $newly_free
    Fix a wrong bracket syntax error in restarter-maybe-provoke-restart
    Properly return from queuerun-perhaps-step on RESTART;
        restarter-restart-now has taken the flow of control.
    Reorder operations in restarter-restart-now so as to make it work
    Correct some wrong log messages in restarter-restart-now
    Add a log message when we restart planning
    Minor code layout changes
    In notify-to-think, process feature-noalloc properly

9 years agoPlanner: ms-queuedaemon: Make report-plan take output walker name
Ian Jackson [Tue, 1 Sep 2015 18:18:35 +0000 (19:18 +0100)]
Planner: ms-queuedaemon: Make report-plan take output walker name

We are going to want to process each walker's data into reports which
are not necessarily named after the same walker.

No functional change as yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: ms-queuedaemon: Break out notify-to-think
Ian Jackson [Wed, 2 Sep 2015 14:35:20 +0000 (15:35 +0100)]
Planner: ms-queuedaemon: Break out notify-to-think

This is going to want to do something more complicated shortly.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Fix a whitespace error

9 years agoPlanner: ms-queuedaemon: Break out queuerun-finished/<walker>
Ian Jackson [Tue, 1 Sep 2015 18:04:53 +0000 (19:04 +0100)]
Planner: ms-queuedaemon: Break out queuerun-finished/<walker>

This formalises the queue-completed interface, allowing parts outside
the queuerun machinery to cleanly be notified when a queue is
completed, and relieving the queuerun-perhaps-step of the need to know
what to do for the end of any particular walker's queue.

Currently there is still only one walker, `plan'.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: ms-queuedaemon: Synchronise thinking multiple walkers
Ian Jackson [Tue, 1 Sep 2015 16:09:23 +0000 (17:09 +0100)]
Planner: ms-queuedaemon: Synchronise thinking multiple walkers

If multiple walkers want to ask the same chan, we want to serialise
them.  This is actually straightforward:  Firstly, we arrrange that
each walker finishing a thought will prompt _all_ walkers to
reconsider whether they need to continue.  Then we can simply do
nothing if we want to a chan to think that another walker is already
waiting for; since that other walker will prompt us later.

Still no actual functional change because there is still only one
walker.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: ms-queuedaemon: Prep for multiple walkers
Ian Jackson [Tue, 1 Sep 2015 15:54:04 +0000 (16:54 +0100)]
Planner: ms-queuedaemon: Prep for multiple walkers

We are going to introduce multiple concurrent streams of planning
processing, called `walkers'.

Prepare the ground for this with some formulaic changes which will
otherwise greatly clutter substantive patches.

(A client will still only think for one walker at once, because that's
what the client protocol expects - and anything else would be far too
confusing.)

General:
 * Introduce the concept of a `walker' to ms-queuedaemon.
 * Provide a list of the walkers which might exist, `walkers'
 * Provide some helper procedures for iterating over these,
   and easily accessing their state.

Queue handling:
 * Add a new `w' argument to many procs: specifically, most of the
   procs in the section `machinery for running the queue'.
 * Log the walker ($w) at the start of all relevant log messages.
 * Pass the -w option to ms-planner and ms-planner-debug.
 * Add safety catches which will crash the ms-queuedaemon if it finds
   it is asking the same client to think for more than one walker.
 * we-are-thinking and check-we-are-thinking tell the caller what
   walker the client is thinking for.
 * In the resource-plan.html filename, replace `plan' with the walker
   filename.

Elsewhere:
 * Teach dequeue-chan to deal with all the walkers, including
   maybe the (one) walker for which the client is thinking.
 * Teach log-state to report on all the walkers.
 * In the runneeded logic, hardcode `plan' as the walker to use.

There is still actually only one walker.

No overall functional change, except to some log messages.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: Fix walker-globals to import the $w/$v from #0, ie the global scope
    Correct invocation of upvar in walker-globals
    Use walker-globals everywhere, not obsolete name walker-vars
    Do not pass w to do-book-resources (which does not want it
        because it uses uses chan-we-are-thinking)

9 years agoPlanner: ms-planner support -w option
Ian Jackson [Tue, 1 Sep 2015 15:52:17 +0000 (16:52 +0100)]
Planner: ms-planner support -w option

We are going to introduce multiple concurrent streams of planning
processing, called `walkers' in ms-queuedaemon.  The work-in-progress
plan is stored, server-side, during planning, in data-plan.pl.  But we
need to have more than one of these.

Update ms-planner and ms-planner-debug to honour a -w option, to
specify a replacement for the word `plan' in `data-plan.pl'.

No overall functional change, since nothing uses these options yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: client side: Do not force OSSTEST_RESOURCE_PRIORITY
Ian Jackson [Mon, 7 Sep 2015 14:43:29 +0000 (15:43 +0100)]
Planner: client side: Do not force OSSTEST_RESOURCE_PRIORITY

This makes it possible to run mg-allocate with a different priority
simply by setting OSSTEST_RESOURCE_PRIORITY in its environment.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: New patch

9 years agoPlanner: client side: New `!OK think noalloc' protocol
Ian Jackson [Tue, 1 Sep 2015 13:56:46 +0000 (14:56 +0100)]
Planner: client side: New `!OK think noalloc' protocol

Introduce a way for the queue daemon to tell its client that it must
not allocate anything in this planning iteration.

In the client:
 * Advertise the new feature via set-info.
 * Accept the `noalloc' part of `!OK think noalloc';
 * Print that in our log message;
 * Honour it by passing it to $resourcecall.

And document the new protocol.  However, there is no server-side yet,
so this does not yet introduce any overall change to the system.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: client side: $mayalloc parameter to $resourcecall->()
Ian Jackson [Tue, 1 Sep 2015 13:50:52 +0000 (14:50 +0100)]
Planner: client side: $mayalloc parameter to $resourcecall->()

Add a new parameter to $resourcecall which allows the alloc_resources
loop in Osstest::Executive to specify to its clients that on this
occasion they should not make any actual allocations.

The callers of alloc_resources are all adjusted to honour this new
parameter:
 * ts-hosts-allocate-Executive avoids allocating unless $mayalloc
 * mg-allocate avoids allocating unless $mayalloc
 * mg-blockage never allocates anyway.

Currently we always pass 1, so no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v3: Add missing my $mayalloc.  ($plan is global.)

9 years agoPlanner: Fix indefinite holdoff
Ian Jackson [Tue, 1 Sep 2015 18:15:32 +0000 (19:15 +0100)]
Planner: Fix indefinite holdoff

runneeded-ensure-will would always reset the runneeded_holdoff_after
timer.  So no new queue run would start until no runneeded-ensure-will
has occurred for (currently) 30s.

Instead, only start the timer if it's not already running.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: docs: Document set-info command
Ian Jackson [Tue, 1 Sep 2015 19:35:54 +0000 (20:35 +0100)]
Planner: docs: Document set-info command

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoPlanner: docs: Minor fixes
Ian Jackson [Tue, 1 Sep 2015 13:39:57 +0000 (14:39 +0100)]
Planner: docs: Minor fixes

 * Document the ms-queuedaemon banner
 * Document the argument to the allocation $resourcecall callback fn.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoTcl: Use lshift instead of open-coding with lrange
Ian Jackson [Tue, 1 Sep 2015 18:33:55 +0000 (19:33 +0100)]
Tcl: Use lshift instead of open-coding with lrange

In ms-queuedaemon, and JobDB-Executive, once each.  No functional
change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agots-hosts-allocate-Executive: Add the requesting Job to the booking
Ian Campbell [Wed, 1 Apr 2015 16:49:35 +0000 (17:49 +0100)]
ts-hosts-allocate-Executive: Add the requesting Job to the booking

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoms-planner: Expose the plan start in json.
Ian Campbell [Mon, 13 Jul 2015 15:33:28 +0000 (16:33 +0100)]
ms-planner: Expose the plan start in json.

Without this the Start and End times cannot be interpreted.

This patch has been deployed on the Cambridge instance for testing
with no ill-effects.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoms-planner: Propagate a booking's Job to the plan
Ian Campbell [Wed, 1 Apr 2015 16:55:12 +0000 (17:55 +0100)]
ms-planner: Propagate a booking's Job to the plan

This needs to be done in several places:

- When booking resources (cmd: book-resources), to initially propagate
  from the booking (e.g. from ts-hosts-allocate-Executive's input).
- On reset (cmd: reset) so that the Events corresponding to actual
  allocations retain their Job.
- When retrieving the plan (cmd: get-plan), so it would be available
  for logging etc.

The Job is added by a following patch "ts-hosts-allocate-Executive:
Add the requesting Job to the booking".

This patch has been deployed on the Cambridge instance for testing
with no ill-effects.

cmd_reset does not include a ->Job for jobs which are "(preparing)",
corresponding to a job which is going to use a shared host which is
currently being installed by another job. I was unable to figure out a
way to include these.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoDisable proxy for all preseeded wget
Ian Campbell [Thu, 13 Aug 2015 15:43:47 +0000 (16:43 +0100)]
Disable proxy for all preseeded wget

At least in some contexts scripts can be run with http_proxy pointing
to the apt proxy (I noticed it in /usr/lib/base-installer.d/ hook used
for ucode installation).

Since all of these particular fetches are from a known to be local
webserver just disable proxying altogether.

With busybox wget in d-i this is done with the -Y argument.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoDebian: Create /boot/boot -> . symlink on ARM when PvMenuLst enabled
Ian Campbell [Thu, 13 Aug 2015 16:52:41 +0000 (17:52 +0100)]
Debian: Create /boot/boot -> . symlink on ARM when PvMenuLst enabled

This is under the same conditional as the nobootloader confirmation
one, since they effectively both stem from the lack of a boot loader
and the consequential use of the pv-grub-menu package.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoDebian: ARM has no bootloader (for Xen) even in Stretch.
Ian Campbell [Thu, 13 Aug 2015 16:52:40 +0000 (17:52 +0100)]
Debian: ARM has no bootloader (for Xen) even in Stretch.

Realistically this isn't going to change until we have either u-boot
or UEFI in an arm32 guest.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoDebian: ARM: only apply no bootloader workaround if xopts{PvMenuLst}
Ian Campbell [Thu, 13 Aug 2015 16:52:39 +0000 (17:52 +0100)]
Debian: ARM: only apply no bootloader workaround if xopts{PvMenuLst}

This workaround is only necessary because of how pv-grub-menu works,
so we should only apply both or neither of them.

This results in a long line and I'm about to add a second workaround
to this block, so switch to a regular if block instead of postfixing
on the one command. Move the comment inside that block in preparation
for other workarounds as well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-debian-di-install: Use the suite in the default hostname
Ian Campbell [Thu, 13 Aug 2015 16:52:38 +0000 (17:52 +0100)]
ts-debian-di-install: Use the suite in the default hostname

By appending ".$suite" if the suite is in the runvars.

This is more useful in standalone mode than having everything be
"debian".

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-debian-di-install: Install pv-grub-menu in ARM guests, always.
Ian Campbell [Thu, 13 Aug 2015 16:52:37 +0000 (17:52 +0100)]
ts-debian-di-install: Install pv-grub-menu in ARM guests, always.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-debian-di-install: Use exit/poweroff in preference to exit/always_halt
Ian Campbell [Thu, 13 Aug 2015 16:52:36 +0000 (17:52 +0100)]
ts-debian-di-install: Use exit/poweroff in preference to exit/always_halt

always_halt results in d-i calling "halt", which does not necessarily
poweroff the host (it seems to for x86/PV Xen guests, but does not for
ARM). Using exit/poweroff calls "poweroff" which is equivalent to
"halt -p", doing so results in ARM guests powering off as desired.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-logs-capture: Collect /var/log/xen/bootloader.*.log
Ian Campbell [Thu, 13 Aug 2015 16:52:35 +0000 (17:52 +0100)]
ts-logs-capture: Collect /var/log/xen/bootloader.*.log

This is the pygrub debug log.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agocs-bisection-step: Properly handle external job refs in template flight-61349 flight-61350 flight-61351 flight-61352 flight-61353 flight-61354 flight-61355 flight-61356 flight-61357 flight-61358 flight-61359 flight-61360 flight-61361 flight-61362 flight-61363 flight-61364 flight-61365 flight-61366 flight-61367 flight-61368 flight-61369 flight-61370 flight-61371 flight-61372 flight-61373 flight-61374 flight-61375 flight-61376 flight-61377 flight-61378 flight-61379 flight-61380 flight-61381 flight-61382 flight-61383 flight-61384 flight-61385 flight-61386 flight-61387 flight-61388 flight-61389 flight-61390 flight-61391 flight-61392 flight-61393 flight-61394 flight-61395 flight-61396 flight-61397 flight-61398 flight-61399 flight-61400 flight-61401 flight-61402 flight-61403 flight-61404 flight-61405 flight-61406 flight-61407 flight-61408 flight-61409 flight-61410 flight-61411 flight-61412 flight-61413 flight-61414 flight-61415 flight-61416 flight-61417 flight-61418 flight-61419 flight-61420 flight-61421 flight-61422 flight-61423 flight-61424 flight-61425 flight-61426 flight-61427 flight-61428 flight-61429 flight-61430 flight-61431 flight-61432 flight-61433 flight-61434 flight-61435 flight-61436 flight-61437 flight-61438 flight-61439 flight-61440 flight-61441 flight-61442 flight-61443 flight-61444 flight-61445 flight-61446 flight-61447 flight-61448 flight-61449 flight-61450 flight-61452 flight-61453 flight-61454 flight-61455 flight-61456 flight-61457 flight-61458 flight-61459 flight-61460 flight-61461 flight-61462 flight-61463 flight-61464 flight-61465 flight-61466 flight-61467 flight-61468 flight-61470 flight-61471 flight-61472 flight-61473 flight-61474 flight-61475 flight-61476 flight-61477 flight-61478 flight-61479 flight-61480 flight-61481 flight-61482 flight-61483 flight-61484 flight-61485 flight-61486 flight-61487 flight-61488 flight-61490 flight-61491 flight-61492 flight-61493 flight-61494 flight-61495 flight-61496 flight-61497 flight-61498 flight-61499 flight-61500 flight-61501 flight-61503 flight-61504 flight-61505 flight-61506 flight-61507 flight-61508 flight-61509 flight-61511 flight-61512 flight-61513 flight-61514 flight-61515 flight-61516 flight-61517 flight-61518 flight-61519 flight-61520 flight-61521 flight-61522 flight-61523 flight-61524 flight-61525 flight-61526 flight-61527 flight-61528 flight-61529 flight-61530 flight-61531 flight-61532 flight-61533 flight-61534 flight-61535 flight-61536 flight-61537 flight-61538 flight-61539 flight-61540 flight-61541 flight-61542 flight-61543 flight-61544 flight-61545 flight-61546 flight-61547 flight-61548 flight-61549 flight-61550 flight-61551 flight-61553 flight-61555 flight-61556 flight-61559 flight-61561 flight-61562 flight-61563 flight-61565 flight-61566 flight-61567 flight-61569 flight-61571 flight-61572 flight-61573 flight-61576 flight-61578 flight-61580 flight-61581 flight-61583 flight-61584 flight-61588 flight-61589 flight-61590 flight-61591 flight-61592 flight-61593 flight-61594 flight-61597 flight-61598 flight-61599 flight-61600 flight-61603 flight-61604 flight-61605 flight-61606 flight-61607 flight-61608 flight-61609 flight-61610 flight-61611 flight-61612 flight-61614 flight-61615 flight-61616 flight-61617 flight-61618 flight-61619 flight-61620 flight-61621 flight-61622 flight-61623 flight-61624 flight-61625 flight-61626 flight-61627 flight-61628 flight-61629 flight-61630 flight-61631 flight-61632 flight-61633 flight-61634 flight-61635 flight-61636 flight-61637 flight-61638 flight-61639 flight-61640 flight-61641 flight-61642 flight-61643 flight-61644 flight-61645 flight-61646 flight-61647 flight-61648 flight-61649 flight-61650 flight-61651 flight-61652 flight-61653 flight-61654 flight-61655 flight-61656 flight-61657 flight-61658 flight-61660 flight-61661 flight-61662 flight-61663 flight-61666 flight-61671 flight-61674 flight-61675 flight-61677 flight-61682 flight-61684 flight-61685 flight-61686 flight-61687 flight-61688 flight-61689 flight-61690 flight-61691 flight-61692 flight-61693 flight-61694 flight-61695 flight-61696 flight-61697 flight-61701 flight-61702 flight-61704 flight-61705
Ian Jackson [Fri, 4 Sep 2015 10:46:37 +0000 (11:46 +0100)]
cs-bisection-step: Properly handle external job refs in template

cs-bisection-step has had, for a long time, code which is supposed to
handle the situation where the template flight contains build job
references to other flights.

However:

 - The regexp to spot these other-flight job reference runvars would
   never match because it said \s where \S was probably intended (and
   . would be better);

 - If it were to match, the flight and job arguments to the recursive
   preparejob invocation were the wrong way round.  preparejob takes
   the job name first.

Fix these two bugs.  Now it does seem to work properly.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocs-bisection-step: Print our command line at the start
Ian Jackson [Fri, 4 Sep 2015 10:38:35 +0000 (11:38 +0100)]
cs-bisection-step: Print our command line at the start

The usual approach for debugging the cs-bisection-step is to repro the
problem (with --max-flight), which is most easily done by copying the
command line provided during a run which did the wrong thing.

Print the command line at startup, so that it appears in the report.
This will save us grobbling through the logs and cron mail.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoadhoc-revtuple-generator: Honour OSSTEST_AHRTG_SETX elsewhere
Ian Jackson [Fri, 4 Sep 2015 10:31:39 +0000 (11:31 +0100)]
adhoc-revtuple-generator: Honour OSSTEST_AHRTG_SETX elsewhere

Find all the places where adhoc-revtuple-generator runs subprograms
and have it add set -x (either by adding $OSSTEST_AHRTG_SETX to an
existing set -e, or using $setx which is either : or `set -x').

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoadhoc-revtuple-generator: Turn off a set -x
Ian Jackson [Fri, 4 Sep 2015 10:26:10 +0000 (11:26 +0100)]
adhoc-revtuple-generator: Turn off a set -x

This set -x uglified the output.  Provide a way (OSSTEST_AHRTG_SETX)
to turn it on again.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocr-daily-branch: Make sg-report-flight ignore bisections
Ian Jackson [Thu, 3 Sep 2015 10:39:37 +0000 (11:39 +0100)]
cr-daily-branch: Make sg-report-flight ignore bisections

sg-report-flight when testing X' (with a baseline of X) can justify a
failure of T(X',Y,Z) with a bisection failure of T(X,Y'',Z).

If Y'' breaks T then this makes it look to sg-report-flight like T was
already broken in X; cr-daily-branch could then push X' even though it
is actually broken.

This happened rarely, because cr-daily-branch's sg-report-flight would
only look at flights on the right branch, so only a bisection of T on
that branch can cause this, but nevertheless this can produce bad
pushes.

So: have cr-daily-branch pass a --blessings option to cr-daily-branch,
so that it only looks at (usually) `real' rather than the default of
`real' and also `real-bisect'.

An alternative, more complicated, approach would be for
sg-report-flight to compare versions of Y, Z, et al, when looking for
justifications, but I'm not sure this is desirable because it would
effectively reset the heisenbug compensator each time any other tree
changed.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agocr-daily-branch: Break out blessings_arg variable
Ian Jackson [Thu, 3 Sep 2015 10:37:27 +0000 (11:37 +0100)]
cr-daily-branch: Break out blessings_arg variable

And rewrap check_tested.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoOther-revision-jobs: Update cs-bisection-step flight-60965 flight-60967 flight-60968 flight-60969 flight-60970 flight-60971 flight-60973 flight-60974 flight-60975 flight-60976 flight-60977 flight-60979 flight-60980 flight-60981 flight-60982 flight-60983 flight-60984 flight-60985 flight-60986 flight-60987 flight-60988 flight-60989 flight-60990 flight-60991 flight-60992 flight-60993 flight-60995 flight-60996 flight-60997 flight-60998 flight-60999 flight-61000 flight-61001 flight-61002 flight-61003 flight-61004 flight-61005 flight-61006 flight-61008 flight-61009 flight-61010 flight-61011 flight-61056 flight-61057 flight-61058 flight-61059 flight-61060 flight-61062 flight-61063 flight-61079 flight-61080 flight-61081 flight-61082 flight-61083 flight-61086 flight-61088 flight-61090 flight-61093 flight-61094 flight-61096 flight-61098 flight-61101 flight-61103 flight-61104 flight-61118 flight-61119 flight-61122 flight-61125 flight-61126 flight-61127 flight-61128 flight-61129 flight-61132 flight-61134 flight-61136 flight-61137 flight-61138 flight-61139 flight-61140 flight-61243 flight-61244 flight-61245 flight-61246 flight-61247 flight-61248 flight-61249 flight-61253 flight-61254 flight-61256 flight-61257 flight-61258 flight-61259 flight-61260 flight-61262 flight-61263 flight-61264 flight-61266 flight-61268 flight-61272 flight-61273 flight-61274 flight-61277 flight-61278 flight-61279 flight-61280 flight-61281 flight-61282 flight-61283 flight-61287 flight-61288 flight-61289 flight-61290 flight-61291 flight-61292 flight-61294 flight-61295 flight-61296 flight-61297 flight-61298 flight-61299 flight-61300 flight-61301 flight-61302 flight-61303 flight-61304 flight-61305 flight-61306 flight-61307 flight-61308 flight-61309 flight-61311 flight-61312 flight-61313 flight-61314 flight-61315 flight-61316 flight-61317 flight-61318 flight-61319 flight-61321 flight-61322 flight-61323 flight-61324 flight-61325 flight-61326 flight-61327 flight-61329 flight-61340 flight-61342 flight-61344
Ian Jackson [Fri, 28 Aug 2015 11:28:26 +0000 (11:28 +0000)]
Other-revision-jobs: Update cs-bisection-step

This is rather more subtle.  We want to be able to bisect over all the
relevant inputs.

What we actually want to do if one of the *prev* tests fail is to
treat the "previous Xen branch" as a separate "tree" when bisecting,
so each revision tuple has both "current" and "old" Xen versions.
That way if the stable-4.x branch has broken forward migration, we
will report it properly.

Indeed, this needs to be extended not just to the Xen revision, but
all the inputs to the *prev* build.

We achieve this with new concept `other-revision job suffix',
introduced in the previous patch.  The bisector now works internally
always with tree names which are `<tree>[ <suffix>]' (delimited by a
space).  (Henceforth, we'll call `[ <suffix>]' the `othrev'.)

That is, all the revisions specified in prev build jobs are treated as
revisions of different trees to the revisions of apparently-same trees
in non-prev jobs.

The specific changes needed to cs-bisection-step are very small.  We
only need to adjust the code which reads and writes the database:

* When we do the cross join on urls and revisions which generates the
  rev tuple for a particular flight, also have the database compute
  the othrev for each tree.  Then, print the othrev in the debug
  output, and append it to the tree name.

  That resulting name is used everywhere:

  It affects `mixed revision' detection, so we consider build-*-prev
  jobs with differing revisions to problematic, or main-revision build
  jobs with differing revisions, but we treat each category of build
  job separately so the fact that the prev and main build jobs have
  different revisions is fine.

  The name is used for the key that is returned from flight_rmap.
  Thence it is used for the Name in @treeinfos, and therefore the
  results from flight_rtuple will be terms of this decorated tree
  namespace.

* When we are preparing a new job to go, we need to (effectively) undo
  this transformation.  The query which finds the `tree_' variables
  for a particular tree name is arranged to take an additional
  parameter, which is the othrev.  If the othrev does not match the
  job, the name is not returned in the results.

  Actually, because both the job and the othrev are query parameters,
  what happens is either that they match (ie, the othrev in the tree
  name from @treeinfos is indeed the othrev for the job we are
  constructing) in which case we process the variable as before; or
  they don't match, in which case the query contains contradictory
  conditions in its AND clauses, and returns no rows.

  So the ultimate effect is that we process each Name from @treeinfos
  only if it is for the this kind of job.  This slightly convoluted
  implementation arises from the fact that the job-to-othrev mapping
  is implemented as SQL, so we need to ask the database.

There is no need to change any of the output processing and reporting,
because "<tree> prev" is a perfectly good thing to print in all the
relevant contexts.

And there is no need to change how we drive adhoc-revtuple-generator,
because we do not pass it tree names at all, only urls.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agoOther-revision-jobs: Provide other_revision_job_suffix
Ian Jackson [Fri, 28 Aug 2015 14:17:09 +0000 (15:17 +0100)]
Other-revision-jobs: Provide other_revision_job_suffix

This is a string, a function of the job name, that identifies the
class of `other revisions'.  It is empty for main-revision jobs
and currently there is only `<delimiter>prev' for build-*-prev.

We are going to use this in the bisector.

Reimplement main_revision_job_cond in terms of this.  No functional
change, except that the SQL optimiser may have more work to do.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agoOther-revision-jobs: Update sg-report-flight and -job-history
Ian Jackson [Fri, 28 Aug 2015 11:44:22 +0000 (11:44 +0000)]
Other-revision-jobs: Update sg-report-flight and -job-history

We need adjust only the regression analysis.

The other occurrences of special treatment for revision fields are for
reporting output, and are in the context of a specific job.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoOther-revision-jobs: Update sg-check-tested
Ian Jackson [Fri, 28 Aug 2015 11:43:32 +0000 (11:43 +0000)]
Other-revision-jobs: Update sg-check-tested

These changes are obvious.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoOther-revision-jobs: Update report__find_test
Ian Jackson [Fri, 28 Aug 2015 11:27:28 +0000 (11:27 +0000)]
Other-revision-jobs: Update report__find_test

This is straightforward.  We simply don't look at the revision runvars
in non-main-revision jobs, when searching for suitable flights.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoOther-revision-jobs: Provide central test
Ian Jackson [Fri, 28 Aug 2015 11:16:40 +0000 (11:16 +0000)]
Other-revision-jobs: Provide central test

Since 75fbbc19 "Arrange to test migration from the previous Xen
version", some flights have contained additional jobs build-*-prev,
which build a different revision of xen.git.

However, this violates an existing assumption in several of the
automatic archaeologists, namely that a flight should contain only
runvars referring to a single revision of a tree.

We will need to adjust all the places where this assumption is baked
in.  The question arises, as to how the code in general is supposed to
know.  There are many possible schemes, but almost all of them would
involve some kind of schema change and/or would be violated by
now-recorded history.

For now we adopt the following rule: the job name tells you.  That is,
revision runvars in jobs with certain job names are disregarded.  We
call non-disregarded jobs `main-revision jobs', since they use the
`main' revisions of everything, and others `other-revision jobs'.

We provide a single function in Osstest.pm which takes as argument a
SQL expression string representing a job name, and returns a SQL
expression string evaluating to a boolean, specifying whether the job
is a main revision job.  This can be used in queries.

In subsequent patches I will go through all plausibly-relevant output
from
  git-grep 'revision_\|revision\\\\_'
and update each piece in turn.

There are obviously-irrelevant hits in TestSupport (build_clone and
store_vcs_revision) and in BuildSupport.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-xen-install: Install netcat-openbsd flight-60691 flight-60719 flight-60783 flight-60785 flight-60786 flight-60787 flight-60788 flight-60789 flight-60790 flight-60791 flight-60792 flight-60793 flight-60794 flight-60795 flight-60796 flight-60797 flight-60798 flight-60799 flight-60800 flight-60801 flight-60802 flight-60803 flight-60804 flight-60805 flight-60806 flight-60807 flight-60808 flight-60809 flight-60810 flight-60811 flight-60812 flight-60813 flight-60814 flight-60815 flight-60817 flight-60818 flight-60819 flight-60820 flight-60821 flight-60822 flight-60823 flight-60824 flight-60825 flight-60826 flight-60827 flight-60828 flight-60829 flight-60831 flight-60832 flight-60833 flight-60834 flight-60835 flight-60836 flight-60837 flight-60838 flight-60839 flight-60840 flight-60841 flight-60842 flight-60843 flight-60844 flight-60845 flight-60846 flight-60847 flight-60848 flight-60850 flight-60851 flight-60852 flight-60853 flight-60854 flight-60855 flight-60856 flight-60857 flight-60858 flight-60859 flight-60860 flight-60861 flight-60862 flight-60863 flight-60864 flight-60865 flight-60866 flight-60867 flight-60868 flight-60869 flight-60870 flight-60871 flight-60872 flight-60873 flight-60875 flight-60876 flight-60877 flight-60878 flight-60879 flight-60880 flight-60882 flight-60883 flight-60884 flight-60885 flight-60886 flight-60887 flight-60888 flight-60889 flight-60890 flight-60891 flight-60892 flight-60893 flight-60894 flight-60895 flight-60896 flight-60897 flight-60898 flight-60899 flight-60900 flight-60901 flight-60902 flight-60903 flight-60904 flight-60905 flight-60906 flight-60907 flight-60908 flight-60909 flight-60910 flight-60911 flight-60942 flight-60946 flight-60947 flight-60948 flight-60949 flight-60950 flight-60951 flight-60952 flight-60953 flight-60954 flight-60955 flight-60956 flight-60957 flight-60958 flight-60959 flight-60960 flight-60961 flight-60963 flight-60964
Ian Campbell [Wed, 12 Aug 2015 16:09:11 +0000 (17:09 +0100)]
ts-xen-install: Install netcat-openbsd

This is required by libvirt for live migration (netcat-traditional
doesn't cut it).

netcat-openbsd has higher update-alternatives priority, so it will be
used if installed.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agoToolstack/libvirt: use URI in migration command flight-60671
Wei Liu [Tue, 11 Aug 2015 20:25:09 +0000 (21:25 +0100)]
Toolstack/libvirt: use URI in migration command

Virsh migrate expects an URI, not a host. We don't actually care what
kind of transport it uses, the main objective is to test migration, so
use xen+ssh for the time being.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- added --live and factored out $duri ]

9 years agoArrange to test migration from the previous Xen version
Ian Campbell [Tue, 11 Aug 2015 16:25:10 +0000 (17:25 +0100)]
Arrange to test migration from the previous Xen version

There are several steps to this:

- Identify $prevxenbranch, that is the branch which precedes
  $xenbranch.
- Create appropriate build jobs.
- Add support in ts-xen-install for overriding {xen,}buildjob on a
  per-ident basis
- Add a new receipt test-pair-oneway which only migrates from
  src_host to dst_host and not the reverse
- Create appropriate test jobs, overridding the default builds for
  src_host.

Currently we only do this for xen* branches and using xl, but in the
future we may wish to add to the libvirt branch too.

In make-flight if REVISION_PREVXEN is not supplied (e.g. called from
standalone-reset or by hand etc) then we create the build-$arch-prev jobs
with no revision_xen, same as build-$arch

It would be nice to try and reuse the builds from the last flight
which tested the $prevxenbranch baseline. I've not dont that here.

+build-amd64-prev                                      arch                        amd64
+build-amd64-prev                                      build_lvextend_max          50
+build-amd64-prev                                      enable_ovmf                 true
+build-amd64-prev                                      enable_xend                 false
+build-amd64-prev                                      enable_xsm                  false
+build-amd64-prev                                      host_hostflags              share-build-wheezy-amd64,arch-amd64,suite-wheezy,purpose-build
+build-amd64-prev                                      revision_ovmf
+build-amd64-prev                                      revision_qemu
+build-amd64-prev                                      revision_qemuu              c4a962ec0c61aa9b860a3635c8424472e6c2cc2c
+build-amd64-prev                                      revision_seabios
+build-amd64-prev                                      revision_xen                666b80f239c566283cb1b3435180d99a329d0156
+build-amd64-prev                                      tree_ovmf
+build-amd64-prev                                      tree_qemu                   git://xenbits.xen.org/staging/qemu-xen-unstable.git
+build-amd64-prev                                      tree_qemuu                  git://xenbits.xen.org/staging/qemu-upstream-unstable.git
+build-amd64-prev                                      tree_seabios
+build-amd64-prev                                      tree_xen                    git://xenbits.xen.org/xen.git

+build-i386-prev                                       arch                        i386
+build-i386-prev                                       build_lvextend_max          50
+build-i386-prev                                       enable_ovmf                 true
+build-i386-prev                                       enable_xend                 false
+build-i386-prev                                       enable_xsm                  false
+build-i386-prev                                       host_hostflags              share-build-wheezy-i386,arch-i386,suite-wheezy,purpose-build
+build-i386-prev                                       revision_ovmf
+build-i386-prev                                       revision_qemu
+build-i386-prev                                       revision_qemuu              c4a962ec0c61aa9b860a3635c8424472e6c2cc2c
+build-i386-prev                                       revision_seabios
+build-i386-prev                                       revision_xen                666b80f239c566283cb1b3435180d99a329d0156
+build-i386-prev                                       tree_ovmf
+build-i386-prev                                       tree_qemu                   git://xenbits.xen.org/staging/qemu-xen-unstable.git
+build-i386-prev                                       tree_qemuu                  git://xenbits.xen.org/staging/qemu-upstream-unstable.git
+build-i386-prev                                       tree_seabios
+build-i386-prev                                       tree_xen                    git://xenbits.xen.org/xen.git

+test-amd64-amd64-upgrade                              all_hostflags               arch-amd64,arch-xen-amd64,suite-wheezy,purpose-test,equiv-1
+test-amd64-amd64-upgrade                              arch                        amd64
+test-amd64-amd64-upgrade                              buildjob                    build-amd64
+test-amd64-amd64-upgrade                              debian_arch                 amd64
+test-amd64-amd64-upgrade                              debian_kernkind             pvops
+test-amd64-amd64-upgrade                              kernbuildjob                build-amd64-pvops
+test-amd64-amd64-upgrade                              kernkind                    pvops
+test-amd64-amd64-upgrade                              src_host_buildjob           build-amd64-prev
+test-amd64-amd64-upgrade                              src_host_xenbuildjob        build-amd64-prev
+test-amd64-amd64-upgrade                              toolstack                   xl
+test-amd64-amd64-upgrade                              xenbuildjob                 build-amd64

+test-amd64-i386-upgrade                               all_hostflags               arch-i386,arch-xen-amd64,suite-wheezy,purpose-test,equiv-1
+test-amd64-i386-upgrade                               arch                        i386
+test-amd64-i386-upgrade                               buildjob                    build-i386
+test-amd64-i386-upgrade                               debian_arch                 i386
+test-amd64-i386-upgrade                               debian_kernkind             pvops
+test-amd64-i386-upgrade                               kernbuildjob                build-i386-pvops
+test-amd64-i386-upgrade                               kernkind                    pvops
+test-amd64-i386-upgrade                               src_host_buildjob           build-i386-prev
+test-amd64-i386-upgrade                               src_host_xenbuildjob        build-amd64-prev
+test-amd64-i386-upgrade                               toolstack                   xl
+test-amd64-i386-upgrade                               xenbuildjob                 build-amd64

NB the regular build jobs are, as expected, unchanged (and different to the
ones above):

 build-amd64                                           revision_xen                9256f66c1606cd9339412bff7fbc7bd9e8beb28c
 build-i386                                            revision_xen                9256f66c1606cd9339412bff7fbc7bd9e8beb28c

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agolibvirt: Pass correct arguments to virsh migrate flight-60608 flight-60627 flight-60640 flight-60649 flight-60662 flight-60663 flight-60664 flight-60665 flight-60666 flight-60667 flight-60668 flight-60669 flight-60670 flight-60672 flight-60673 flight-60674 flight-60675 flight-60676 flight-60677 flight-60678 flight-60679 flight-60680 flight-60681 flight-60682 flight-60683 flight-60684 flight-60685 flight-60686 flight-60687 flight-60688 flight-60689 flight-60690 flight-60692 flight-60693 flight-60694 flight-60695 flight-60696 flight-60697 flight-60698 flight-60699 flight-60700 flight-60701 flight-60702 flight-60703 flight-60704 flight-60705 flight-60706 flight-60707 flight-60708 flight-60709 flight-60710 flight-60711 flight-60712 flight-60713 flight-60714 flight-60715 flight-60716 flight-60717 flight-60718 flight-60720 flight-60721 flight-60722 flight-60723 flight-60724 flight-60725 flight-60726 flight-60727 flight-60728 flight-60729 flight-60730 flight-60731 flight-60732 flight-60733 flight-60734 flight-60735 flight-60736 flight-60737 flight-60738 flight-60739 flight-60740 flight-60741 flight-60742 flight-60743 flight-60744 flight-60745 flight-60746 flight-60747 flight-60748 flight-60749 flight-60750 flight-60751 flight-60752 flight-60753 flight-60754 flight-60755 flight-60756 flight-60757 flight-60758 flight-60759 flight-60760 flight-60761 flight-60762 flight-60763 flight-60764 flight-60765 flight-60766 flight-60767 flight-60768 flight-60769 flight-60770 flight-60771 flight-60772 flight-60773 flight-60774 flight-60775 flight-60776 flight-60777 flight-60778 flight-60779 flight-60780 flight-60781 flight-60782
Ian Campbell [Wed, 5 Aug 2015 12:48:27 +0000 (13:48 +0100)]
libvirt: Pass correct arguments to virsh migrate

$dst is a host hash/object, resulting in:

2015-08-04 22:35:25 Z executing ssh ... root@172.16.144.34 virsh
migrate debian.guest.osstest HASH(0x28f4310)
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `virsh migrate debian.guest.osstest HASH(0x28f4310)'

Switch to using the same pattern as xl.pm, which is to call the
argument (containing the host hash) $dho and for $dst to be a local
variable containing $dho->{Name}.

Also s/$ho/$sho/ to match xl.pm, since I think that is clearer about
what role everything has.

Fix the prototype too while editing this function.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agots-debian-hvm-install: Use xargs -0 to avoid massive filelist in logs.
Ian Campbell [Mon, 27 Jul 2015 12:51:27 +0000 (13:51 +0100)]
ts-debian-hvm-install: Use xargs -0 to avoid massive filelist in logs.

The current arrangement is a bit odd, I'm not sure why it would be
that way and it results in a huge list of files in the middle of the
log which is rather boring to scroll through.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agots-debian-hvm-install: use di_installcmdline_core
Ian Campbell [Mon, 27 Jul 2015 12:51:26 +0000 (13:51 +0100)]
ts-debian-hvm-install: use di_installcmdline_core

This is primarily to get DEBIAN_FRONTEND=text, for easier to read
logging.

Previously the command line consisted of the console and
preseed/file=/preseed.cfg. After this it is more complex.

The preseed file uses file= which is an alias for preseed/file. Extra
options are given including DEBIAN_FRONTEND and DEBCONF_DEBUG and the
following are preseeded via the command line:

Previous implied were "auto=true preseed" which are now explicit.

In addition the following harmless (in this context) options are
added:
    hw-detect/load_firmware=
    hostname=
    netcfg/dhcp_timeout=
    netcfg/choose_interface=

The caller could also cause debconf/priority to be set, but doesn't
here.

ts-debian-di-install in the distro test series also uses
di_installcmdline_core for guest uses.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>