Booting Generic Systems in QEMU Tests using NixOS Tests?

The NixOS tests are able to be built with the machine attribute defining a NixOS system. But what if instead of booting NixOS, one wants to boot a generic image for a systemd based distribution such as Ubuntu/Fedora? I think the NixOS testing framework could be useful in these contexts, I myself need to do integration testing for a custom distribution that uses Systemd and am wondering if this could be done, it would eliminate a lot of custom work that would have to be done on my end.

I supposed you could use the docker tools to boot your distro as a docker image. This may not cover everything you might need to test though. systemd, for example, doesn’t work in docker.

1 Like

Exactly the case. Though, you could just as easily run QEMU inside of NixOS and boot your OS in that, though it kind of defeats the purpose of the testing framework python script, making it moot. Having looked at https://github.com/NixOS/nixpkgs/blob/024cee253499a5b10bee2e16ef0da95378838e52/nixos/lib/test-driver/test-driver.py
It looks like the only assumption being made about the OS that is being ran in QEMU is that it has systemd. If we could boot non-nixos images in QEMU via the testing framework, this Python script should mostly interact with the guest all the same.