]> xenbits.xensource.com Git - people/liuw/osstest.git/log
people/liuw/osstest.git
7 years agosmoke tests: Fix job reuse globs in cr-daily-branch
Ian Jackson [Thu, 14 Dec 2017 16:28:21 +0000 (16:28 +0000)]
smoke tests: Fix job reuse globs in cr-daily-branch

A symptom that the old patterns lack !build-arm64-xsm, so the xsm job
might be reused.  The overall cause is that it contained a (partial)
list of architectures.

Instead, we observe that:
 * The things we want to avoid reusing are Xen and libvirt (which
   builds against Xen.
 * Non-Xen builds are invariably build-<arch>-<thing> (or even longer)
   so we can match them all with build-*-*.
 * We need to exclude the Xen builds and the libvirt builds.  The
   libvirt builds are obvious.  The Xen builds are either build-<arch>
   which does not match build-*-*, or build-<arch>-xsm.

CC: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agosmoke tests: Build arm64 with XSM, instead of without
Ian Jackson [Thu, 14 Dec 2017 16:03:44 +0000 (16:03 +0000)]
smoke tests: Build arm64 with XSM, instead of without

The smoke flight contains test-arm64-arm64-xl-xsm so it should contain
build-arm64-xsm (and not contain build-arm64).

I have checked the results with
  OSSTEST_CONFIG=standalone-config-example eatmydata ./standalone-generate-dump-flight-runvars
and looking at the diff shows precisely the expected change.

CC: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoproduction-config: Update jessie amd64 kernel for NUMA bugfix
Ian Jackson [Thu, 14 Dec 2017 16:15:51 +0000 (16:15 +0000)]
production-config: Update jessie amd64 kernel for NUMA bugfix

Bump TftpDiVersion_jessie.  This installer was generated by me today,
with the git branch including the di_special_kernel series, using this
rune:

 OSSTEST_SPECIALKERNELDEB_jessie_amd64=$PWD/linux-image-3.16.0-4-amd64_3.16.51-3~a.test_amd64.deb ./mg-debian-installer-update-all

The file linux-image-3.16.0-4-amd64_3.16.51-3~a.test_amd64.deb
came from here

 https://people.debian.org/~benh/packages/jessie-pu/linux-image-3.16.0-4-amd64_3.16.51-3~a.test_amd64.deb

apropos of this comment in the Debian bug report:

 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=883938#170

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agomg-debian-installer-update: Honour OSSTEST_SPECIALKERNELDEB_<suite>_<arch>
Ian Jackson [Thu, 14 Dec 2017 15:40:22 +0000 (15:40 +0000)]
mg-debian-installer-update: Honour OSSTEST_SPECIALKERNELDEB_<suite>_<arch>

This variable can be set to the absolute pathname of a kernel .deb to
use.  It will be used only for hosts for which the corresponding
hostflag "need-kernel-deb-<suite>-special" is set.

There is not currently any facility for more than one special kernel
for each architecture.

As with backports kernels, the normal (Debian-supplied) kernel is
available too, and is used for hosts without any special hostflag.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agomg-debian-installer-update: Introduce $specialkernel
Ian Jackson [Thu, 14 Dec 2017 15:37:25 +0000 (15:37 +0000)]
mg-debian-installer-update: Introduce $specialkernel

* In the first half of the backports kernel processing, set
  the new variable specialkernel to the string "backports".
  (This token occurs in the output .deb and kernel name, and
  is also referenced by hostflags of the form
     need-kernel-deb-<suite>-backports.)

* Break out the second half of the backports procesing into its
  own section, conditional on $specialkernel.

* Replace occurrences of the "backports" token, after that point,
  with $specialkernel.

Overall, this will allow other kinds of special kernel to be
introduced.  But there is, for now, no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agodi_special_kernel: Use in preseed_create
Ian Jackson [Thu, 14 Dec 2017 12:28:08 +0000 (12:28 +0000)]
di_special_kernel: Use in preseed_create

This abolishes yet another open-coding of need-kernel-deb-* handling.

Again, there is little functional change.  A significant change is
that now if the special kernel deb does not exist, we do not fail.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agodi_special_kernel: Provide $tp; Regularise $kernel, $cpio
Ian Jackson [Thu, 14 Dec 2017 15:52:07 +0000 (15:52 +0000)]
di_special_kernel: Provide $tp; Regularise $kernel, $cpio

Make both of these paths relative to $ho->{Tftp}{Path}.  Previously
$kernel was relative to that, but $cpio contained it.

Adjust all callers, so no functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agodi_special_kernel: Use di_installer_path
Ian Jackson [Thu, 14 Dec 2017 13:09:52 +0000 (13:09 +0000)]
di_special_kernel: Use di_installer_path

This avoids the caller having to supply $d_i.  This is good because
there is a site we want to call this from which uses that name for a
different value!

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agodi_installer_path: Use in ts-host-install
Ian Jackson [Thu, 14 Dec 2017 13:07:02 +0000 (13:07 +0000)]
di_installer_path: Use in ts-host-install

No significant functional change.  We now honour cfg_tftp_di_version
if the $ho doesn't have the information.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agodi_installer_path: Break out of preseed_create
Ian Jackson [Thu, 14 Dec 2017 13:04:31 +0000 (13:04 +0000)]
di_installer_path: Break out of preseed_create

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agodi_special_kernel: Replace open-coding in ts-host-install
Ian Jackson [Thu, 14 Dec 2017 12:23:24 +0000 (12:23 +0000)]
di_special_kernel: Replace open-coding in ts-host-install

The effect is simply to reuse the loop in di_special_kernel.  The
extra tests etc. to compute $k and $c in di_special_kernel are of no
import here, and are harmless.  We have already called
di_special_kernel so if it was going to fail due to this extra
computation, it would do so earlier.

No overall functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agodi_special_kernel: Pass $kp to $fn
Ian Jackson [Thu, 14 Dec 2017 12:23:12 +0000 (12:23 +0000)]
di_special_kernel: Pass $kp to $fn

Adjust the one current caller.  No functional change

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoDebian: Factor out di_special_kernel from ts-host-install
Ian Jackson [Thu, 14 Dec 2017 12:09:53 +0000 (12:09 +0000)]
Debian: Factor out di_special_kernel from ts-host-install

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agocrontab: Fix recipient of cron mails
Ian Jackson [Wed, 13 Dec 2017 17:04:19 +0000 (17:04 +0000)]
crontab: Fix recipient of cron mails

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoproduction-config[-cambridge]: update TftpDiVersion_jessie
Ian Jackson [Mon, 11 Dec 2017 15:55:39 +0000 (15:55 +0000)]
production-config[-cambridge]: update TftpDiVersion_jessie

Debian has done a point release.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agolinux-arm-xen: Get from shared arm/linux.git xenbits tree
Ian Jackson [Tue, 5 Dec 2017 18:27:17 +0000 (18:27 +0000)]
linux-arm-xen: Get from shared arm/linux.git xenbits tree

This drops the dependency on Stefano's personal git tree.
The osstest output branch remains unmoved.

Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agosg-report-host-history: make link to host examination results
Ian Jackson [Tue, 5 Dec 2017 17:24:04 +0000 (17:24 +0000)]
sg-report-host-history: make link to host examination results

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoREADME.dev: Say how to do a commissioning flight for a new architecture
Ian Jackson [Tue, 5 Dec 2017 16:01:17 +0000 (16:01 +0000)]
README.dev: Say how to do a commissioning flight for a new architecture

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoRevert "make-flight etc.: drop arm64"
Ian Jackson [Thu, 30 Nov 2017 17:11:10 +0000 (17:11 +0000)]
Revert "make-flight etc.: drop arm64"

We have the laxtons back and they seem to be working.

This reverts commit 329ef52c9866b2a8608a598836b7d5813de1e979.

Acked-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agomg-hosts: mknetbootdir: Correctly use Path again
Ian Jackson [Thu, 30 Nov 2017 17:40:13 +0000 (17:40 +0000)]
mg-hosts: mknetbootdir: Correctly use Path again

In fcd93edd00a8c9b08da3994d8bee9fa3809c3d93
  "netboot: Rework interface to host_netboot_file (was host_pxefile)"
we unintentionally dropped $ho->{Tftp}{Path} from the
effective path.  Reinstate it.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agomg-hosts: mknetbootdir: Add a couple of error checks
Ian Jackson [Thu, 30 Nov 2017 17:39:13 +0000 (17:39 +0000)]
mg-hosts: mknetbootdir: Add a couple of error checks

This will help us stop blundering on if something is wrong.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoproduction-config: Increase LogsMinSpaceMby etc.
Ian Jackson [Tue, 5 Dec 2017 11:47:53 +0000 (11:47 +0000)]
production-config: Increase LogsMinSpaceMby etc.

osstest does not currently try to estimate the prospective disk use in
logs/ etc. of a flight before it starts; nor does it aggregate the
disk requirements of multiple concurrent flights.

Instead, it has a hardcoded minimum, which is enforced (by expiry) at
the start of each flight.  It must be large enough for all in-progress
flights.  This turns out not to be true any more, because of expansion
of both the number of different osstest branches, and because of
expansion of the number of jobs per flight, and because of expansion
of the activities within each job.

So, well, let's double it.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoBranch for Xen 4.9
Ian Jackson [Fri, 1 Dec 2017 14:52:52 +0000 (14:52 +0000)]
Branch for Xen 4.9

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoREADME: Do not recommend cs-flight-create
Ian Jackson [Fri, 1 Dec 2017 11:13:39 +0000 (11:13 +0000)]
README: Do not recommend cs-flight-create

This is not a normal way to carry on.  Far too much like hard work.
Recommend make-flight or cs-adjust-flight new: instead.

CC: Julien Grall <julien.grall@arm.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agocs-adjust-flight: Correct pseudo-BNF synopsys for runvar-build-set
Ian Jackson [Fri, 1 Dec 2017 11:11:38 +0000 (11:11 +0000)]
cs-adjust-flight: Correct pseudo-BNF synopsys for runvar-build-set

In 497b2c6c933d13a05b01c6a654ce470be16dd78a
  cs-adjust-flight: Rework runvar-build-set new value handling
the interpretation of this parameter was changed completely, but the
synopsis was not updated and thus became wrong.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agots-xen-build-prep: Install libelf-dev for benefit of linux.git
Ian Jackson [Wed, 15 Nov 2017 11:00:07 +0000 (11:00 +0000)]
ts-xen-build-prep: Install libelf-dev for benefit of linux.git

Linux upstream has started needing libelf-dev.  Without it, recent tip
fails (in our configuration) like this:

 Makefile:938: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel".  Stop.

This is because kernel now is using objtool to create unwind
information.  This needs libelf to work.  Advantage is that this
approach no longer depends on assembler sources being heavily
annotated with unwind hints.

CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: Juergen Gross <jgross@suse.com>
CC: Paul Durrant <paul.durrant@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Juergen Gross <jgross@suse.com>
7 years agomg-force-push: Fix typo
Ian Jackson [Wed, 8 Nov 2017 16:01:06 +0000 (16:01 +0000)]
mg-force-push: Fix typo

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoosstest: fix rm to use '-f' in ts-freebsd-host-install
Roger Pau Monne [Fri, 3 Nov 2017 15:18:05 +0000 (15:18 +0000)]
osstest: fix rm to use '-f' in ts-freebsd-host-install

It's perfectly valid for the .tmp file to not exists, and the script
shouldn't fail in that case.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoap-push: turn off set -x
Ian Jackson [Mon, 6 Nov 2017 16:28:21 +0000 (16:28 +0000)]
ap-push: turn off set -x

This makes the output of mg-force-push quite unpleasant, amongst other
things.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agomg-force-push: New script
Ian Jackson [Mon, 6 Nov 2017 16:24:58 +0000 (16:24 +0000)]
mg-force-push: New script

This does some safety checks and reduces the risk of c&p mistakes.
It has to be run as osstest@osstest.test-lab (or equivalent).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agomigrations: Do x10 migration 20x instead
Ian Jackson [Fri, 3 Nov 2017 12:49:37 +0000 (12:49 +0000)]
migrations: Do x10 migration 20x instead

We want to keep the old testid or some new failures will be "never
pass".

Roger reports that this change makes the existing host-specific
Windows migration failures fail everywhere, so so things may need
force pushing.

CC: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agocrontab: do bisect the smoke tests
Ian Jackson [Fri, 3 Nov 2017 12:08:06 +0000 (12:08 +0000)]
crontab: do bisect the smoke tests

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoosstest: set arch before calling set_freebsd_runvars
Roger Pau Monne [Thu, 26 Oct 2017 15:21:03 +0000 (15:21 +0000)]
osstest: set arch before calling set_freebsd_runvars

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
7 years agoosstest: Add freebsd runvars to examine job in generic flights
Roger Pau Monne [Wed, 25 Oct 2017 10:30:24 +0000 (11:30 +0100)]
osstest: Add freebsd runvars to examine job in generic flights

Previous patches only added the FreeBSD runvars to the jobs in the
examine flight, but failed to also add them to the examine job in the
generic flight.

This is necessary because the examine jobs now contain a step which
uses freebsd - the memdisk append determination.

On installations without an anointed freebsd job, and with no
freebsd-related config settings, that step will simply and harmlessly
fail.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agosg-run-job: hook the memdisk test into examine
Roger Pau Monne [Fri, 28 Jul 2017 15:08:32 +0000 (16:08 +0100)]
sg-run-job: hook the memdisk test into examine

Hook the memdisk parameter detection and the saving of the host
properties into the examine jobs.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v2:
 - Do not pass a host ident to ts-examine-hostprops-save.
 - Use .- for ts-memdisk-try-append so that the rest of the job will
   run even if this step fails.

Changes since v1:
 - Run the memdisk test first (so that we don't leave the host in a
   weird state).
 - Pass a host to the examine-hostprops-save.

7 years agomake-hosts-flight: set runvars for FreeBSD test
Roger Pau Monne [Fri, 28 Jul 2017 15:07:16 +0000 (16:07 +0100)]
make-hosts-flight: set runvars for FreeBSD test

This is needed in order to run the memdisk test.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agots-examine-hostprops-save: introduce a script to save properties
Roger Pau Monne [Fri, 28 Jul 2017 15:10:44 +0000 (16:10 +0100)]
ts-examine-hostprops-save: introduce a script to save properties

This script turns the properties stored in the runvars using the
format hostprop/$ident/$prop=$val into host properties stored in the
database.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v12:
 - Introduce a dry_run variable and print a message only once if not
   saving the properties in the database.

Changes since v2:
 - Call selecthost based on the idents passed in the putative
   hostprops runvar.
 - Fix commit message.
 - Use '/' instead of '_' in the runvars.
 - Do a dry run if flight blessing != real.
 - Fix parentheses indentation.

Changes since v1:
 - Select a host for setting the properties.
 - Print a message before exiting if blessing != real.
 - Skip properties that don't contain the selected host.

7 years agots-memdisk-try-append: introduce a script to test memdisk options
Roger Pau Monne [Fri, 28 Jul 2017 15:05:18 +0000 (16:05 +0100)]
ts-memdisk-try-append: introduce a script to test memdisk options

The intended usage is to run this script against every host in order
to record the possible needed memdisk flags.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v12:
 - Add hyphens to the boot test options.

Changes since v1:
 - Get the arch of the job and exit with 0 if it's not supported.
 - Pass the --recordappend argument to ts-memdisk-try-append.

7 years agots-freebsd-host-install: add arguments to test memdisk append options
Roger Pau Monne [Fri, 28 Jul 2017 15:02:59 +0000 (16:02 +0100)]
ts-freebsd-host-install: add arguments to test memdisk append options

This is needed in order to figure out which memdisk options should be
used to boot the images on each specific box.

Note that when passed the --record-append argument upon success the
script stores the tentative host property in the runvars.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v12:
 - Add hyphens between words in command line options.
 - Die if --record-append is specified without --test-boot.

Changes since v2:
 - Fix commit message.

Changes since v1:
 - Provide a --recordappend argument to force the recording the
   memdisk parameters.
 - Exit gracefully if a bootonly test is attempted against a
   non-supported architecture.
 - Use NONE instead of an empty string when calling
   setup_netboot_memdisk if nothing should be appended.
 - Do not perform any arch test in ts-freebsd-host-install.

7 years agoTestSupport: introduce hostprop_putative_record
Roger Pau Monne [Fri, 28 Jul 2017 14:59:41 +0000 (15:59 +0100)]
TestSupport: introduce hostprop_putative_record

This is used to store tentative host properties in the runvars of a
job, with the expectation that at some point (ie: at the end of the
job) they will be turned into real properties stored in the database.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v2:
 - Use the following runvar format to store the putative host props:
   hostprop/$ident/$prop=$val.

7 years agonetboot_memdisk: allow each host to have different append values
Roger Pau Monne [Mon, 23 Oct 2017 11:41:16 +0000 (12:41 +0100)]
netboot_memdisk: allow each host to have different append values

Some hosts require "append raw" [0] when booting with memdisk, while
others don't. This is based on the hardware/BIOS, and needs to be set
on a per-host basis.

In order to do this, add a new "MemdiskAppend" host property and make
use of it in the setup_netboot_memdisk helper.

[0] http://www.syslinux.org/wiki/index.php?title=MEMDISK#Memory_access_method

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v1:
 - Explicitly use NONE for no options set (instead of an empty string,
   which is the default).
 - Allow to manually pass append parameters.

7 years agomfi-common: introduce set_freebsd_runvars to mfi-common
Roger Pau Monne [Mon, 23 Oct 2017 09:57:00 +0000 (10:57 +0100)]
mfi-common: introduce set_freebsd_runvars to mfi-common

So that it can also be used by make-hosts-flight.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoHostDB: introduce set_property
Roger Pau Monne [Mon, 23 Oct 2017 09:57:00 +0000 (10:57 +0100)]
HostDB: introduce set_property

And provide a helper in TestSupport to use it. This allows osstest to
set host properties from test script themselves (instead of using
the mg-hosts clu).

Note that the setting of host properties is limited to flights with
intended blessing real, and it will fail for any other blessing.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v12:
 - Use intended blessing in the error message.

Changes since v2:
 - Die if attempting to modify a host prop with intended blessing !=
   real.

7 years agosg-run-job: fix typo in the examine jobs
Roger Pau Monne [Mon, 23 Oct 2017 09:56:59 +0000 (10:56 +0100)]
sg-run-job: fix typo in the examine jobs

proc prep-job/host-examine-xen is declared twice, one of them should
be prep-job/host-examine-linux instead.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoosstest: save/retrieve the last successfully tested FreeBSD build
Roger Pau Monne [Mon, 23 Oct 2017 13:13:30 +0000 (14:13 +0100)]
osstest: save/retrieve the last successfully tested FreeBSD build

And use it in order to install the hosts for the next FreeBSD flight.

Note that the anoints are done after the push, but there's a recovery
mechanism in case osstest manages to do a successful push, but the
artifacts are not anointed for some reason. Osstest will continue to
create flights until the revision of the anointed artifacts matches
the one pushed to the repository (even if that means running flights
with OLD_REVISION == NEW_REVISION).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v7:
 - Add space between $freebsd_branch and * in list-prepared.

Changes since v6:
 - Use just the branch name for anoint (instead of freebsd-$branch).
 - Force the creation of flights if the revision of the current
   anoints don't match OLD_VERSION.
 - Iterate over the list of current anoints instead of open-coding the
   arches.
 - Split the retrieve/anoint code blocks into it's own sections.

Changes since v5:
 - New in this version.

7 years agoosstest: add a FreeBSD host install script
Roger Pau Monne [Mon, 23 Oct 2017 13:03:21 +0000 (14:03 +0100)]
osstest: add a FreeBSD host install script

The installation is performed using the bsdinstall tool, which is part
of the FreeBSD base system. The installer image is setup with the
osstest ssh keys and sshd enabled by default, which allows the test
harness to just ssh into the box, create the install config file and
launch the scripted install.

Currently the installation is done with ZFS only, in stripe mode, and
a single disk.

In order to support the FreeBSD installer the setup_netboot_memdisk
helper is used, that allows setting the pxe boot of a host using a
memdisk.

The install script either picks the binary images from the output of a
previous FreeBSD buildjob (yet to be introduced), or from the folder
pointed by freebsd_distpath. This folder should contain the installer
image (install.img) and the compressed install sets (kernel.txz,
base.txz) together with the MANIFEST file that contains the checksums.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v4:
 - Remove get_sets_path routine and xopts variable.
 - Call resource_shared_mark_ready when the host is ready to be used.

Changes since v3:
 - Use sha256file instead of the sha256sum clu.
 - Shift parameters passed to the lock and copy script, so that
   parameter 0 is ignored.
 - Copy to .tmp and then move the FreeBSD image.
 - Use a single-line find rune to cleanup old images.
 - Add some missing "set -e".
 - Don't check the output of target_cmd_output_root against undefined,
   that's never going to be true.
 - Split the setup_netboot_memdisk helper code into a pre-patch.

Changes since v2:
 - Use sysrc instead of echo to modify rc.conf.

Changes since v1:
 - Use pkg bootstrap instead of pkg update.
 - Use freebsdbuildjob instead of freebsd_buildjob.
 - add "append raw" to the memdisk command line.
 - Use with-lock-ex instead of flock.
 - Use system_checked and an array to hold the locked command to
   execute.
 - Use an array to store the list of possible disk devices.
 - Use target_putfilecontents_root_stash in order to upload the
   install script to the target.
 - Remove the usage of TftpFreeBSDBase.
 - Use target_tftp_prefix in order to get the prefix for the tftp
   target image path.
 - Add a missing linewrap.
 - Replace the split used to get the runvar paths with a regexp.
 - Place the install sets at /root/osstest_sets instead of
   /tmp/osstest_sets.
 - Pick the sets/installer image from the freebsdbuildjob
   path_freebsdist or from the runvar variable freebsd_distpath.
 - Add a comment about which FreeBSD specific inputs the script
   consumes.

7 years agoosstest: introduce a helper to setup a host to boot using memdisk
Roger Pau Monne [Mon, 23 Oct 2017 10:06:19 +0000 (11:06 +0100)]
osstest: introduce a helper to setup a host to boot using memdisk

The helper allows booting a host from pxelinux using an image
compatible with memdisk.

Note that this requires having a copy of the memdisk binary (provided
as part of pxelinux) in the root of the tftp server.

Deployment note: A copy of the memdisk binary (from syslinux) must be
placed in the root of the tftp server, on Debian this is accomplished
using;

ln -s /usr/lib/syslinux/memdisk /tftp/root/memdisk

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v4:
 - Add a deployment note to the commit message.

Changes since v3:
 - New in this version (split from install patch).

7 years agoosstest: introduce a helper to calculate the sha256 of a given file
Roger Pau Monne [Mon, 23 Oct 2017 10:05:57 +0000 (11:05 +0100)]
osstest: introduce a helper to calculate the sha256 of a given file

The helper is going to be used to calculate the sha256 of the FreeBSD
installer images.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v3:
 - New in this version.

7 years agoosstest: introduce helper to get per-host tftp prefix
Roger Pau Monne [Mon, 23 Oct 2017 10:05:39 +0000 (11:05 +0100)]
osstest: introduce helper to get per-host tftp prefix

This is used in order to get the per-host tftp prefix, used to store
the host initrd file.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v1:
 - New in this version.

7 years agoanointments: Provide ./mg-anoint list-prepared
Ian Jackson [Mon, 23 Oct 2017 10:04:54 +0000 (11:04 +0100)]
anointments: Provide ./mg-anoint list-prepared

Deployment note: Requires Text::Glob, which on Debian is in
libtext-glob-perl (which I have installed in the Xen Project and
Citrix Cambridge primary VMs).

CC: Roger Pau Monne <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoanointments: Introduce anointment scheme, and mg-anoint script
Ian Jackson [Mon, 23 Oct 2017 10:04:34 +0000 (11:04 +0100)]
anointments: Introduce anointment scheme, and mg-anoint script

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
[Roger: fix conflict in README.planner after rebase]
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
7 years agomg-hosts: Fix of showprops doc comment
Anthony PERARD [Tue, 24 Oct 2017 10:37:20 +0000 (11:37 +0100)]
mg-hosts: Fix of showprops doc comment

./mg-hosts showprops description and implementation didn't match.
Fix description.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agomg-repro-setup: Correct usage message re host idents
Ian Jackson [Thu, 19 Oct 2017 12:56:08 +0000 (13:56 +0100)]
mg-repro-setup: Correct usage message re host idents

`[host=]' was misleading - it suggests you have to type literally
`host=', or nothing.  But actually `host' here is any host ident.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
7 years agomg-repro-setup: --autoalloc-nofree option
Ian Jackson [Thu, 19 Oct 2017 10:13:37 +0000 (11:13 +0100)]
mg-repro-setup: --autoalloc-nofree option

This lets you run the automatic allocator within your own task, so you
get to keep whatever it found.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
v3: Remove erroneous need to specify the HOSTSPEC "none:"
v2: Some docs, and a warning message.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoMaxUmask: enforce a maximum umask value
Ian Jackson [Tue, 17 Oct 2017 11:08:31 +0000 (12:08 +0100)]
MaxUmask: enforce a maximum umask value

On some operating systems, the default umask is not 002 as it should
be (for the sensible setup with personal groups).

If a user with an 022 or 077 umask invokes osstest in Executive mode,
they end up creating directories in $c{Logs} which are writeable only
by them, and that can stop the whole system because the service user
cannot expire them.

Prevent this from happening.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoHostDiskRoot: bump to 20G
Ian Jackson [Fri, 13 Oct 2017 13:11:56 +0000 (14:11 +0100)]
HostDiskRoot: bump to 20G

Some of our Windows guests have more RAM now, and some of them have
big ISOs too.  The guest memory ends up in /root as a save image, and
the ISO ends up there too.

Double the size of / to 20G.  That will probably do for now and is
unlikely to break anything.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reported-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
7 years agopvh: rename pvh tests to pvhv2
Roger Pau Monne [Wed, 11 Oct 2017 09:05:00 +0000 (10:05 +0100)]
pvh: rename pvh tests to pvhv2

Due to the recent changes to the PVH tests, all of them are now
failing because the current Linux kernel used by osstest doesn't
support PVHv2, and osstest treats the failures as regressions because
previously the PVH tests where actually testing classic PV.

Rename the tests to 'pvhv2' in order to prevent osstest from
classifying the failures as regressions.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoexamine: save xl info output
Ian Jackson [Mon, 9 Oct 2017 11:30:31 +0000 (12:30 +0100)]
examine: save xl info output

One reason we want this is that it contains a reasonably easy-to-parse
record of the host memory.

When we have collected this information for all hosts, as xl info
output, we can write a program to copy the information into a host
property.  This will allow us to restrict certain jobs to hosts with
enough memory.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: George Dunlap <George.Dunlap@citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
7 years agoosstest: fix PVH DomU tests
Roger Pau Monne [Tue, 3 Oct 2017 10:21:35 +0000 (11:21 +0100)]
osstest: fix PVH DomU tests

The pvh=1 xl option was removed, so switch the PVH tests to use
type='pvh' instead.

On older branches still supporting PVHv1 (and the 'pvh' xl option),
this change would turn the PVH tests into PV tests), except that the
previous change removed the PVH tests from those branches.
PVHv1 has already been removed from upstream Linux and Xen.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoosstest: limit PVH tests to Xen >= 4.10
Roger Pau Monne [Tue, 3 Oct 2017 10:21:37 +0000 (11:21 +0100)]
osstest: limit PVH tests to Xen >= 4.10

