aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-12-09 18:55:19 +0000
committerMx Kookie <kookie@spacekookie.de>2020-12-09 18:55:19 +0000
commit80d90d9b204f7c17912740f9f414fe5d59f293ba (patch)
tree5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/nixos/modules/testing/test-instrumentation.nix
parent3a31a84c7d3e589035ad08499206aac44a81f424 (diff)
parent83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff)
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
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;
};
}