run-tests: add 'vm' command

This commit is contained in:
Erik Arvstedt
2021-03-26 23:23:22 +01:00
parent aea1706e49
commit 3cce822c64
3 changed files with 49 additions and 0 deletions

View File

@@ -61,5 +61,23 @@ name: testConfig:
};
};
# This allows running a test scenario in a regular NixOS VM.
# No tests are executed.
vmWithoutTests = (pkgs.nixos {
imports = [
testConfig
"${toString pkgs.path}/nixos/modules/virtualisation/qemu-vm.nix"
];
virtualisation.graphics = false;
services.mingetty.autologinUser = "root";
# Provide a shortcut for instant poweroff from within the machine
environment.systemPackages = with pkgs; [
(lowPrio (writeScriptBin "q" ''
echo o >/proc/sysrq-trigger
''))
];
}).vm;
config = testConfig;
}