Improve Autopkgtest task to use lxd and qemu backends
User story
The current implementation of the Autopkgtest task only supports the schroot backend and relies on pre-existing schroots. We want to change this to supply the test environment as part of the task's input data and be able to use the lxd and qemu backends too.
Implementation plan
Until we have support for some way to convert a distribution name into the corresponding image artifact, we should add a new image_artifact_id key in task_data that would point to the artifact that we want to use for the test environment. It's up to the user to supply an artifact that is compatible with the desired backend. If the backend is "auto" and the user supplied a specific image_artifact_id, then figure out from the artifact category what backend can be used (debian:system-tarball -> lxd, debian:system-image -> qemu).
-
Implement support for lxd backend -
Implement support for qemu backend -
Drop support for the schroot backend? -
Update the task documentation to match new reality
Support for lxd
autopkgtest-build-lxd is able to convert a pre-existing generic purpose image into an image that is suitable for autopkgtest so we should likely do that locally instead of requiring the user to supply a very specific image.
We could have a "debusine-artifact-XXX" image that is created by importing the user-supplied debian:system-tarball and then converted into an "autopkgtest-XXX" image. If one or the other image is already existing locally, we can save some download/conversion time. (We might build a temporary image that embeds the distribution name so that logs are more explicit about distribution that is inside the image)
Support for qemu
autopkgtest-build-qemu has no similar feature, the image must be prepared specifically for autopkgtest. We expect to prepare such images with the SimpleSystemImageBuild task and some custom customization_script that would call /usr/share/autopkgtest/setup-commands/setup-testbed in it.
Open questions
- None so far.
Notes
This issue description can be modified to integrate feedback from comments and from associated merge requests.