Draft: setup-testbed: Don't preinstall dpkg-dev
-
tests: Mostly configure extra apt sources instead of overwriting
If we want autopkgtest to work with increasingly minimal containers in order to be able to detect bugs like #1098508, then it will sometimes need to install packages on a just-in-time basis in order to carry out functionally necessary actions like unpacking the package under test.
To accommodate this in tests that work with a family of additional packages, we should add the test archive as an overlay (analogous to how we would use Debian experimental or backports) instead of overwriting the image's configured apt repo completely. This is a closer match for what will happen in reality: in the real world, we would not test a locally-built package in an environment where basic Debian/Ubuntu packages like dpkg-dev are neither installed nor available for installation.
-
tests: Install dpkg-dev before sabotaging the apt configuration
We usually need dpkg-dev installed during testing, in order to be able to unpack the source code for the package under test. In test-cases where we sabotage the apt configuration in order to detect how autopkgtest responds to that, it wasn't really our goal to find out what happens when we fail to install dpkg-dev, so preinstall it.
-
setup-testbed: Don't preinstall dpkg-dev
We will often need this installed in order to unpack source packages (from apt or from a .dsc file on the command-line), but for a more minimal chroot/container/VM it's desirable that we avoid preinstalling it and only install it on-demand. Otherwise, we will be unable to detect packages that are missing a test-dependency on dpkg-dev or its dependencies, notably perl and make.
At the moment, if autopkgtest-virt-unshare is allowed to bootstrap a tarball automatically, it does not run setup-testbed and therefore does not include dpkg-dev in the container, but the various tools to set up testbeds (such as autopkgtest-build-qemu and -podman) will run setup-testbed and therefore include dpkg-dev in the container.
See also #1098646.
This reverts commit a4165889 "setup-commands/setup-testbed: Install dpkg-dev".