Older Xen versions don't support the 'type' xl option used to create a
PVHv2 guest, which we are about to switch to.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agoosstest: use type='hvm' for HVM guests
Roger Pau Monne [Tue, 3 Oct 2017 10:21:36 +0000 (11:21 +0100)]
osstest: use type='hvm' for HVM guests

The previous builder='hvm' is also kept for compatibility with older
Xen releases. Note that the type option is ignored in previous Xen
versions.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agots-kernel-build: enable ntfs and fuse support
Wei Liu [Wed, 27 Sep 2017 11:04:16 +0000 (12:04 +0100)]
ts-kernel-build: enable ntfs and fuse support

They will be useful for extracting files from Windows and other OSes
from Dom0 while debugging.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
7 years agots-leak-check: Treat listing failure as fail, not broken
Ian Jackson [Wed, 27 Sep 2017 10:00:29 +0000 (11:00 +0100)]
ts-leak-check: Treat listing failure as fail, not broken

This can easily occur if the test host crashes, due to a bug.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoREADME.dev: Improve instructions for new machine commissioning
Ian Jackson [Fri, 8 Sep 2017 17:37:50 +0000 (18:37 +0100)]
README.dev: Improve instructions for new machine commissioning

Discuss preliminary setup (hardware and BIOS).

Invent "mudcake0" and "mudcake1" as machines being added and use them
consistently in the example runes.

