tools/autopkgtest-build-lxd: pass /dev/null on stdin to lxc launch
Recent changes to lxd cause 'lxc launch' to fail if there is any input on
stdin queued, which is the case (at least) during the 'lxd' autopkgtest
included in this package, which calls autopkgtest-build-lxd from a here
document passed to a shell. It may be the case for other external uses as
well, so it's best to leave the 'lxd' autopkgtest as is and fix the
autopkgtest-build-lxd script to use lxc launch with the new restriction.
The only other call to 'lxc launch' is from autopkgtest-virt-lxd, which
passes it to check_exec(), and that function explicitly sets stdin to
/dev/null, so no change is needed there.
New changelog entries:
* tests/adt-run: Filter out $ADT_NORMAL_USER from the chroot tests; we don't
want this set when testing autopkgtest from within autopkgtest. Fixes a
test failure when running our own autopkgtests. Cherry-pick of upstream
commit cbac10742cc44d66c82ee9776157273a5cce7a59 (LP: #1686082)
New changelog entries:
* setup-commands/setup-testbed: Fix kernel header installation for
precise/armhf, which does not yet have linux-headers-generic.
* Use "nproc" to determine the number of processors available, which is both
more correct in a cgroup world, and also simpler.
* Add new --build-parallel=N option to explicitly set the "parallel=N"
$DEB_BUILD_OPTION for building packages, to override the default of
"number of available CPUs". This is mostly useful in containers where you
can restrict the available RAM, but not restrict the number of CPUs.
(LP: #1569750)
* setup-commands/setup-testbed: ubuntu-snappy got renamed to snapd, adjust
package name.
* adt-build-lxd: Set "distribution", "release", and "architecture"
properties of generated images.
* adt-build-lxd: Clean up all old images of the same distro/release/arch,
not just the previous one. Also fix cleanup to work in non-English
locales.
* setup-commands/setup-testbed: Call apt-get purge only once with the list
of all packages, instead of once per package. This is much faster.
* SchrootClickRunner tests: Chown click dir in /opt after creating the user.
* Bump Standards-Version to 3.9.8 (no changes necessary).
* Update Vcs-* URLs.
New changelog entries:
* Makefile: Install SKELETON after the programs (which use an [a-z] glob),
as the latter behaves differently in different locales. Thanks Alexis
Bienvenüe! (Closes: #820148)
* adt-buildvm-ubuntu-cloud: Use https for cloud image download.
(LP: #1566846)
* setup-commands/setup-testbed: Purge ubuntu-snappy.
* adt-virt-qemu: On AMD CPUs, default to -cpu host instead of
"kvm64,+svm,+lahf_lm". This introduces more jitter, but is the only -cpu
mode that actually allows nested QEMU with current QEMU versions.
* adt-build-lxd: Force-delete preparation container at the end, even if it
is running.
* adt-build-lxd: Disable apt proxy configuration with ADT_APT_PROXY=="none".
New changelog entries:
* setup-commands/setup-testbed: Purge lxc-common for testbed preparation.
* adt-buildvm-ubuntu-cloud: Use the same code for determining the default
qemu-system-* command as adt-virt-qemu. This adds support for ppc64el and
other architectures. (Closes: #818892)
* adt-buildvm-ubuntu-cloud: If ifnames was disabled for the initial boot,
keep it disabled for subsequent boots instead of changing to ens3. This
fixes building images for Ubuntu 15.04.
* lib/VirtSubproc.py, cmd_reboot(): Drop workaround for dhclient hanging on
reboot, LP #1556175 got fixed.
* setup-commands/setup-testbed: Ensure that purging packages does not hang
eternally on debconf prompts.
* setup-commands/setup-testbed: Drop purging of xkb-data.
* setup-commands/setup-testbed: Apply "vmalloc=512M" grub change also when
using as a --setup-commands with adt-run, not only with building images.
Fixes tests like udisks2 on i386 when using standard cloud images.
New changelog entries:
* When testing click packages, don't regenerate all AppArmor profiles if
/var/cache/apparmor/click-ap.rules already exists. That way the profiles
can be pre-adjusted once in a testbed instead of once for each test run,
which greatly speeds up iterations. (LP: #1553797)
* Move SshRunner* tests from lxc to lxd.
* NullRunner.test_tree_output_dir test: Only check for cpu_{model,flags} on
x86 and ARM, as these need parsing adjustments on other architectures.
* Disable lxd autopkgtest for now, this still needs some way to set a proxy.
* lib/VirtSubproc.py, cmd_reboot(): Add workaround for dhclient hanging on
reboot (see LP #1556175).
* Fix regular expression for removing profile guarded dependencies on hosts
that don't support build profiles.
* adt-virt-lxc: Suppress lxc-copy's stdout in the "no btrfs" fallback case.
(Closes: #818185)
New changelog entries:
New features/behaviour changes:
[Martin Pitt]
* adt-virt-lxd: Launch containers in ephemeral mode.
* adt-virt-lxc: Use the new lxc-copy if available, as lxc-clone and
lxc-start-ephemeral got deprecated by that. This now supports reboots in
ephemeral mode.
* adt-virt-lxc: Add --name option. This allows CI systems to use a more
expressive name than the autogenerated adt-virt-lxc-XXXXXX, to make it
easier to map a container to a running test.
* Add CPU information to testinfo.json: "nproc" (#cpus), "cpu_model", and
"cpu_flags". (LP: #1552129)
* Add autopkgtest for adt-build-lxd and the lxd runner.
[ Christian Seiler ]
* Support nested KVM by default by emulating a CPU with VMX/SVM support on
x86_64. (Closes: #800845, part 1)
* adt-virt-qemu: Provide read-only version of the VM image to the test as
/dev/baseimage, for tests that want to run nested QEMU. (Closes: #800845)
Bug fixes:
[ Martin Pitt ]
* setup-commands/setup-testbed: Ensure that removing cruft does not remove
cloud-init. (LP: #1539126)
* setup-commands/setup-testbed: Purge lxd and lxc.
* adt-virt-lxc: Don't fail on deprecation warnings of lxc-clone and
lxc-start-ephemeral. (LP: #1549995)
* Run external commands with /dev/null as stdin. This has always been
intended, but has not actually been done for a while.
* Drop support for hook_forked_inchild() in virt-runners. This has never
been used.
* ssh-setup/nova: Try and prefer novaclient.v2 API first, and fall back to
v1_1. (LP: #1552730)
* Correctly ignore positive and negative build profiles with too old
libdpkg-perl that does not support them yet.
* tests/run-parallel: Don't run NullRunner and SchrootRunner tests in
parallel, as they collide with a bind-mounted /tmp.
* test_reboot_prepare testcase: Don't compare the host and guest kernel
versions in the QemuRunner.
* Keep and export $ADTTMP and $ADT_ARTIFACTS in debug shells.
(Closes: #814115)
* setup-commands/*: Add shebang headers to quiesce lintian.
* Bump Standards-Version to 3.9.7 (no changes necessary).
* Add debian/source/format (3.0 native).
* debian/control: Use https Vcs-* links.
* Bump debhelper compat level to 9.
* adt-virt-qemu: Don't assert result of "runlevel" for connection test. This
is a race condition under systemd as getty starts before default.target
is fully finished.
* tests/adt-run SchrootClickRunner: Ensure that the "click" system user
exists in the schroot, so that it doesn't need to exist on the host.
* Adjust SchrootRunner.test_apt_pocket_pkg_with_proposed_dep test case for
apt 1.1.
* Latest LXD now adds an "images" remote for images.linuxcontainers.org by
default. Adjust adt-build-lxd.1 and adt-virt-lxd.1 accordingly.
* Respect $TMPDIR when creating the downtmp and some other directory/files.
(Closes: #817190)
* tests/adt-run: Symlink real ~/.config/lxc into the temporary $HOME, to
avoid regenerating the LXD client certificate for each test.
[ Christian Seiler ]
* setup-testbed: reduce grub timeout on images that don't already configure
this in /etc/default/grub.d (like vmdeboostrap).
* adt-virt-qemu: Use correct qemu-system-i386 command on i[3456]86 systems.
* Fix spelling errors in manpages.
New changelog entries:
* setup-commands/setup-testbed: Avoid dpkg conffile prompts.
* adt-virt-lxc: Call lxc-stop and lxc-destroy with --quiet, to fix breakage
due to unexpected output with LXC 2.0.
* adt-virt-lxc: Redirect lxc-destroy stdout, to work around LP #1543016.
* Ignore build profiles on too old libdpkg-perl versions also when building
the tested package.
* adt-virt-lxd.1: Standard images from linuxcontainers.org stopped having
"deb-src" apt lines by default. Document that standard setup commands are
required for this and adjust examples accordingly.
* adt-virt-lxc: Factorize cleanup code.
* adt-virt-lxc: Run lxc-{start,stop} under "timeout" when running through
sudo, as killing these on timeout does not work.
* ssh-setup/nova: Wait until instance is actually ready before sending
access info.
* ssh-setup/nova: Show instance's console log on ssh or cloud-init timeouts,
as that's very useful for debugging.
* adt-virt-lxd: Drop redundant "lxc stop", just call "lxc delete --force".
* adt-buildvm-ubuntu-cloud: Bump default image size from 4 to 20 GB.
* runner/adt-run: Install ca-certificates along with git, to ensure that
https URLs can be cloned.
* tools/adt-build-lxd: Add workaround for broken "lxc file push" permissions
(LP: #1548878)
New changelog entries:
* Fix "apt-get source" version detection:
- Ignore source record "Binary:" entries which are not actually binaries
of that source.
- Take the highest source version of all encountered binaries. In other
words, as soon as apt pinning uses one package from -proposed, use the
tests from -proposed too.
- Only consider binaries which exist in all releases. This avoids newly
introduced binaries (library transitions, new kernel versions) to skew
the intended apt pinning as they would always win the "highest version"
check from above.
* Install /usr/share/autopkgtest/setup-commands/* scripts as executable, to
make them work for vmdebootstrap --customize. (Closes: #810862)
* ssh-setup/nova: Use extended RE for matching --image pattern.
* setup-commands/setup-testbed: Fix handling of options in sources.list.
* tools/adt-build-lxd: Fix parsing of release name from apt sources with
options if lsb_release is not available.
* setup-commands/setup-testbed: Regenerate initramfs when adding udev rule
for disabling ifnames (for chroots).
* adt-buildvm-ubuntu-cloud: Drop duplicate sed of cloud-init.prerm.
* adt-buildvm-ubuntu-cloud: Don't try to run "None" if --post-command is not
given.
* adt-virt-lxc: Add timeouts to all LXC operations.
* Fix chowning for "rw-build-tree" restriction: run it as root if available,
and otherwise ignore it entirely. (LP: #1535234)
* Drop apt-cache showsrc --only-source option, as this is not yet understood
by Ubuntu 12.04's apt.
* VirtSubproc.py, execute_timeout(): Avoid UnicodeDecodeErrors when called
programs send gibberish. Decode manually with "replace" error mode
instead. (LP: #1535741)
* adt-virt-lxc: Avoid unnecessary reading and decoding of program outputs if
we don't actually use it.
* ssh-setup/nova: Use the image with the latest "created" time, instead of
the last lexicographic name.