Commit Graph

2147 Commits

Author SHA1 Message Date
Gregory Haynes
cb15e7ef33 Prioritize venv python on host
If we are being run from a python 3 virtualenv where python2 is also
available on the host we will use the hosts' python2 over the virtualenv
python3 (even if the virtualenv is higher precedence in PATH).

Change-Id: I9a25b9e45845a4121aab8250fd53c6f006825742
2016-02-28 20:50:02 -08:00
Jenkins
103b7dea6d Merge "Fix building on gentoo hosts" 2016-02-27 14:44:46 +00:00
Jenkins
de4d0392d5 Merge "Install IPA in a virtual environment" 2016-02-26 16:23:37 +00:00
Jenkins
8e9c54d01a Merge "Rework functional test runner" 2016-02-23 00:28:08 +00:00
Jenkins
cebdba1f9c Merge "Revert "Correct rhel-common for rhel6"" 2016-02-22 16:57:40 +00:00
Matthew Thode
dacfc23c36
Fix building on gentoo hosts
This patch fixes the profile autodetect.  If the profile was passed at install
time, it would overridden by the environment.d script.  This was fixed by
accepting the value passed by the user, if one was passed.

The enviroment.d file is run outside of chroot, because of this eselect will
not be available on non-gentoo systems.  We change the behavior to work
elsewhere, it was not working on non-gentoo systems and giving bad results on
gentoo systems (returing values from the host, not the guest being built).

This patch also fixes shm detection by checking if it is mounted already.

Change-Id: Ie58d8e19529a731bfbc9eeb4bb246988d1aaa772
2016-02-21 22:46:13 -06:00
Ian Wienand
b18f71f781 Rework functional test runner
This simplifies and enhances the functional-test runner script for
much better interactive behaviour and to give us the ability to better
choose what is running in CI.

Firstly, I have split the image-output testing into a separate script.
This is not actually part of the functional testing of elements and is
both logically and functionally different.  It currently does not run
in upstream CI because we don't have docker in the images.  I have
nothing against it, but it can be it's own thing.

run_functests.sh is overhauled to have a useful interactive interface,
e.g.

---
 $ ./run_functests.sh -h
 run_functests.sh [-h] [-l] <test> <test> ...
   -h : show this help
   -l : list available tests
   <test> : functional test to run
            Special test 'all' will run all tests

 $ ./run_functests.sh -l
 The available functional tests are:

  apt-sources/test-sources
  debian/build-succeeds
  fedora/build-succeeds
  fedora/build-succeeds-f21
  ironic-agent/build-succeeds-fedora
---

As described there, you can run a single test, a number of tests, the
default tests (as CI will do) or all tests.  Running all tests is too
much for regular CI, but currently the only way to stop a low priority
test running, or temporarily pause is to remove it completely --
clearly sub-optimal (see I93c2990472e88ab3e5ff14db56b4ff1b4dd965ef).

There is nothing complicated about this, and to further simplify I
have merged the runner functions back into run_functests.sh which
remains a very modest ~150 lines, with most of that being argument
sanity.  With that and the image-format cleanup, we can remove the
indirection of the 3 small library files.

For consistency, I have renamed the "dib_functions_test" (that tests
things from the dib functions library) with a run_* prefix.

Because the default list is the same as the current functional tests
run, this does not modify the status-quo.  I plan to modify this,
however, to run fedora-minimal & centos-minimal tests in a future
change, as these are required to be stable for openstack ci.

Documentation is updated, and a README.rst is added in the tests
directory for discoverability.

Change-Id: I86d208bd34ff09a29fdb916a4e7ef740c7f65af8
2016-02-19 13:50:09 +11:00
Jenkins
05edfb6d20 Merge "Don't remove python3 & grubby in 99-remove-extra-packages" 2016-02-19 01:46:38 +00:00
Ben Nemec
a342036e75 Revert "Correct rhel-common for rhel6"
This is breaking deployments that use registration.  I
believe os-refresh-config scripts don't source environment.d
files, so the variable is unset there.

Given that this a blocking issue for RHEL deployments, I'm
pushing a quick revert and we can come up with a proper fix
when this isn't stopping other work.