Recommend to run a host examination flight first.  (NB I am still
testing that this actually works as expected.  Host examination is a
bit new.)

Consistently suggest use of a $basis, and use of $flight variable.

Do not prepend runes with OSSTEST_CONFIG setting.  Instead, we expect
the user to have it set already (and mention this).

Use "cs-adjust-flight new:" rather than the two-step process.

Formatting improvements etc.

CC: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoREADME.dev: Miscellaneous minor improvements
Ian Jackson [Fri, 8 Sep 2017 17:36:29 +0000 (18:36 +0100)]
README.dev: Miscellaneous minor improvements

Clarify documentation on mg-blockage, and also suggest using
allocation instead.

No longer advise removing crontab as a way to shut osstest down.  The
stop file approach works fine and is less disruptive.

Minor formatting changes.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoREADME: Better documentation of recipes, db, etc.
Ian Jackson [Fri, 8 Sep 2017 13:51:52 +0000 (14:51 +0100)]
README: Better documentation of recipes, db, etc.

CC: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoexamine: Do not try to find old version
Ian Jackson [Fri, 8 Sep 2017 14:04:47 +0000 (15:04 +0100)]
examine: Do not try to find old version

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoosstest: fix a typo in mg-repro-setup
Roger Pau Monne [Wed, 6 Sep 2017 08:09:22 +0000 (09:09 +0100)]
osstest: fix a typo in mg-repro-setup

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
7 years agomake-flight etc.: drop arm64
Ian Jackson [Wed, 6 Sep 2017 14:06:09 +0000 (15:06 +0100)]
make-flight etc.: drop arm64

