aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix')
-rw-r--r--infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix27
1 files changed, 20 insertions, 7 deletions
diff --git a/infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix b/infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix
index c0ec76e8a3a3..be5fa88b8ade 100644
--- a/infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix
+++ b/infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix
@@ -45,13 +45,22 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
systemd.services."serial-getty@${qemuSerialDevice}".enable = false;
systemd.services."serial-getty@hvc0".enable = false;
- # Only use a serial console, no TTY.
- # NOTE: optionalAttrs
- # test-instrumentation.nix appears to be used without qemu-vm.nix, so
- # we avoid defining consoles if not possible.
- # TODO: refactor such that test-instrumentation can import qemu-vm
- # or declare virtualisation.qemu.console option in a module that's always imported
- virtualisation = lib.optionalAttrs (options ? virtualisation.qemu.consoles) { qemu.consoles = [ qemuSerialDevice ]; };
+ # Only set these settings when the options exist. Some tests (e.g. those
+ # that do not specify any nodes, or an empty attr set as nodes) will not
+ # have the QEMU module loaded and thuse these options can't and should not
+ # be set.
+ virtualisation = lib.optionalAttrs (options ? virtualisation.qemu) {
+ qemu = {
+ # Only use a serial console, no TTY.
+ # NOTE: optionalAttrs
+ # test-instrumentation.nix appears to be used without qemu-vm.nix, so
+ # we avoid defining consoles if not possible.
+ # TODO: refactor such that test-instrumentation can import qemu-vm
+ # or declare virtualisation.qemu.console option in a module that's always imported
+ consoles = [ qemuSerialDevice ];
+ package = lib.mkDefault pkgs.qemu_test;
+ };
+ };
boot.initrd.preDeviceCommands =
''
@@ -116,6 +125,10 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
users.users.root.initialHashedPassword = mkOverride 150 "";
services.xserver.displayManager.job.logToJournal = true;
+
+ # Make sure we use the Guest Agent from the QEMU package for testing
+ # to reduce the closure size required for the tests.
+ services.qemuGuest.package = pkgs.qemu_test.ga;
};
}