This reverts commit 71bd8b3a33.

Change-Id: I87504660352220d45f5445bb933edc1c28885fcb
2016-02-17 22:17:11 +00:00
Jenkins
352e58ceb7 Merge "yum-minimal: pre-install base packages" 2016-02-17 00:25:08 +00:00
Jenkins
b52e8f3a3b Merge "Fix tar listing in functional tests" 2016-02-16 23:45:27 +00:00
Lucas Alvares Gomes
006b3e6228 Install IPA in a virtual environment
In order to avoid conflict with installing dependencies for IPA from
pypi and distribution packages this patch propose installing IPA in a
virtual environment.

Closes-Bug: #1506792
Change-Id: I6a4c6403813d86f4110e98449ddd874109101b9e
2016-02-16 11:17:12 +00:00
Ian Wienand
b960614c9c Don't remove python3 & grubby in 99-remove-extra-packages
python3 is a hard requirement of dnf so can't be removed [1]

grubby is also required for kernel installs on Fedora.  For too much
detail see I1a6e45d04755515286b3d49f8280c16b527e2f48; but the kernel,
via dracut, now has this as a "recommends" due to people removing it
and making unbootable systems.

[1] http://logs.openstack.org/76/248976/2/check/gate-dib-dsvm-functests-devstack-f21/734c8bd/console.html

Change-Id: I5867ecd57834eece9477aa9ea4b8bdd70e238084
2016-02-16 13:40:01 +11:00
Jenkins
9e16c8c5f1 Merge "Use dnf to cleanup old kernels" 2016-02-15 22:56:12 +00:00
Jenkins
99d9373eca Merge "Fix dpkg element for Ubuntu Xenial" 2016-02-15 20:33:35 +00:00
Jenkins
6f6a096d94 Merge "Handle install with pip -e" 2016-02-12 20:28:51 +00:00
Jenkins
afd2eec60e Merge "Remove eclean-dist as it's not available by default" 2016-02-12 16:31:26 +00:00
Jenkins
e88792a3ed Merge "Increase interface has link retries to 20" 2016-02-12 08:26:09 +00:00
Jenkins
dcf2c4f261 Merge "Reorder the package-uninstall action" 2016-02-12 04:04:14 +00:00
Jenkins
5036ad6baf Merge "Do not remove python-dev from ironic-agent image" 2016-02-12 04:04:08 +00:00
Jenkins
4136479bd0 Merge "Fix startup race with growroot/systemd" 2016-02-12 04:03:55 +00:00
Matthew Thode
0ab0f69ce3 Remove eclean-dist as it's not available by default
Gentoo provides eclean-dist via the gentoolkit package
eclean-dist isn't needed anyway was /usr/portage is removed anyway

Removed redundant package update in cleanup.

Change-Id: Icf4f9ed549b9a6d923448d927d7c42bcf8d6091b
2016-02-12 00:31:27 +00:00
Matthew Thode
22ef95c1a1
Reorder the package-uninstall action
This action has been reordered so cleanup can occur before copy to blockdev
occurs.  Documentation has been added about the ordering of this element in
relation to cleanup actions as well.

Change-Id: I3f9334a3669ee588d7fa7129202c97fa22fdb050
2016-02-11 18:30:05 -06:00
Dmitry Tantsur
1f9e669dbc Do not remove python-dev from ironic-agent image
While it does save 1MiB of space, it might also pull python packages
depending on it. E.g. it makes impossible to install python-hardware
on the IPA image for advanced introspection.

Change-Id: Iab80dde63e6de62a5e45dcf404b4f9f633e50ac3
2016-02-11 13:47:31 +01:00
Jenkins
1cd7ca70d8 Merge "Correct rhel-common for rhel6" 2016-02-11 04:49:35 +00:00
Ian Wienand
349e8db2f7 yum-minimal: pre-install base packages
We were getting some subtle issues in fedora-minimal builds that
turned out to be because /var/run was not a symlink to /run.

Upon further investigation, it turns out that yum is creating a
/var/run directory for it's pid file when it starts working in the
empty chroot (which I verified by stracing it)