These are causing unjustified push blocks.

Verified with
  OSSTEST_CONFIG=standalone-config-example eatmydata ./standalone-generate-dump-flight-runvars
that no arm64 jobs remain.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoauthorized_keys: Look for ed25519 and ecdsa keys too
Ian Jackson [Fri, 1 Sep 2017 16:55:26 +0000 (17:55 +0100)]
authorized_keys: Look for ed25519 and ecdsa keys too

Reported-by: George Dunlap <George.Dunlap@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoPERLLIB, @INC: Use BEGIN { }
Ian Jackson [Fri, 1 Sep 2017 15:42:24 +0000 (16:42 +0100)]
PERLLIB, @INC: Use BEGIN { }

unshifting @INC is only effective if done at compile time, so that it
affects `use' directives.  So "Perl: Put . on @INC"
f261b07cbe96844dba5d8594c38149c0b179068a is simply broken

This patch was autogenerated using the following rune:

  git-grep -l 'unshift @INC' | xargs perl -i~ -pe 's#\bunshift\s+\@INC,\s*qw\(\.\)\;#BEGIN { $& }#'

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agomg-hosts: Fix another couple of prepared statements
Ian Jackson [Fri, 1 Sep 2017 15:35:05 +0000 (16:35 +0100)]
mg-hosts: Fix another couple of prepared statements

Use our $blah_q //= ... since these are used only here.  This is a
cheap kind of memoisation of a global constant.

Reported-by: George Dunlap <George.Dunlap@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoREADME: document need for libnet-snmp-perl
Ian Jackson [Fri, 1 Sep 2017 15:24:00 +0000 (16:24 +0100)]
README: document need for libnet-snmp-perl

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reported-by: George Dunlap <George.Dunlap@citrix.com>
7 years agomg-host: Prepare $checkhostq only if needed
Ian Jackson [Fri, 1 Sep 2017 15:21:23 +0000 (16:21 +0100)]
mg-host: Prepare $checkhostq only if needed

This is helpful because in standalone mode there is no resources table
and this fails.  But we want people to use `mg-hosts power' in
standalone mode, if they can, rather than running ./msu-pdu ad-hoc (or
whatever).

