]> xenbits.xensource.com Git - people/iwj/osstest.git/log
people/iwj/osstest.git
8 years agoDO NOT APPLY provide ts-substep-test wip.prep-xtf-v2pre
Ian Jackson [Thu, 21 Jul 2016 15:57:16 +0000 (16:57 +0100)]
DO NOT APPLY provide ts-substep-test

8 years agoDO NOT APPLY make-flight-substep-test
Ian Jackson [Thu, 7 Jul 2016 18:40:44 +0000 (19:40 +0100)]
DO NOT APPLY make-flight-substep-test

This is a simple test case for substeps.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agoExecutive: Support substeps
Ian Jackson [Thu, 7 Jul 2016 18:35:12 +0000 (19:35 +0100)]
Executive: Support substeps

ts-* scripts can now create `substeps'.  For the purposes of
archaeology etc., a substep is just like a step.  But it does
correspond to a single specific ts-* invocation.

Instead, it is started and finished explicitly as required.

The whole job implementation code needs to explicitly assign a unique
stable testid to each substep.

The `script' parameter is stored in the `step' field in the database,
which is used only for reporting.  These do not need to be unique.

All substeps started are should also be finished, by the end of the
job.  If this is not done, the job will be regarded as broken (if it
is not already failed or aborted).  (But a substep might be finished
by a different ts-* script to the one that started it.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
v2: Permit setting the step status to `skip' too, now that this
    patch is rebased onto the step status skip support.

8 years agoDO NOT APPLY make-flight-diverse-test: test case for diverse-CLASS hostflag
Ian Jackson [Wed, 6 Jul 2016 15:10:11 +0000 (16:10 +0100)]
DO NOT APPLY make-flight-diverse-test: test case for diverse-CLASS hostflag

This generates a flight with two jobs, test-1 and test-2.  They can be
run, and are supposed to allocate different hosts, and will bomb out
after host allocation.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agots-hosts-allocate-Executive: Support diverse-CLASS hostflag
Ian Jackson [Wed, 6 Jul 2016 14:22:21 +0000 (15:22 +0100)]
ts-hosts-allocate-Executive: Support diverse-CLASS hostflag

Specifically:
 * Parse it out of the hostflags when constructing the hid
 * Look for the `hostalloc-diverse-FLIGHT-CLASS' ClientNote in
   the resource plan, to avoid inappropriately planning to reuse hosts.
 * Look for the `diversehosts_CLASS' runvar in other jobs in this flight,
   to find out who might have allocated with the same CLASS.  (This
   sort of duplicates information in *hostflags and *host, but digging
   the information out of the latter two would be very tiresome.)
 * Check each of the above for each candidate host.
 * Set the ClientNote when we are preparing a booking.
 * Set the runvar when we do the allocation.
 * Document the ClientNote.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agots-hosts-allocate-Executive: pass $plan to hid_find_possibilities
Ian Jackson [Wed, 6 Jul 2016 14:10:33 +0000 (15:10 +0100)]
ts-hosts-allocate-Executive: pass $plan to hid_find_possibilities

We are going to want this to implement the new diverse-CLASS hostflag.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agostep status skip: Implement in sg-report-flight
Ian Jackson [Fri, 8 Jul 2016 19:02:39 +0000 (20:02 +0100)]
step status skip: Implement in sg-report-flight

* When we are doing archaeology, searching for flight(s) which ran a
  particular testid, ignore all flights where the testid was skipped.

* In a flight we are examining for failures we need to justify, do not
  regard `skip' as a failure which requires investigation.  We
  thusg treat `skip' in such a flight very like `pass'.

* Assign a colour (dark grey, almost like the background) and display
  priority (very low) to `skip', so that they turn up nicely in the
  HTML grids.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agostep status skip: Ignore in report_run_getinfo
Ian Jackson [Fri, 8 Jul 2016 18:57:53 +0000 (19:57 +0100)]
step status skip: Ignore in report_run_getinfo

report_run_getinfo is trying to generate some HTML to describe a job's
(current) status.  It sometimes looks at the steps to find
`interesting' information to report.

Completely ignore steps with status `skip' for this purpose, just like
we ignore ones with status `pass'.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agostep status skip: Ignore in cs-bisection-step
Ian Jackson [Fri, 8 Jul 2016 18:56:05 +0000 (19:56 +0100)]
step status skip: Ignore in cs-bisection-step

cs-bisection step wants to completely ignore all skipped steps.  So we
adjust the one query which doesn't already insist on particular status
values, to filter out `skip'.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agosg-run-job: Add emacs mode comment
Ian Jackson [Thu, 7 Jul 2016 18:40:31 +0000 (19:40 +0100)]
sg-run-job: Add emacs mode comment

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agots-hosts-allocate-Executive: Replace some odd commas with semicolons
Ian Jackson [Wed, 6 Jul 2016 14:09:27 +0000 (15:09 +0100)]
ts-hosts-allocate-Executive: Replace some odd commas with semicolons

There does not seem to be any reason for this.  I think it must be a
leftover from a previous use of { A => X, B => Y, ... } syntax.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agoExecutive: Previous duration estimator: use overall time, not sum of steps
Ian Jackson [Fri, 8 Jul 2016 18:30:58 +0000 (19:30 +0100)]
Executive: Previous duration estimator: use overall time, not sum of steps

Some jobs runs steps in parallel.  Do not add up all the insividual
step durations.  Instead, calculate the duration as the time between
first step start and last step finish.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoMerge database locking and bisection scheduling branches for push
Ian Jackson [Mon, 18 Jul 2016 14:24:38 +0000 (15:24 +0100)]
Merge database locking and bisection scheduling branches for push

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agosg-run-job: Abolish reap_details($fh) array
Ian Jackson [Fri, 15 Jul 2016 15:42:46 +0000 (16:42 +0100)]
sg-run-job: Abolish reap_details($fh) array

We can carry the information in $reap easily enough.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoBisection truncation: Stop a bisection job after the step of interest
Ian Jackson [Fri, 15 Jul 2016 14:59:30 +0000 (15:59 +0100)]
Bisection truncation: Stop a bisection job after the step of interest

Set the `truncate_testid' runvar when we create a bisection flight.

Thus, the bisection will stop when it has collected the data point we
wanted.  This is especially useful if the failing step is early in a
long job: passes do not have to wait for the whole rest of the job to
run.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoBisection truncation: Rename $addhost subref to $addvar
Ian Jackson [Fri, 15 Jul 2016 14:58:25 +0000 (15:58 +0100)]
Bisection truncation: Rename $addhost subref to $addvar

We are going to use this to add something thing other than a host
runvar.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoJob truncation: Honour runvar `truncate_testid'
Ian Jackson [Fri, 15 Jul 2016 14:54:17 +0000 (15:54 +0100)]
Job truncation: Honour runvar `truncate_testid'

Nothing sets this yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl/JobDB: Provide jobdb::read-runvar
Ian Jackson [Fri, 15 Jul 2016 14:53:38 +0000 (15:53 +0100)]
tcl/JobDB: Provide jobdb::read-runvar

Provide this in both variants.  No caller yet so no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agots-hosts-allocate-Executive: Fix typo `nosts' in a log message
Ian Jackson [Fri, 15 Jul 2016 14:50:29 +0000 (15:50 +0100)]
ts-hosts-allocate-Executive: Fix typo `nosts' in a log message

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoJob truncation: sg-run-job: Pass testid to reap-ts
Ian Jackson [Fri, 15 Jul 2016 14:33:58 +0000 (15:33 +0100)]
Job truncation: sg-run-job: Pass testid to reap-ts

It's going to want this in a moment.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoJob truncation: sg-run-job support truncation by setting global `truncate'
Ian Jackson [Fri, 15 Jul 2016 14:30:56 +0000 (15:30 +0100)]
Job truncation: sg-run-job support truncation by setting global `truncate'

Arrange for a global variable `truncate' to be honoured.  It is
initialised to 0.  If it becomes 1 then:
 * spawn-ts does not spawn jobs any more (reap-ts reaps these non-jobs
   immediately), unless they are marked with ! in their iffail
 * per-host-ts does not try to spawn anything any more, likewise
   (strictly, we could leave checking truncate to spawn-ts, but this
   way is clearer).
 * These not-spawned jobs count as successful when reaped, unlike
   jobs not spawned due to the presence of `abort'.
 * At the end of the job, if things otherwise went OK, we set the
   status to `truncated' rather than `pass'.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agosg-run-job: Change spawn-ts internal representation of reap handles
Ian Jackson [Fri, 15 Jul 2016 15:27:50 +0000 (16:27 +0100)]
sg-run-job: Change spawn-ts internal representation of reap handles

Previously, spawn-ts would pass reap-ts (via its caller) either a
filehandle, or an empty string meaning `when this is reaped, count it
as failed'.

We are going to want to represent `when this is reaped, count it as
successful', too.  So change the representation to a variadic list,
with an enum type field at the front.

NB: oddly, reap-ts returns 1 for success.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agosg-run-job: Break out iffail-check
Ian Jackson [Fri, 15 Jul 2016 14:20:00 +0000 (15:20 +0100)]
sg-run-job: Break out iffail-check

Both spawn-ts and per-host-ts do some processing of `iffail' values:
 * Strip any leading !, which means "run this even if the job
   is being stopped due to error";
 * Turn `.' into `fail'.

The first of these is currently only done by per-host-ts, which checks
ok.  We are going to want to do something more sophisticated when
truncating flights.  So we introduce a new helper.

For now spawn-ts passes 1 for okexpr so its iffail-check always
returns 1 so it doesn't check the return value.

No functional change yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoJob truncation: Tolerate `truncated' job status
Ian Jackson [Fri, 15 Jul 2016 14:08:20 +0000 (15:08 +0100)]
Job truncation: Tolerate `truncated' job status

We are going to introduce a new `truncated' job status, which means
that the job went OK until sg-run-job decided not to continue with it
because it had done all that was requested.

(This will be used for bisection, to stop a bisection job after the
step of interest.)

Its properties are:

 * In summary HTML `truncated' shows up as a green job status, like `pass'.

 * The duration estimator _does_ look at truncated jobs.  (Note that
   it only looks on the specific branch, so only when organising a
   bisection will it look at bisections.)

 * Consequently the host allocator for bisections will expect the
   duration to be that of the last flight where this job passed,
   failed or was truncated, which is correct.

 * When the host allocator is choosing a host for non-bisections it
   won't consider these truncated jobs because they ought not to
   appear in main branch flights.  If they do they count more as
   fails than (that is, they do make the job sticky).

 * sg-execute-flight expects that sg-run-job might set the job
   status to `truncated' and then exit with status 0.

 * sg-report-flight does not look for an interesting failing step
   when the job is truncated (ie for this purpose it's like pass).

 * sg-report-flight doesn't consider truncated jobs to indicate
   trouble, and handles truncated properly in Subject line generation.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoBisection: Stick to same job and testid where possible
Ian Jackson [Fri, 15 Jul 2016 09:55:58 +0000 (10:55 +0100)]
Bisection: Stick to same job and testid where possible

Otherwise when there is a big problem we can have a tendency to flap
between different jobs, wasting a lot of time.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agocr-try-bisect: Remove obsolete sticky_branch machinery
Ian Jackson [Fri, 15 Jul 2016 09:50:33 +0000 (10:50 +0100)]
cr-try-bisect: Remove obsolete sticky_branch machinery

Once upon a time we tried to run one bisector for all the branches.
But that doesn't work because they would overwrite each others' mros,
making the bisector flap as main flights finish.

If sharing a bisector working tree is desirable, something more
complex will be needed.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoBisection: Do not try to inhibit queue
Ian Jackson [Thu, 14 Jul 2016 15:40:00 +0000 (16:40 +0100)]
Bisection: Do not try to inhibit queue

In an effort to try to increase the chance that the next bisection
step will get the same host quickly, the cri-bisect uses
mg-queue-inhibit to inhibit all resource allocation for 5 minutes.

With the increasing size of the test facility and the increasing
number of bisector instances running, this is starting to become a
very crude hammer indeed.

And this is largely ineffective anyway as we try bisections every 15
minutes but only inhibit for 5 minutes.

Disable it, until we have a better answer.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agocr-try-bisect: Use WAITSTART of when we started bisecting this testid
Ian Jackson [Thu, 14 Jul 2016 15:26:30 +0000 (16:26 +0100)]
cr-try-bisect: Use WAITSTART of when we started bisecting this testid

Otherwise bisection jobs get queued up very late.

The intent is that once we have a regression, we /start/ bisecting it
roughly FCFS along with other flights, but then it gets priority until
the bisection is done.

Then next bisection in the same branch will have to wait again, to
start.

We implement this by keeping a stamp file, whose timestamp shows when
we started bisecting this testid and this step.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agosg-execute-flight: Fix an error message
Ian Jackson [Fri, 15 Jul 2016 19:23:06 +0000 (20:23 +0100)]
sg-execute-flight: Fix an error message

When pid is undefined, meaning we didn't find gotpid, print gotpid,
not pid.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoMerge ms-flights-summary fix
Ian Jackson [Fri, 15 Jul 2016 19:08:41 +0000 (20:08 +0100)]
Merge ms-flights-summary fix

8 years agoms-flights-summary: Treat preparing jobs outside the plan as `queued'
Ian Jackson [Fri, 15 Jul 2016 18:59:22 +0000 (18:59 +0000)]
ms-flights-summary: Treat preparing jobs outside the plan as `queued'

These jobs are still to run but we have no time estimate for them.

So do not add them to UnqueuedJobs; they then contribute to making the
`End of phase/flight' indication *not* bold when there are such jobs.

And bolden their figure in the table.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agoms-flights-summary: Invent a `prep.alloc.' pseudo job state
Ian Jackson [Fri, 15 Jul 2016 18:55:11 +0000 (18:55 +0000)]
ms-flights-summary: Invent a `prep.alloc.' pseudo job state

This allows us to separate out `preparing' jobs into ones which are in
our data plan and ones which are not.  The ones which are not may not
have quite started to run ts-hosts-allocate, or may still be in the
planning queue and not made it into the projection.

In either case we don't have an estimated finish time for them.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agoms-flights-summary: Do gather_stats without GROUP BY
Ian Jackson [Fri, 15 Jul 2016 18:49:51 +0000 (18:49 +0000)]
ms-flights-summary: Do gather_stats without GROUP BY

We are going to want to look at each job's Reso separately.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agoms-flights-summary: Do gather_stats on jobs a bit later
Ian Jackson [Fri, 15 Jul 2016 18:44:41 +0000 (18:44 +0000)]
ms-flights-summary: Do gather_stats on jobs a bit later

We are going to want to invent a fake status for `preparing' jobs
which have no allocation, separate from ones which do have an
allocation.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agotcl daemons: Use with-db
Ian Jackson [Thu, 7 Jul 2016 12:59:40 +0000 (13:59 +0100)]
tcl daemons: Use with-db

Fixes a number of latent bugs where the jobdb refcount might get out
of step.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: Provide with-db
Ian Jackson [Thu, 7 Jul 2016 12:54:39 +0000 (13:54 +0100)]
tcl daemons: Provide with-db

This makes it easier to get the matching of db-open and db-close right.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl-daemons: ms-ownerdaemon: Use autoreconnect
Ian Jackson [Fri, 1 Jul 2016 11:33:02 +0000 (12:33 +0100)]
tcl-daemons: ms-ownerdaemon: Use autoreconnect

When creating a job, we ask jobdb::transaction to retry on failure.
This makes the error handling more effective.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: transaction: Support db autoreconnect
Ian Jackson [Fri, 1 Jul 2016 11:28:18 +0000 (12:28 +0100)]
tcl daemons: transaction: Support db autoreconnect

Provide an `autoreconnect' argument which will automatically reconnect
to the db if the connection has been lost.  It will make only one
reconnection attempt.

No functional change yet because no call sites have been changed.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: transaction: Only try ROLLBACK when necessary
Ian Jackson [Fri, 1 Jul 2016 11:23:12 +0000 (12:23 +0100)]
tcl daemons: transaction: Only try ROLLBACK when necessary

In the deadlock case, we need to ROLLBACK.  In other error cases we
are going to close the connection.  And in those other cases the
ROLLBACK might fail, causing our error recovery to go wrong.

So do ROLLBACK only on the single path where we might continue to use
the connection.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: if error occurs, ensure db is closed afterwards
Ian Jackson [Fri, 1 Jul 2016 11:19:59 +0000 (12:19 +0100)]
tcl daemons: if error occurs, ensure db is closed afterwards

When an error occurs which we are not handling, we want to
unconditionally close the db connection.  The next transaction will
reopen it.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: transaction: Properly match db-open and db-close
Ian Jackson [Thu, 7 Jul 2016 12:46:38 +0000 (13:46 +0100)]
tcl daemons: transaction: Properly match db-open and db-close

* Do the db-open inside the catch, so that if it fails we do the
  rest of the error handling.

* Do the db-close before deconstructing the error, so that we
  necessarily get the db-open reference count right.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: Recognise `SSL SYSCALL' errors with their own errorCode
Ian Jackson [Thu, 7 Jul 2016 16:47:02 +0000 (17:47 +0100)]
tcl daemons: Recognise `SSL SYSCALL' errors with their own errorCode

This has no real effect right now but will be useful in a moment.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: More info in db--exec-check error
Ian Jackson [Thu, 7 Jul 2016 16:07:41 +0000 (17:07 +0100)]
tcl daemons: More info in db--exec-check error

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v3: Fix to include $emsg at start of errorInfo

8 years agotcl daemons: make db-reopen actually work
Ian Jackson [Thu, 7 Jul 2016 12:16:46 +0000 (13:16 +0100)]
tcl daemons: make db-reopen actually work

Even if the refcount is >0, we want to actually reconnect.
Also, log something if the close fails.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: db-ensure-open, -close: Make idempotent
Ian Jackson [Thu, 7 Jul 2016 12:25:48 +0000 (13:25 +0100)]
tcl daemons: db-ensure-open, -close: Make idempotent

Track whether we think the connection is open in dbopen.

It is now therefore OK to call db-ensure-open and db-ensure-closed in
other contexts.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: Break out db-ensure-open and db-ensure-closed
Ian Jackson [Thu, 7 Jul 2016 12:14:26 +0000 (13:14 +0100)]
tcl daemons: Break out db-ensure-open and db-ensure-closed

To be able to deliberately reconnect to the database, in case of
error, we need functions which actually work with dbh, rather than
simply the refcount.

No functional change as yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: Remove obsolete `global g'
Ian Jackson [Thu, 7 Jul 2016 12:12:01 +0000 (13:12 +0100)]
tcl daemons: Remove obsolete `global g'

The global g was removed in 2012 in beb4240a346e "wip reorg,
testing..." but this instance seems to have escaped.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: jobdb::transaction: Improve two message generation sites
Ian Jackson [Fri, 1 Jul 2016 11:17:37 +0000 (12:17 +0100)]
tcl daemons: jobdb::transaction: Improve two message generation sites

* Use logputs rather than puts to report transaction deadlock retry

* Use $ei and $ec rather than $errorInfo and $errorCode when calling
  error due to too many deadlock retries.  This has no functional change
  but is less fragile in case of future addition of new calls to catch
  between the main catch and this throw.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agotcl daemons: Move BEGIN within scope of transaction error trapping
Ian Jackson [Fri, 1 Jul 2016 11:10:27 +0000 (12:10 +0100)]
tcl daemons: Move BEGIN within scope of transaction error trapping

If the db connection has failed, BEGIN will fail.  We want to to
handle this properly.

Right now the effect is that we will now close the connection and it
will then be reopened by the next command.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoms-ownerdaemon: Break out db-reopen, and move it to JobDB-Executive
Ian Jackson [Fri, 1 Jul 2016 11:04:32 +0000 (12:04 +0100)]
ms-ownerdaemon: Break out db-reopen, and move it to JobDB-Executive

Also, change the `puts' to a `logputs'.  No other functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoms-ownerdaemon: Cope with db restart. Retry recording dead tasks.
Ian Jackson [Thu, 7 Jan 2016 19:30:42 +0000 (19:30 +0000)]
ms-ownerdaemon: Cope with db restart.  Retry recording dead tasks.

In chan-destroy-stuff, instead of accessing the db directly, add the
dead task(s) to a queue, and arrange to look at that queue.

Errors are handled by setting an `after' handler which we cancel if we
are successful.

The after handler requeues a queue run attempt as the first thing
(which will arrange that a further retry will occur if things are
still broken) and then attempts to reconnect to the database.

I have tested this with a test instance by renaming the `tasks' table
under its feet, and it functions as expected.

DEPLOYMENT NOTE: The owner daemon cannot be restarted without shutting
everything down.  So this update should first be deployed in
Cambridge, probably, to see how it goes.  Also, it is less critical in
the main Xen production test lab because there the db and the owner
daemon are co-hosted on the same VM.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Put back the `unset tasks' which was mistakenly removed.  The
    effect of its lack is to fail to clear out the task list for
    previous uses of the channel (which is named after the fd); this
    is mostly harmless apart from log spam but causes the usual
    case to be something like
       OK created-task 456354 ownd [10.80.227.94]:44852-876
    rather than
       OK created-task 456354 ownd [10.80.227.94]:44852-876
    which some of the clients (rightly) don't expect.

8 years agoDatabase locking: Tcl: Retry only on DEADLOCK DETECTED
Ian Jackson [Thu, 7 Jan 2016 18:47:03 +0000 (18:47 +0000)]
Database locking: Tcl: Retry only on DEADLOCK DETECTED

Use the new errorCode coming out of db-execute* to tell when the error
is that we got a database deadlock, which is the situation in which we
should retry.

This involves combining the two catch blocks, so that there is only
one error handling strategy.  Previously errors on COMMIT would be
retried and others would not.  Now errors anywhere might be retried
but only if the DB indicated deadlock.

We now unconditionally execute ROLLBACK.  This is more correct, since
we always previously executed BEGIN.

And, we pass the errorInfo and errorCode from the $body to the caller.

I have tested this with a test db instance, using contrived means to
generate a database deadlock, and it does actually retry.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
8 years agoDatabase locking: Tcl: for errorCode, use pg_exec, not pg_execute
Ian Jackson [Thu, 7 Jan 2016 18:22:53 +0000 (18:22 +0000)]
Database locking: Tcl: for errorCode, use pg_exec, not pg_execute

We would like to be able to retry db transactions.  To do this we need
to know why they failed (if they did).

But pg_execute does not set errorCode.  (This is clearly a bug.)  And
since it immediately discards a failed statement, any error
information has been lost by the time pg_execute returns.

So, instead, use pg_exec, and manually mess about with fishing
suitable information out of a failed statement handle, and generating
an appropriate errorCode.

There are no current consumers of this errorCode: that will come in a
moment.

A wrinkle is that as a result it is no longer possible to use
db-execute on a SELECT statement nor db-execute-array on a non-SELECT
statement.  This is because 1. the `ok' status that we have to
check for is different for statements which are commands and ones
which return tuples and 2. we need to fish a different return value out
of the statement handle (-cmdTuples vs -numTuples).  But all uses in
the codebase are now fine for this distinction.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v3: Put emsg at the start of errorInfo; things that print errors that
    print errorInfo typically print _only_ errorInfo.

8 years agoDatabase locking: Tcl: Use db-update-1 in jobdb::become-task
Ian Jackson [Thu, 14 Jul 2016 12:13:24 +0000 (13:13 +0100)]
Database locking: Tcl: Use db-update-1 in jobdb::become-task

db-update-1 contains the same error check found here.  Isn't clear
from the history why db-update-1 wasn't used right from the start.

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

8 years agoDatabase locking: Tcl: Use db-execute-array for SELECT in sg-execute-flight
Ian Jackson [Thu, 14 Jul 2016 12:11:44 +0000 (13:11 +0100)]
Database locking: Tcl: Use db-execute-array for SELECT in sg-execute-flight

We are going to make it wrong to use db-execute for SELECT statements.

Convert the existing violation site, which uses db-execute, into
db-execute-array (providing a dummy arrayvar).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v3: Dropped change to become-task which is actually wrong and should
    be db-update-1, anyway.  This will now be fixed in a separate patch.

8 years agoDatabase locking: Tcl: Use db-execute
Ian Jackson [Tue, 15 Dec 2015 16:07:09 +0000 (16:07 +0000)]
Database locking: Tcl: Use db-execute

Replace open-coded uses of pg_execute dbh STMT with
jobdb::db-execute STMT.

The only functional change is that if OSSTEST_TCL_JOBDB_DEBUG is set,
there will be debugging output.

But we are going to want to make db-execute do something more
complicated involving pg_exec.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
8 years agoDatabase locking: Tcl: Use db-execute-array
Ian Jackson [Tue, 15 Dec 2015 16:05:29 +0000 (16:05 +0000)]
Database locking: Tcl: Use db-execute-array

Replace open-coded uses of pg_execute -array ARRAYVAR dbh STMT
with jobdb::db-execute-array ARRAYVAR STMT.

The only functional change is that if OSSTEST_TCL_JOBDB_DEBUG is set,
there will be debugging output.

But we are going to want to make db-execute-array do something more
complicated involving pg_exec.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
8 years agoTcl database debugging: Actually work
Ian Jackson [Thu, 7 Jan 2016 19:06:58 +0000 (19:06 +0000)]
Tcl database debugging: Actually work

Setting OSSTEST_TCL_JOBDB_DEBUG was ineffective (ever since it was
introduced in 44dad3d8) because `env' wasn't imported from the global
scope.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
8 years agoms-planner: Support ClientNotes
Ian Jackson [Wed, 6 Jul 2016 13:42:57 +0000 (14:42 +0100)]
ms-planner: Support ClientNotes

No users yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agoms-flights-summary: Remove spurious \ in keys \%{ something }
Ian Jackson [Wed, 6 Jul 2016 15:00:12 +0000 (16:00 +0100)]
ms-flights-summary: Remove spurious \ in keys \%{ something }

With some versions of Perl this generates a warning which causes
ms-flights-summary to fail.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agoTcl: Use tclsh8.5
Ian Jackson [Fri, 1 Jul 2016 18:40:41 +0000 (19:40 +0100)]
Tcl: Use tclsh8.5

I have checked that tclsh8.5 and TclX work on osstest.test-lab (and
also osstest.xs.citrite.net).  TclX seems to be provided by tcl8.4 but
work with tcl8.5 (at least on wheezy and jessie).

Deployment note: hosts running Debian wheezy (including
osstest.xs.citrite.net, the Citrix Cambridge instance), will need
OSSTEST_DAEMON_TCLSH=tclsh8.4 in ~/.xen-osstest/settings.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoinvoke-daemon: Honour OSSTEST_DAEMON_TCLSH
Ian Jackson [Fri, 8 Jul 2016 10:48:39 +0000 (11:48 +0100)]
invoke-daemon: Honour OSSTEST_DAEMON_TCLSH

It appears that tcl8.5 in wheezy has a serious bug which makes `after
idle' not always work.  tcl8.4 has been working well in wheezy but is
not in jessie, where tcl8.5 works (and tcl8.6 has a serious event loop
bug - Debian #826741).

So we need to use different versions of Tcl on different hosts.
Allow this to be specified in ~/.xen-osstest/settings.

This affects only:
 - invoke-daemon (which is normally run from inittab)
 - mg-schema-test-database

sg-run-job and sg-execute-flight are not affected.  They do not
currently use `after idle' so that is OK for now.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-schema-test-database: Change default minflight to -100
Ian Jackson [Fri, 8 Jul 2016 10:57:32 +0000 (11:57 +0100)]
mg-schema-test-database: Change default minflight to -100

It is tiresome to try to create a test db for playing with and have to
wait for a big copy.  Better to create a small one by default; if the
user has forgotten to specify a minflight, they can always drop it and
run it again.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-schema-test-database: Make `daemons' be cleverer
Ian Jackson [Thu, 7 Jul 2016 16:46:20 +0000 (17:46 +0100)]
mg-schema-test-database: Make `daemons' be cleverer

Now you can tell it which daemons to run.  This is helpful if you want
to run them separately.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-schema-test-database: Prepare for `daemons' to be cleverer
Ian Jackson [Thu, 7 Jul 2016 16:25:44 +0000 (17:25 +0100)]
mg-schema-test-database: Prepare for `daemons' to be cleverer

We are going to want to be able to specify daemons individually.

Replace the call to parse_only_suffix so that we have somewhere to
parse extra arguments.  No functional change yet.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-schema-test-database: Direct logs to local directory
Ian Jackson [Wed, 6 Jul 2016 15:07:57 +0000 (16:07 +0100)]
mg-schema-test-database: Direct logs to local directory

Do not pollute a shared log area with logs of flights whose numbers
are valid only in the context of our test database.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
8 years agomg-allocate: Do not treat already-allocated resources as satisfactory
Ian Jackson [Thu, 7 Jul 2016 15:58:04 +0000 (16:58 +0100)]
mg-allocate: Do not treat already-allocated resources as satisfactory

This was always rather odd for ./mg-allocate HOSTNAME but makes the
more sophisticated uses like ./mg-allocate '{FLAG,FLAG,...}' very much
less useful.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-allocate: Fix "issteallable" call
Ian Jackson [Thu, 7 Jul 2016 11:18:33 +0000 (12:18 +0100)]
mg-allocate: Fix "issteallable" call

81cac5a1656e "mg-allocate: Support --steal" introduced an erroneous
call to the subref $issteallable, using { } instead of ( ), producing
this error:
  Not a HASH reference at ./mg-allocate line 225.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agobuild_clone: Move git_massage_url to build_url_vcs
Ian Jackson [Tue, 12 Jul 2016 16:14:29 +0000 (16:14 +0000)]
build_clone: Move git_massage_url to build_url_vcs

The effect is that ts-xen-build (the only other caller of
build_url_vcs) now gets the massaged rather than unmassaged urls.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agots-xen-build: Factor out config_tree
Ian Jackson [Tue, 12 Jul 2016 16:11:41 +0000 (16:11 +0000)]
ts-xen-build: Factor out config_tree

Replaces ad-hoc repeated stanzas involving nonempty etc. with a sub
which generates the right output, using build_url_vcs.

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agoTestSupport: Break out build_url_vcs
Ian Jackson [Tue, 12 Jul 2016 16:10:52 +0000 (16:10 +0000)]
TestSupport: Break out build_url_vcs

This encapsulates discovery of the tree url and the applicable VCS,
in a form useable separately (ie, outside build_clone).

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agoOsstest/PDU/eth008: print actual error on failure
Ian Jackson [Tue, 12 Jul 2016 15:53:54 +0000 (15:53 +0000)]
Osstest/PDU/eth008: print actual error on failure

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agocr-daily-branch: libvirt: use frozen version on stable branches base.diverse-class.v1
Ian Jackson [Mon, 27 Jun 2016 15:49:52 +0000 (16:49 +0100)]
cr-daily-branch: libvirt: use frozen version on stable branches

libvirt master might increase its LIBXL_API_VERSION.  When this feeds
through osstest it can cause the push gates of Xen stable branches to
break.

So for stable Xen branches do not track libvirt upstream.  Instead,
use a frozen revision.  (Only for main push gate tests of stable Xen
branches.)

The frozen branch is never going to be updated so it is not suitable
for other kinds of uses.  In particular it won't get security fixes.
So we call the refs   osstest/frozen/xen-K.L-testing  to discourage
users from using them.

Deployment note: The Xen release checklist needs a new item "add this
frozen libvirt branch".

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoap-fetch-version-old: libvirt: honour BASE_TAG_LIBVIRT
Ian Jackson [Mon, 27 Jun 2016 15:48:53 +0000 (16:48 +0100)]
ap-fetch-version-old: libvirt: honour BASE_TAG_LIBVIRT

If BASE_TAG_LIBVIRT is specified in the environment, we use it,
instead of `xen-tested-master'.

Nothing sets this yet, so no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agots-xen-build-prep: Do not install Ocaml on squeeze or wheezy
Ian Jackson [Mon, 27 Jun 2016 11:25:14 +0000 (12:25 +0100)]
ts-xen-build-prep: Do not install Ocaml on squeeze or wheezy

squeeze doesn't (didn't) have it at all.  wheezy doesn't have ocamlopt
on armhf, and the Xen build system (in the old branches where this is
relevant) seems not to be able to test this.

In any case we use these old Debian suites when testing old Xen
branches, which were (when they were current) built without ocaml.

This partially reverts "ts-xen-build-prep: Install Ocaml" bbe1a9b2a6c0.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Jan Beulich <JBeulich@suse.com>
8 years agopdu-msw: print pdu dns name in stdout messages
Ian Jackson [Fri, 17 Jun 2016 14:43:06 +0000 (14:43 +0000)]
pdu-msw: print pdu dns name in stdout messages

This makes the logs show which pdu was addressed.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-hosts serial attach: Provide serial-attach command
Ian Jackson [Tue, 22 Mar 2016 19:40:53 +0000 (19:40 +0000)]
mg-hosts serial attach: Provide serial-attach command

This is like running sympathy -r or xenuse by hand, except that it
checks that you have the host allocated, and looks up in the database
what the right rune is.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-allocate: Support --donate
Ian Jackson [Tue, 22 Mar 2016 19:02:55 +0000 (19:02 +0000)]
mg-allocate: Support --donate

8 years agomg-allocate: Support --as
Ian Jackson [Tue, 22 Mar 2016 18:54:28 +0000 (18:54 +0000)]
mg-allocate: Support --as

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-allocate: Support --steal
Ian Jackson [Tue, 22 Mar 2016 18:47:55 +0000 (18:47 +0000)]
mg-allocate: Support --steal

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoExecutive: Provide findtask_spec
Ian Jackson [Tue, 22 Mar 2016 16:57:49 +0000 (16:57 +0000)]
Executive: Provide findtask_spec

This will allow code elsewhere to look up tasks other than the one
specified in OSSTEST_TASK.  No callers of findtask_spec yet, so no
functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-allocate: Document -U and <duration> options
Ian Jackson [Tue, 22 Mar 2016 16:47:28 +0000 (16:47 +0000)]
mg-allocate: Document -U and <duration> options

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agoproduction-config, -cambridge: Update TftpDiVersion_wheezy
Ian Jackson [Wed, 8 Jun 2016 13:40:37 +0000 (13:40 +0000)]
production-config, -cambridge: Update TftpDiVersion_wheezy

There is a new d-i kernel for wheezy.  I have set it the new d-i in
Cambridge and Massachusetts using mg-debian-installer-update-all.

Use it.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomg-debian-installer-update: Allow optional suite argument
Ian Jackson [Wed, 8 Jun 2016 13:36:00 +0000 (13:36 +0000)]
mg-debian-installer-update: Allow optional suite argument

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
8 years agocr-for-branches: Branch Xen 4.7
Ian Jackson [Tue, 7 Jun 2016 13:34:22 +0000 (14:34 +0100)]
cr-for-branches: Branch Xen 4.7

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
8 years agomake-flight: don't create ovmf tests for seabios branch
Wei Liu [Wed, 25 May 2016 10:46:21 +0000 (11:46 +0100)]
make-flight: don't create ovmf tests for seabios branch

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
9 years agots-xen-build-prep: Install Ocaml
Ian Jackson [Fri, 22 Apr 2016 15:25:04 +0000 (16:25 +0100)]
ts-xen-build-prep: Install Ocaml

This will result in the Xen build system building, and then
preferring, oxenstored.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: David Scott <dave@recoil.org>
9 years agocrontab: Drop linux-mingo-tip-master linux-next linux-linus
Ian Jackson [Fri, 22 Apr 2016 14:46:30 +0000 (15:46 +0100)]
crontab: Drop linux-mingo-tip-master linux-next linux-linus

It appears that no-one is looking at the output.  These have not had a
push to the tested output branch for at least 250 days (742 days in
the case of linux-linus!) and the reports don't seem to be generating
any bugfixing activity.

There is a plan to do some Xen testing in Zero-day but even if that
doesn't lead to anything we would still be just where we are now.

So drop these to save our test bandwith for more useful work.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Juergen Gross <jgross@suse.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: David Vrabel <david.vrabel@citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Anshul Makkar <anshul.makkar@citrix.com>
9 years agosg-run-job: nested: Report nested log capture failure as `fail'
Ian Jackson [Mon, 11 Apr 2016 16:17:30 +0000 (17:17 +0100)]
sg-run-job: nested: Report nested log capture failure as `fail'

Previously this was `broken' (ie, infrastructure failure), which is
not really true - the usual reason is that the L0 has crashed, so that
efforts to manipulate the L1 do not succeed.

Tested using OSSTEST_SIMULATE and this:

  diff --git a/sg-run-job b/sg-run-job
  index 8b2d5e1..0f8e278 100755
  --- a/sg-run-job
  +++ b/sg-run-job
  @@ -181,6 +181,11 @@ proc spawn-ts {iffail testid args} {
       set xprefix {}
       if {[var-or-default env(OSSTEST_SIMULATE) 0]} { set xprefix echo }

  +puts stderr ">$ts $real_args"
  +    switch -glob "$ts $real_args" {
  +        {ts-logs-capture *} { set xprefix "bomb $xprefix" }
  +    }
  +
       set log [jobdb::step-log-filename $flight $jobinfo(job) $stepno $ts]
       set redirects {< /dev/null}
       if {[string length $log]} {

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agosg-run-job: nested: Break out nested-hosts-p
Ian Jackson [Mon, 11 Apr 2016 16:15:50 +0000 (17:15 +0100)]
sg-run-job: nested: Break out nested-hosts-p

We are going to want to test this elsewhere, too.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agomfi-common: Do not set di_version runvar to empty string
Ian Jackson [Mon, 11 Apr 2016 16:12:01 +0000 (17:12 +0100)]
mfi-common: Do not set di_version runvar to empty string

Specifically, do not set all_host_di_version to the shell variable
$di_version unless the latter has a nonempty value.  A set but empty
value for all_host_di_version does not default to the version for the
specific suite.  So this produces install failures.

This bug seems to have been introduced fairly recently, as fallout
from recent di_version handling changes.

diffing standalone-generate-dump-flight-runvars shows the expected
changes.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agomake-distros-flight: Always set guest_suite and defguestsuite
Ian Jackson [Mon, 11 Apr 2016 15:31:28 +0000 (16:31 +0100)]
make-distros-flight: Always set guest_suite and defguestsuite

Abolish the shell variables $gsuite and $debian_suite (which were
referred to only in make-distros-flight) and set and use the variables
guest_suite and defguestsuite.

These variables are used by the machinery in mfi-common to populate
the runvars.

No functional change (as seen in standalone-generate-dump-flight-runvars,
with mg-list-all-branches edited to use crontab-cambridge).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agomake-flight: Make debian_suite always contain a suite
Ian Jackson [Mon, 11 Apr 2016 15:25:21 +0000 (16:25 +0100)]
make-flight: Make debian_suite always contain a suite

The setting of the suite to "sid" in the snapshot case now occurs in
the case at the top of the script.

This means that gsuite always contains the actual suite name, and the
special cases which set it to sid can be removed.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agomake-distros-flight: Key "snapshot" special case off $branch
Ian Jackson [Mon, 11 Apr 2016 15:21:52 +0000 (16:21 +0100)]
make-distros-flight: Key "snapshot" special case off $branch

This eliminates two places where $debian_suite is expected to contain
"snapshot" rather than a suite.

We want to change debian_suite to always contain a real suite, so that
we can fold its uses in to other suite variables.

No functional change for existing branches.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agomake-distros-flight: Remove useless conditional
Ian Jackson [Mon, 11 Apr 2016 15:19:11 +0000 (16:19 +0100)]
make-distros-flight: Remove useless conditional

debian_suite is always set in "case $branch in" at the top of
make-distros-flight.

Remove it as part of rationalising the suite variables in this area.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agots-libvirt-build: disable qemu, vmware and openvz drivers
Wei Liu [Mon, 11 Apr 2016 14:39:54 +0000 (15:39 +0100)]
ts-libvirt-build: disable qemu, vmware and openvz drivers

We don't care about those drivers but they are enabled by default.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agomg-list-all-branches: avoid mistakenly generating `.' in the output
Ian Jackson [Fri, 19 Feb 2016 17:52:16 +0000 (17:52 +0000)]
mg-list-all-branches: avoid mistakenly generating `.' in the output

The regex in mg-list-all-branches assumes that the BRANCHES= will
either be a singleton entry separated from the following command by a
hard tab or a single quoted list of space separated entries, however
the xen-unstable-coverity line is singleton separated from the command
by a single space.

We could fix this by using a hard tab, but that ends up aligning
things in an aesthetically displeasing way, and relying on hard tabs
is fragile.

Instead, improve the parsing in mg-list-all-branches: break out a
couple of semantically (as well as syntactically) common regexp
elements out into variables, and then provide two regexps: one which
matches shell "assign default values" substitutions, and the other
which matches the ordinary shell assignments.

We use an empty pair of () in the first regexp to make sure that they
both produce the branch name list in $2.  (It would be possible to use
named capture groups but I'm not sure whether all our perls are recent
enough.)

I have verified that the actual difference in output right now is just
to remove the erroneous `.' entry.

Reported-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoTestSupport: Move cfg_tftp_di_version from Debian.pm
Ian Jackson [Wed, 30 Mar 2016 10:33:01 +0000 (11:33 +0100)]
TestSupport: Move cfg_tftp_di_version from Debian.pm

Strictly speaking this is a Debian-specific function.  But it is
called by selecthost.  TestSupport does not `use Osstest::Debian'
right now.  As a result, currently, if $suite is not set or
TftpDiVersion_$suite is not set, the program will crash with
  Undefined subroutine &Osstest::TestSupport::cfg_tftp_di_version called at Osstest/TestSupport.pm line 865.

Fix this by moving cfg_tftp_di_version to TestSupport, where it is
needed.

It would be possible to make the boundary between Osstest::TestSupport
and Osstest::Debian firmer by having selecthost explicitly call a
selecthost_do_debian_things (perhaps optionally, or as specified by
the caller).

But would be quite a palaver.  It is much more convenient to fudge the
issue.  (Of course if we have similar requirements for other OS's we
can put them in TestSupport too, provided they're not too big and
tangly.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: Change `use' in getconfig_TftpDiVersion_suite

9 years agocoverity: Rename branch names to `smoke', not `smoked'
Ian Jackson [Wed, 23 Mar 2016 11:28:22 +0000 (11:28 +0000)]
coverity: Rename branch names to `smoke', not `smoked'

c/s d94637b6 "coverity: run tests on smoked rather than master"
used `smoked' in several places, including as the name of the
input branch (which is already established as `smoke'), and the name
of the coverity-tested branch.

But we call this `smoke', not `smoked'.

After this patch `git-grep smoked' produces no output, as it did in
d94637b6~.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
9 years agocri-getprevxenbranch: Only ever return xen-X.Y-testing
Ian Jackson [Wed, 23 Mar 2016 11:17:10 +0000 (11:17 +0000)]
cri-getprevxenbranch: Only ever return xen-X.Y-testing

Only consider xen-[0-9]* as candidates either for returning, or for
matching the current branch.

The effect is that attempts to ask for the `previous Xen branch' of
anything other than a Xen stable branch give the latest Xen stable
branch, which I think is correct.

This fixes a bug where the `previous branch' of xen-unstable-smoke was
considered to be xen-unstable-coverity (!)

This bug would not have been of any consequence, except that the
coverity tested branch name in xen.bit changed in
c/s d94637b6 "coverity: run tests on smoked rather than master"
and had not been created, so that cr-daily-branch would crash for
most branches because the (largely irrelevant) invocation of
`./ap-fetch-version-old xen-unstable-coverity' would fail.

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