---
5905  stat("/home/ubuntu/tmp/dib-tmp/image.Ac4VZZsl/mnt/var/run", 0x7ffddffa0330) = -1 ENOENT (No such file or directory)
5905  mkdir("/home/ubuntu/tmp/dib-tmp/image.Ac4VZZsl/mnt/var/run", 0755) = 0
5905  open("/home/ubuntu/tmp/dib-tmp/image.Ac4VZZsl/mnt/var/run/yum.pid", O_WRONLY|O_CREAT|O_EXCL, 0644) = 6
---

Because this happens *before* we install "filesystem" (the package),
we mess up it's symlinking.

To work-around this, pre-install the trio of base packages (setup,
basesystem, filesystem) with rpm from outside the chroot.

Change-Id: I411b6ec9d91d95d3a0f98e76853086af3b70abe8
2016-02-11 15:42:10 +11:00
Jenkins
11bc493808 Merge "py26 is no longer supported by Infra's CI" 2016-02-10 23:36:37 +00:00
Jenkins
536b86fe09 Merge "Mark ironic-discoverd-ramdisk as deprecated in favor of ironic-agent" 2016-02-10 22:48:42 +00:00
Jenkins
910a99c3ca Merge "Fix growroot for Gentoo's openrc" 2016-02-10 21:50:50 +00:00
Colleen Murphy
a9b38d0b60 Fix dpkg element for Ubuntu Xenial
The Ubuntu Xenial cloud server images set the mode of
/var/lib/apt/lists/partial to 700, so when mounted it's inaccessible to
an unprivileged user, resulting in an error:

  find: `/tmp/image.aDQKdkRi/mnt/var/lib/apt/lists/partial': Permission denied

There's no reason an image should come with anything already in
/var/lib/apt/lists/partial, so just avoid trying to descend into that
directory when fixing the apt translations packages.

Change-Id: Id27f0166bfb09d67200f337a5ffff2f2037b7c1c
2016-02-10 12:50:43 -08:00
Jenkins
b13512a7f4 Merge "Only match #!/bin/bash in scripts" 2016-02-10 08:35:09 +00:00
Ian Wienand
9cd35c36e4 Fix startup race with growroot/systemd
Tucked away in systemd-udev-settle.service is the following comment

 # This service can dynamically be pulled-in by legacy services which
 # cannot reliably cope with dynamic device configurations, and
 # wrongfully expect a populated /dev during bootup.

The info that the growroot script is querying is populated via udev,
particularly the blkid bits of [1].  This creates a race-condition
where sometimes udev has been triggered and the rules have applied and
sometimes not.  Obviously in the first case, the root disk is not
grown correctly.

systemd-udev-settle is mostly disabled on distros because it can cause
an increase in boot-time for systems with lots of disks; this is not
our situation so it makes basically no difference.

That said, I will investigate if some systemd people know even better
ways to do this (possibly the service should depend on block .device
targets in systemd, and then filter out and only apply to the root
disk?)

[1] https://github.com/systemd/systemd/blob/master/rules/60-persistent-storage.rules#L66

Change-Id: I453e3afcd953dfc29ab6c42ddc81e940cfa70ee0
2016-02-10 13:47:18 +11:00
Jenkins
a69dd548a7 Merge "Make dkms element depend on dkms package" 2016-02-08 20:17:26 +00:00
Gregory Haynes
6ab5078d0f Switch simple-init to pip-and-virtualenv element
We currently install pip from package in the simple-init element.
We should really allow users to select whether to install pip from
git or package.

Change-Id: Ia5e62b9635af90d81227274a1dd8f20474cdbf73
2016-02-08 16:58:14 +11:00
Ian Wienand
cb0e0e903d Use dnf to cleanup old kernels
As described in the comment, there is a dnf equivalent of this command
that doesn't require us installing yum-utils (which drags in yum on
dnf-only systems such as f23)

This is a small consequence to this -- due to us not installing
yum-utils some installs will now be completely yum free.  This causes
a breakage in ironic-agent 99-remove-extra-packages where we remove
the yum package.  There is a long-standing bug/feature where missing
packages in a group of packages do not cause yum/dnf to exit with
failure, but uninstalling a single package will.  Because we have made
the systems yum-free, the uninstall of yum can fail in this corner
case.

It has always been like this, so I'm in favour of the "ain't broke"
approach.  To work-around this, I have just put yum into the existing
list of packages to be cleaned up.  I have added a note to the yum
installer taking note of this behaviour for future reference.

Change-Id: I8bbdc07ccdb89a105b4fc70d5a215077c42fcd03
2016-02-08 14:20:56 +11:00
Moshe Levi
a1d32c6d51 Increase interface has link retries to 20
InfiniBand interface takes more time to bring up then
Ethernet interface. This patch just increase the retries
to 20 times, to make it work for InfiniBand as well.

Change-Id: I5c4842696207885552413ea2d053f2e90bd6803c
2016-02-07 16:28:52 +02:00
Matthew Thode
9878469a53
Fix growroot for Gentoo's openrc
Let dib-init-system's postinstall handle enabling init scripts.

Change-Id: I7b0d235327021b7f478cdb9715d533b444843699
2016-02-04 23:41:45 -06:00
Jenkins
5ee1cbac4a Merge "Add support for OpenRC to dib-init-system" 2016-02-05 04:15:53 +00:00
Jenkins
50f7b00a54 Merge "Add support for gentoo to simple-init" 2016-02-04 08:00:47 +00:00
Ian Wienand
f82cfb156a Fix tar listing in functional tests
I noticed when running functional tests via a interactive shell they
would end up hanging; I tracked it down to waiting for input on this
tar command.  We need to specify "-f" so it opens the file ...

---
 | + tar -t /tmp/tmp.qid2Ygfu7v/image.tar
 | + grep -q /tmp/dib-test-should-fail
 | tar: This does not look like a tar archive
 | tar: /tmp/tmp.qid2Ygfu7v/image.tar: Not found in archive
 | tar: Exiting with failure status due to previous errors
---

I guess we never noticed because it's always running in CI where stdin
is closed and it just get that nothing read above.  This probably was
reversing the logic of the "should have failed" tests ... but I don't
think we take that path currently for any tests.

Change-Id: Idad2c172797395d45c0d750ec687011cc1fbf52a
2016-02-04 15:50:25 +11:00
Jenkins
1dcd65fb9e Merge "Print unparsable file in pkg-map" 2016-02-04 04:47:20 +00:00
Matthew Thode
265b31e6b5
Add support for OpenRC to dib-init-system
Adds a post-install function that enables installed initscripts,
as that is not done by default in gentoo.

Change-Id: I04e8d506ddcbefa8a983dd31ad16df5e13cb26e7
Closes-Bug: 1539276
2016-02-02 17:23:35 -06:00
Jenkins
4526cf23ec Merge "Fix Gentoo hardened support" 2016-02-02 20:49:30 +00:00
Jenkins
66184b7b40 Merge "Add new cloud-init element" 2016-02-02 20:49:03 +00:00
Jenkins
cd3c704fbf Merge "Fix package-installs for python3" 2016-02-02 03:16:12 +00:00
Jenkins
d57dd19c2c Merge "Remove outdated translation files" 2016-02-02 03:16:05 +00:00
Jenkins
893b452b11 Merge "Add Gentoo support to growroot" 2016-02-02 03:15:22 +00:00
Jenkins
4cb6bed971 Merge "Add support for Gentoo to source-repositories" 2016-02-02 03:15:16 +00:00
Matthew Thode
a2d4af9541
Add new cloud-init element
Allows for composable builds from a minimal source.

Change-Id: I16f560ca4b1737c0928f3f3b15ea2580df820e97
Closes-Bug: 1539272
2016-02-01 21:03:03 -06:00
Matthew Thode
01fce7b70c
Fix Gentoo hardened support
This checks the profile, if it has hardened in it's name it needs xattr support
unfortunately xattr support cannot yet be relied on everywhere, so it needs to
be disabled for hardened profile builds to correctly pax-mark.

Change-Id: I7fb855249a9e6c9b6497ab5061b4ea3c014f5081
Closes-Bug: 1537177
2016-02-01 20:56:37 -06:00