Reported-by: George Dunlap <George.Dunlap@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoPERLLIB, @INC: Add . in some places we missed
Ian Jackson [Fri, 1 Sep 2017 15:04:08 +0000 (16:04 +0100)]
PERLLIB, @INC: Add . in some places we missed

* cri-getconfig (invoked by many cr* scripts, standalone-reset, etc.)
* mgi-common (invoked by many mg*)
* Two literal perl -e includes in Tcl code.

I think this leaves no scripts which do not set PERLLIB or @INC,
either by themselves or by something they source with `.'.

Reported-by: George Dunlap <George.Dunlap@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoproduction-config: Publish per-flight osstest git refs in separate tree
Ian Jackson [Fri, 1 Sep 2017 10:05:55 +0000 (11:05 +0100)]
production-config: Publish per-flight osstest git refs in separate tree

Those refs need to be somewhere public so that the relevant git
objects are accessible.  I think they probably have to be in
refs/tags/ or refs/heads/ of some repo.

But it doesn't have to be the main one on xenbits.  Most people won't
want these refs.  Most git commits they are interested in (eg git
commits referred to in flight reports) will be available on the
osstest master branch.  And having these refs there makes git fetch
and git clone of the main repo slow.

Deployment note:

I have already created the destination repo.  Once this commit makes
it to master, I will manually transfer all the flight-* refs from the
main tree to osstest/osstest-massachusetts.git.

Reported-by: George Dunlap <George.Dunlap@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agosg-report-flight: Consider broken jobs as blockers even if other failure found
Ian Jackson [Tue, 1 Aug 2017 13:20:36 +0000 (14:20 +0100)]
sg-report-flight: Consider broken jobs as blockers even if other failure found

This stops us, effectively, justifying a currently broken job by
reference to a previously failed step which does justify a currently
failed step.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agomg-repro-setup: Slightly better document the alloc: syntax
Ian Jackson [Tue, 1 Aug 2017 13:18:29 +0000 (14:18 +0100)]
mg-repro-setup: Slightly better document the alloc: syntax

Provide a clearer indication that the <resource-spec> is passed to
mg-allocate (and therefore, implicitly, that mg-allocate's docs should
be consulted).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
7 years agocs-hosts-list: Document the --arches, --kernels and --suites options
Ian Jackson [Fri, 28 Jul 2017 15:24:23 +0000 (16:24 +0100)]
cs-hosts-list: Document the --arches, --kernels and --suites options

These have a rather counterintuitive behaviour which is nevertheless
useful.  Document it, and the reasoning.

CC: Roger Pau Monne <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoarm64: tolerate host allocation failures
Ian Jackson [Fri, 28 Jul 2017 10:31:03 +0000 (11:31 +0100)]
arm64: tolerate host allocation failures

We have no working ARM64 hardware right now.  Stop blocking things.

(Arguably this ought to be done in general for all arches, but
actually bugs in the flight construction code can cause this too, and
we wouldn't want such a regression to pass the osstest
self-push-gate.)

CC: Julien Grall <julien.grall@arm.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: Match @@-arm64 jobs (eg build-arm64) too

7 years agocoverity: Set CoverityToolsStripComponents to 2
Ian Jackson [Wed, 26 Jul 2017 13:31:52 +0000 (14:31 +0100)]
coverity: Set CoverityToolsStripComponents to 2

This needs to be 2 for cov-analysis-linux64-2017.07.tar.gz
because that contains "./" at the start of its paths, which
tar counts as a component it's stripping.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
7 years agocoverity: Parameterise CoverityToolsStripComponents
Ian Jackson [Wed, 26 Jul 2017 13:30:58 +0000 (14:30 +0100)]
coverity: Parameterise CoverityToolsStripComponents

No functional change with current production-config.

(In fact, this needs to be 2 for cov-analysis-linux64-2017.07.tar.gz)

Reported-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
7 years agoap-common: Switch to Linux 4.9 by default
Ian Jackson [Mon, 22 May 2017 15:09:23 +0000 (16:09 +0100)]
ap-common: Switch to Linux 4.9 by default

I ran a special report[1] to see what to expect and:

   Tests which did not succeed and are blocking,
   including tests which could not be run:
    test-amd64-i386-xl-qemuu-win7-amd64 15 guest-localmigrate/x10 fail REGR.
    test-amd64-i386-xl-qemut-win7-amd64 15 guest-localmigrate/x10 fail REGR.

These Windows 7 migration tests have been failing on many branches and
don't look like they are something to do with the version of Linux
used in dom0.

Accordingly I intend to push this change to switch osstest to using
Linux 4.9 by default.  ARM tests are not affected at this time.

[1] ./sg-report-flight --that-linux=b65f2f457c49b2cfd7967c34b7a0b04c25587f13 --this-linux=f5eea276d8de10a32e68721707ae8f2fdfaa0960 --branches-also=linux-3.14,linux-arm-xen 109662 |less

CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: Juergen Gross <jgross@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agostep logfiles: Populate logfile column with logfile name
Ian Jackson [Thu, 29 Jun 2017 15:19:16 +0000 (16:19 +0100)]
step logfiles: Populate logfile column with logfile name

This is part of a "Populate-then-rely" schema change, as described in
schema/README.updates.  Specifically, this is the final part of the
step:

5. Commit: code to populate new column; changing `add' to status
   Needed and `constraint' to status Ready.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agostep logfiles: sg-run-job: Break out step-log-leafname
Ian Jackson [Thu, 29 Jun 2017 15:18:26 +0000 (16:18 +0100)]
step logfiles: sg-run-job: Break out step-log-leafname

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agostep logfiles: Make substep_* take $logfile, not $script
Ian Jackson [Thu, 29 Jun 2017 12:10:38 +0000 (13:10 +0100)]
step logfiles: Make substep_* take $logfile, not $script

The $script parameter was used by Standalone to print a message, but
this is no longer done.

It is used by Executive as the value for the "step" column in the
steps table, which shows up as "script" in the output from
sg-report-flight.  But, when running under sg-run-job,
JobDB::Executive already has a better source of the script name: the
parent step (as reported in OSSTEST_TESTID).  When not running under
sg-run-job the use of $0 is good enough.

Finally, it is used by Executive as a logfile name.  But when running
under sg-run-job, JobDB::Executive gets the right logfile name anyway
(as above); and when not running under sg-run-job there is no default
logfile.

Conversely, substeps might organise their own logfile.

So abolish $script from the TestSupport substep API.  Replace it in
substep_start and substep_eval with a $logfile parameter.

Update all call sites to no longer pass $script.  None make their own
logfiles, so none pass the new parameter $logfile.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agostep logfiles: Honour new logfile column
Ian Jackson [Thu, 29 Jun 2017 12:05:18 +0000 (13:05 +0100)]
step logfiles: Honour new logfile column

There are the following places in the tree where we construct the
logfile name from stepno and step:
 * tcl/JobDB-Executive            main decision about logfile name  } OK
 * JobDB::Executive               final fallback for new steps      } keep
 * steps-logfile-constraint.sql   default for old data              }
 * sg-report-flight (twice)   } both read stepno and step from the db;
 * determine-failure-reasons  }  here we teach them to try logfile first

Now substep logs will have correct links in the job output, as soon as
the logfile column has the right data.

This is part of a "Populate-then-rely" schema change, as described in
schema/README.updates.  Specifically, this is the step:

6. Optionally commit: code which reads new column, but which tolerates
   it containing NULL/DEFAULT.  (`add' is already Needed.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agosubstep logfiles: Set logfile and step columns correctly for substeps
