Open ajeddeloh opened 5 years ago
It's worth noting that we should also refactor the existing tests to have a generalized input disk so that we can ideally use a single image created by the test runner. Ideally I think the runner should have the functionality to detect the input disks and create an image for each unique input disk so that if we need a custom input set in the future it's possible, but for an initial refactor generating a single image will likely be a sizable time saving.
Feature Request
Background
Currently the blackbox tests are somewhat terrifying, albeit fast. They run directly on the host, as root, with no isolation except that we use loopback devices. This means working on the test runner itself is particularly fragile and makes it easy to leak disk images all over
/var/tmp
. It also means running the tests in a container is very hard.Proposal to experiment with
Run each test in its own (very minimal) vm via qemu (not libvirt, more on that later). The vm image would be three parts: 1) kernel: something minimal that boots to the initramfs very fast. There are a lot of tests, so speed savings here actually matter quite a bit 2) initramfs: probably generated by dracut but with custom dracut modules only. We actually don't want to switch root, we just want something to build a minimal filesystem. We don't want any other cruft that might interfere with the tests either. We basically want udev rules, systemd, something for networking (more on that later), and ignition + the tools it needs. 3) input disk images: This should be generated by the test runner and have a bare skeleton of a linux filesystem (just enough to run things like
useradd
with the--root
flag and other things Ignition does), plus whatever input files are needed for the tests. Additionally we should have a secondary disk to attach for testing things like partitioning.Generating the initramfs:
Running the tests
/dev/kvm
mounted in). Probably the same container we use to build the initramfsNetworking
ip
commands to set up the bare minimal networking we need. Again, I want to emphasize we should have the bare minimum to reliably reach the test infra's http/tftp servers and nothing morecc @arithx since we chatted about this, let me know if I missed something