nixos/test-instrumentation: properly import options for qemu-check

If `qemu-vm.nix` is imported, the option `virtualisation.qemu.consoles`
should be set to make sure that the machine's output isn't rendered on
the graphical window of QEMU.

This is needed when interactively running a NixOS test or in conjunction
with `nixos-build-vms(8)`.

The patch 2578557530 tries to only do this
if the option actually exists, however this condition used to be always
false since `options` wasn't imported in the module and pointed to
`lib.options` due to the `with lib;`-clause.
This commit is contained in:
Maximilian Bosch 2020-08-18 12:24:02 +02:00
parent 644ecea529
commit 2fbddb0ccb
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

@ -1,22 +1,13 @@
# This module allows the test driver to connect to the virtual machine
# via a root shell attached to port 514.
{ config, lib, pkgs, ... }:
{ options, config, lib, pkgs, ... }:
with lib;
with import ../../lib/qemu-flags.nix { inherit pkgs; };
{
# This option is a dummy that if used in conjunction with
# modules/virtualisation/qemu-vm.nix gets merged with the same option defined
# there and only is declared here because some modules use
# test-instrumentation.nix but not qemu-vm.nix.
#
# One particular example are the boot tests where we want instrumentation
# within the images but not other stuff like setting up 9p filesystems.
options.virtualisation.qemu = { };
config = {
systemd.services.backdoor =