Ian Jackson [Thu, 29 Jun 2017 12:02:24 +0000 (13:02 +0100)]
substep logfiles: Set logfile and step columns correctly for substeps

If we are running under sg-run-job, OSSTEST_TESTID will be set to the
testid of the parent step (ie, the step created by sg-run-job which
relates to the execution of the whole script).

Unless the caller has specified otherwise, the log and script are
the same as for the parent step.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agosubstep logfiles: Populate new logfile column, at all, for substeps
Ian Jackson [Thu, 29 Jun 2017 11:55:54 +0000 (12:55 +0100)]
substep logfiles: Populate new logfile column, at all, for substeps

For now we populate it with the sometimes-wrong value based on
$script.  In detail:

* Add a parameter $logfile to $mjobdb->step_start, which currently
  always gets passed undef.

* In JobDB::Executive::step_start, try to use it as the value for the
  new logfile column.  But, if it is not set (which is currently
  always the case), default it to "<stepno>.<script>.log".

  This is the same log filename currently assumed (and therefore used)
  by sg-report-flight.  So with current versions of sg-report-flight,
  this has no visible functional change.

This is part of a "Populate-then-rely" schema change, as described in
schema/README.updates.  Specifically, this is part of the step:

5. Commit: code to populate new column; changing `add' to status
   Needed and `constraint' to status Ready.

