ssh_keyscan_wait: blocking version of ssh_keysscan
ssh_keyscan is designed to return almost immediately if there is no
connection (the timeout is 1 second). ssh_keyscan_wait will wait up to
10 minutes and report progress every 6 seconds.
Andrew Schoen [Mon, 13 Jul 2015 15:47:21 +0000 (10:47 -0500)]
Allow subclasses of task.Ansible to provide an inventory group name
Subclasses of task.Ansible can now provide an inventory group name to
assign all nodes to when creating a dynamic inventory.
This PR also makes ansible.CephLab use the group 'testnodes'. Without this,
teuthology can not run the testnodes.yml playbook against it's locked nodes
using a dynamic inventory as it's restricted to the testnodes group.
These were passing because we were calling Mock.assert_called_once(),
which never existed. In new versions of mock, that is an error -
exposing those tests which were not doing their job.
This should tell pip to use the latest version of packages (taking
pinning into account) - so that we can install newer versions of
packages that happen to be installed system-wide. This won't affect
libvirt-python as it is omitted from our list of requirements.
Ivo Jimenez [Wed, 8 Jul 2015 00:57:02 +0000 (17:57 -0700)]
Allows other users besides ubuntu
Hostname canonicalization using split() instead of RE.
Extends the semantics of canonicalization/decanonicalization routines so
that other user names can be specified. 'ubuntu' is still the default
but if other users are given on the 'targets' config option, those will
be used instead.
Ivo Jimenez [Tue, 7 Jul 2015 19:38:06 +0000 (12:38 -0700)]
Ensures that task list is a python list
* Modifies test for task list validation
* Shows contents of config['tasks'] for error msg
* Properly checks distinct failure conditions
* Fixes typo on kernel task AssertionError
get_latest_image_version_deb(): run apt-get update
When we were still using Chef, we accidentally ran it twice on downburst
VMs during scheduled jobs: once before the kernel task, and once after.
Now that we're using Ansible, and not running the one before, and
because the kernel task is special and runs before most tasks (even the
ansible task that might be part of the job), the kernel task might run
before apt has refreshed its cache. This is more likely to be a problem
on VMs, because their cache is certainly more stale, but could affect
physical hosts as well.
Make all deb-based systems update their cache before attempting to
install a kernel.
Loic Dachary [Mon, 29 Jun 2015 13:54:08 +0000 (15:54 +0200)]
list_locks must use 1 / 0 for True / False
Depending on the backend being used (sqlite or another), paddles won't
interpret locked=false as being the same as locked=0 (see
http://tracker.ceph.com/issues/12183 for more context).
Convert True to 1 and False to 0 to always get the same behavior from
paddles, regardless of the backend.
Andrew Schoen [Mon, 29 Jun 2015 22:28:12 +0000 (17:28 -0500)]
bootstrap: add an install flag that installs missing required packages
If you run ./bootstrap install the script will install any missing
packages needed to complete the bootstrap. This feature requires that
the user running ./bootstrap have sudo privileges.
Andrew Schoen [Mon, 29 Jun 2015 14:34:02 +0000 (09:34 -0500)]
Better logging when looking for a package version in the install task
I think this used to be a wget call, so the url we were requesting to
fetch the package version would be logged by that wget call. Since
we've changed that call to use requests and lost that logging, this adds
some of that logging back.
Andrew Schoen [Thu, 18 Jun 2015 16:57:45 +0000 (11:57 -0500)]
Enable the Ansible task to optionally cleanup after itself.
If given the config value of ``cleanup`` the ansible task will rerun the
same playbook during the teardown stage with a ``teardown`` var added
with a value of True. This will allow the playbook to cleanup after
itself during teardown, if the playbook supports this feature.
Ilya Dryomov [Wed, 17 Jun 2015 16:40:57 +0000 (19:40 +0300)]
suite: don't try to check ceph packages against kernel flavor
The whole kernel_flavor check in schedule_suite() is completely wrong.
ceph packages and kernel packages are built on different gitbuilders
and so a set of ceph flavors is distinct from a set a kernel flavors
(they happen to intersect because both have a 'basic' flavor but that's
it). Querying ceph gitbuilders with kernel flavor (which is what it
currently does - has_packages_for_distro() talks to ceph gitbuilders)
is useless and only worked because the only kernel we currently care
about and use in qa is 'basic' kernel. Remove the for i in set(...)
construct and only check install task (i.e. ceph) flavor.
Also, crucially, do not make an empty dict a kernel task config in
!kernel_hash (i.e. "do not install any kernel") case. This makes
kernel task install a default version of the kernel (branch master) on
all remotes.
Both of the above are partial reverts of commit 9968c366b17f ("Also
check install task's flavor when scheduling").
Ilya Dryomov [Wed, 17 Jun 2015 11:29:40 +0000 (14:29 +0300)]
suite: append flavor key only if kernel version is specified
There are three cases: a) don't install a kernel, b) install a distro
kernel or c) install a specified version. Appending 'flavor: basic' to
kernel task config in the former two cases is wrong. In case a)
appending flavor is not only bogus but also leads to bug: a { 'kernel':
{ 'flavor': 'basic' } } config confuses kernel task and it installs
a default version of the kernel (branch master) on all remotes when the
user's intent was to not install any kernel. As for case b), distro
kernels are built by distros and don't have flavors.
Fix this by appending 'flavor: basic' to kernel task config only in
case c).