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>
---
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.
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>
---
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.
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 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.
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 --recordappend 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 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.
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.
Roger Pau Monne [Tue, 1 Aug 2017 08:17:16 +0000 (09:17 +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>
---
Changes since v2:
- Die if attempting to modify a host prop with intended blessing !=
real.
Make sure images copied to the tftp path have the right permissions,
so use dd instead of cp, which will obviously not preserve the
original permissions.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
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.
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.
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.
Add the missing pieces so that cr-daily-branch knows how to create a
FreeBSD flight. This has been tested by calling `./cr-daily-branch
freebsd-master`.
Note that there are two missing pieces. The first one is correctly
setting the FREEBSD_<arch>_BUILDJOB environment variable when calling
make-freebsd-flight, without it the installer media will always be
picked from the configuration file. This requires keeping track of
previous FreeBSD successful build jobs, marking them as permanent and
fetching them from the database in order to pass them on the env
variable.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v8.1: fix ap-fetch-version-old for the freebsd-* branch
(The remote branch has been changed to tested/master or
tested/stable/<version> instead of plain master or stable/11.)
Changes since v6:
- Set the path to the FreeBSD git trees in this patch.
- Push to tested/master or tested/stable/<version> instead of using
the same branches as the origin tree.
Changes since v5:
- Add support for testing multiple FreeBSD branches, default to
branch master.
Changes since v3:
- Fix the daily-cron-email-* settings for FreeBSD branch flights.
osstest: introduce a script to create a FreeBSD flight
The logic to create a FreeBSD build job is added to
make-freebsd-flight. This includes creating a FreeBSD build job, and
also testing the output of that build job (by creating another build
job that depends on the output of the first).
Note that the FreeBSD build job needs some input in order to setup a
FreeBSD host, and that can be fetched from different places:
1. Env variable FREEBSD_<arch>_BUILDJOB: use the output from a
previous build-<arch>-freebsd job.
2. Env variables FREEBSD_DIST and FREEBSD_VERSION: set before calling
into make-flight, provide the path to the installer image and sets
folder and the version being installed.
3. Config file FreeBSDDist and FreeBSDVersion: same as 2. except that
they are set on the config file.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v6:
- Re-wrap lines.
- Remove the freebsd hostflag.
- Do not set the FreeBSD git trees in this patch.
- Set all_host_os runvar to freebsd for the FreeBSD build jobs.
Changes since v5:
- Append the "freebsd" hostflag, the specific version will be set
dynamically by the ts-freebsd-set-hostflags script.
- Use FREEBSD_<arch>_BUILDJOB to set the freebsdbuildjob runvar.
- Loop around arches, although only amd64 is supported ATM. This
should make it easier to add more arches later on.
- Expand README comment to describe the expected layout of the
FreeBSD install media.
Changes since v4:
- Convert get_freebsdjob_runvars into set_freebsd_runvars, mimic the
behavior of set_hostos_runvars.
Changes since v3:
- Split the sg-run-job code into pre-patches.
Changes since v1:
- Replace freebsd_buildjob with freebsdbuildjob.
- Replace FREEBSD_SETS/IMAGE with a single FREEBSD_DIST that points
to a folder that should contain both things.
- Document the FreeBSDDist and FreeBSDVersion config file options in
the README file.
osstest: add support for FreeBSD buildjobs to sg-run-job
Add support and introduce a FreeBSD build job to sg-run-job.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v5:
- Add a '+' to the arguments passed to ts-freebsd-set-hostflags, so
they are hidden from testid.
Changes since v4:
- Use a switch in allocate-build-host.
Changes since v3:
- New in this version (split from existing patch).
Make need_build_host store a string instead of a boolean. This is
later going to be expanded to handle the FreeBSD build jobs.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v5:
- Use a regsub to set need_build_host.
- NB: I would prefer to keep the tolower instead of changing the
procs to -FREEBSD/-LINUX since I don't really like the SHOUTING.
Changes since v4:
- Fix the usage of the catching-otherwise blocks.
Changes since v3:
- New in this version (split from patch).
osstest: introduce a script to set the runtime hostflags runvar for FreeBSD jobs
Due to the nature of the FreeBSD install media, which is
self-generated from the ts-freebsd-build script, the hostflags runvar
set to FreeBSD jobs are related to the current version under test.
The following hostflags might need to be fetched from the runvars of a
previous build-$arch-freebsd job:
- share-build-freebsd-$arch-$hash: the $hash used here is calculated
from the checksum of the installer image used by this specific job.
This allows osstest to share FreeBSD build hosts, and be sure the
exact desired FreeBSD version is used.
- PropMinVer:Freebsd:$version: $version contains the major FreeBSD
version under test. This version is obtained from the FreeBSD
source code used to create the install media.
Note that the share-build-* hostflag is optional, and will only be set
for build jobs.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v5:
- Fetch the host idents from the arguments, instead of assuming
"host" always.
- Set PropMinVer:Freebsd:<version> instead of freebsd-<version> to
better cope with FreeBSD version bumps. This should only happen
every ~2 years.
Changes since v4:
- Make the share-build- flag optional.
Changes since v3:
- Make use of the set_runtime_hostflag helper.
- Make use of the sha256file helper.
This is required for FreeBSD, that will need to set some of the
hostflags at runtime. The current IDENT_hostflags will be keep as-is,
and they should only be set at job creation time.
Also introduce a helper to set the runtime hostflags.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v4:
- Allow runtime flags to be appended instead of overwritten.
In order to generate the FreeBSD installer image and the install
media.
The install sets are the vanilla ones generated by the 'ftp' release
target. The installer image is handcrafted based on the filesystem
created by the 'bootonly' target, which is then populated with the ssh
host keys, and setup in order to use the serial console. The other
difference from upstream FreeBSD installer images is that the one
built by osstest uses a ramdisk instead of relying on the installer
media to be somehow attached, either on a CD or USB drive. This is
required in order to boot the image from pxelinux (where no CD or USB
is actually attached to the host, and everything is fetched from
tftp).
Due to the nature of the FreeBSD build, the outputs are different from
what osstest expects from a buildjob, more specifically
path_freebsddist points to a folder that contains the several outputs
form this buildjob.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v4:
- Remove some useless comments.
- Use qw(git) instead of 'git'.
- Replace unicode nonbreaking space.
- Remove trail ','.
- Improve the way to fetch the version number.
Changes since v3:
- Introduce two helpers to perform the build process.
- Install packages using target_install_packages.
Changes since v2:
- Increase build target timeouts.
- Use sysrc instead echo to set rc.conf options.
Changes since v1:
- Remove the ts-build-check FreeBSD hack.
- Use pkg-static instead of pkg.
- Introduce buildcmd_stamped_logged_root and target_cmd_build_root.
- Use target_cmd_build_root and buildcmd_stamped_logged_root in the
ts-freebsd-build script.
- Fix the script snippets to use <<END.<<'END' in order to avoid
escaping the shell variables.
- Set path_freebsddist runvar to point to the folder where the build
files are stashed.
- Add a comment at the top of the file describing what runvars are
consumed/produced by the build script.
osstest: add support for the FreeBSD package manager
FreeBSD support is added to target_install_packages and
target_install_packages_norec, although there's no equivalent to the
--no-install-recommends in the FreeBSD package manager.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v6:
- Use $ho->{Os} in order to detect the target OS.
Changes since v5:
- Add prototype for package_install_cmd.
- Use $ho->{Ident} instead of hardcoding "host" in get_hostflags.
Changes since v4:
- Unify more code between FreeBSD and Debian: introduce an
OS-agnostic package_install_cmd to generate the install cmd.
Some steps of the FreeBSD build process need to be done as root, so
introduce some helpers to perform those steps:
buildcmd_stamped_logged_root and target_cmd_build_root. They behave
exactly the same as the non-root counterparts.
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.
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.
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).
osstest: move known_hosts generation to TestSupport
This is equivalent to the already existing authorized_keys function,
and generates the contents of the known_hosts file that should be
installed on targets.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Mon, 24 Jul 2017 16:48:36 +0000 (17:48 +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>
Ian Jackson [Fri, 20 Oct 2017 13:11:12 +0000 (14:11 +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>
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>
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>
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>
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>
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>
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:
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>
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>
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>
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
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
Ian Jackson [Wed, 21 Jun 2017 11:46:26 +0000 (12:46 +0100)]
sg-run-job: Abolish `anyfailed'
This is very similar to !$ok.
anyfailed is set to 1 only by catching-otherwise, which also then sets
ok to 0. The differences are solely some sites which set ok to 0
without setting anyfailed to 1:
(i) In run-job, if there are escaped steps
(ii) In run-job, if any steps were not run due to the skip_testids
or truncate_testids runvars
(iii) If a per-host-ts step fails
The only places where anyfailed was used were:
* To decide whether to do log capture in build jobs. This happens
before (i) and (ii); and (iii) is not applicable because it only
applies if $need_xen_hosts is nonempty which is never true if
$need_build_host is false. We can simply use $ok instead,
without any functional change.
* In printing a message to stdout at the end of the job.
We update this use site to use $ok and change the message
accordingly.
So overall, no functional change other than to a message in the
transcript.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Wed, 21 Jun 2017 11:40:39 +0000 (12:40 +0100)]
sg-run-job: Make catching-otherwise honour $ok
This is more regular and abolishes a number of explicit $ok tests in
run-job.
Of the call sites:
* "catching-otherwise blocked check-not-blocked" near the top of
run-job is soon after $ok is set, so NFC.
* The other call sites in run-job all test $ok explicitly, so NFC.
* The one call site outside run-job (in examine-host-examine)
contains only calls to run-ts, and to examine-host-install-* which
itself only contains similar calls. These all therefore honour $ok
already. So NFC.
While we are here:
* Add a doc comment.
* Do some slight whitespace fixups.
Overall, no functional change.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Thu, 15 Jun 2017 18:06:13 +0000 (19:06 +0100)]
sg-run-job: Spawn ts-syslog-server
Every job now gets a syslog server, which starts up after host
allocation.
The server's address and port are recorded by ts-syslog-server in a
runvar and can be used by subsequent test steps.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: Change mistaken TESTID `.' to `='. `.' means literally `.'.
Do not start ts-syslog-server if !$ok.
Do not start ts-syslog-server if job is being truncated now.
Use new | (stdin pipe) spawn-ts feature; avoids total failure.
Ian Jackson [Thu, 15 Jun 2017 18:05:50 +0000 (19:05 +0100)]
ts-syslog-server: New test script
This is a "complete implementation of the UDP syslog protocol".
In fact, the UDP syslog protocol is trivial: the UDP packets contain
newline-terminated unix text strings. We can simply chomp them and
log them (along with the sending address and port).
This script is designed to be run with the new "|" spawn-ts mode: it
will keep running until it is reaped.
Currently it is not part of any jobs.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Fri, 16 Jun 2017 16:40:04 +0000 (17:40 +0100)]
make-flight: Provide Windows 10 and Windows Server 16 guests with 3.5G of RAM
Paul advises that 4G may be needed, but we have some 8G hosts in
various places. If this is not sufficient in practice, we should
consider restricting the test to bigger hosts.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Wei Liu <wei.liu2@citrix.com> CC: Dario Faggioli <dario.faggioli@citrix.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Ian Jackson [Fri, 16 Jun 2017 15:55:26 +0000 (16:55 +0100)]
ts-windows-install: Provide guest with 32G of disk rather than 10G
Paul Durrant examined a VM after a migration failure and found it
short of free space with some essential services not running, and
conjectures that this is cauxed by disk shortage.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Ian Jackson [Wed, 14 Jun 2017 14:52:16 +0000 (14:52 +0000)]
mg-repro-setup: Use new syntax for cs-adjust-flight
In 497b2c6c933d "Rework runvar-build-set new value handling" we fixed
bugs in cs-adjust-flight which would make mg-repro-setup's attempt to
adjust build jobs sometimes not match at all, but we also changed the
syntax for specifying just a new flight. I forgot to update the
one in-tree user of that feature.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>