We don't set `constraint' to Ready yet because we haven't completed
the code to populate the new column.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agostep logfiles: Provide new column
Ian Jackson [Thu, 29 Jun 2017 11:43:00 +0000 (12:43 +0100)]
step logfiles: Provide new column

We will write things into it, and use it, soon.

This is the start of a "Populate-then-rely" schema change, as
described in schema/README.updates.  Specifically, the steps:
1. Commit: new schema update `add', status Preparatory
2. Commit: new schema update `constraint', status Unfinished

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agosubstep logfiles: Move defaulting of $script into Executive
Ian Jackson [Thu, 29 Jun 2017 15:56:24 +0000 (16:56 +0100)]
substep logfiles: Move defaulting of $script into Executive

We are going to want to default this here in a more sophisticated way,
but we can't do that if it's already been defaulted from $0 earlier.

The other consumer of this default was in JobDB/Standalone, but we
have just changed that to ignore it.  So, no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agostep logfiles: Standalone mode: Do not print uninformative $script value
Ian Jackson [Thu, 29 Jun 2017 11:08:48 +0000 (12:08 +0100)]
step logfiles: Standalone mode: Do not print uninformative $script value

Right now, this is sometimes wrong; even if it were right, it's not
going to be interesting in the transcript since the actual script name
is obvious from context.

Now this function does not care if $script is undef.

While we're here, fix the prototype (which is mostly commentary here,
as it is not used for method calls).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agostep logfiles: Break out $logfilename in two places
Ian Jackson [Thu, 29 Jun 2017 16:28:03 +0000 (17:28 +0100)]
step logfiles: Break out $logfilename in two places

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agodb write transactions: Make all INSERTs name columns explicitly
Ian Jackson [Thu, 29 Jun 2017 12:40:00 +0000 (13:40 +0100)]
db write transactions: Make all INSERTs name columns explicitly

This makes the code more robust against schema updates.  Specifically,
if any columns were to be deleted, these runes would break.  (Also if
any column was inserted other than after the existing columns,
although this is not something Postgres can currently do AIUI.)

Affected tables are:
  flights_harness_touched
  jobs
  resources
  runvars
  steps

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoschema updates: Be willing to apply Ready changes
Ian Jackson [Fri, 30 Jun 2017 15:19:06 +0000 (16:19 +0100)]
schema updates: Be willing to apply Ready changes

If the oldest code declares itself Ready for this change, or
(implausibly) Needed, then it is OK to apply.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoschema updates: mg-schema-test-database: Cope with applied updates
Ian Jackson [Thu, 29 Jun 2017 11:41:50 +0000 (12:41 +0100)]
schema updates: mg-schema-test-database: Cope with applied updates

The schema_updates table contents are written by the call to
mg-schema-update.  Trying to copy the contents from the source db
correctly fails with duplicate key errors.  So don't do that.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoschema updates: Document how to remove a used column
Ian Jackson [Thu, 29 Jun 2017 15:44:11 +0000 (16:44 +0100)]
schema updates: Document how to remove a used column

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoschema updates: Fix typo in developer doc
Ian Jackson [Thu, 29 Jun 2017 15:05:55 +0000 (16:05 +0100)]
schema updates: Fix typo in developer doc

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
7 years agoDeveloper docs: A rune for flight comparision
Ian Jackson [Thu, 29 Jun 2017 11:27:00 +0000 (12:27 +0100)]
Developer docs: A rune for flight comparision

Something like this rune can be useful for comparing testids of
different flights.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
7 years agocoverity: Switch to tools 2017.07
Ian Jackson [Wed, 28 Jun 2017 12:21:19 +0000 (13:21 +0100)]
coverity: Switch to tools 2017.07

The old tools are no longer working.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>