Skip to content

Commit

Permalink
tests/virtualbox: Clean up unnecessary things.
Browse files Browse the repository at this point in the history
Always enable the UART because the VirtualBug bug that required running without the UART was fixed in 6.0.10. Stop using an old kernel version because the tests work with the default kernel.
  • Loading branch information
ambrop72 committed Sep 4, 2019
1 parent 4e99ef6 commit ae93571
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions nixos/tests/virtualbox.nix
Expand Up @@ -10,17 +10,10 @@
# to run 32-bit guests.
useKvmNestedVirt ? false,
# Whether to run 64-bit guests instead of 32-bit. Requires nested KVM.
use64bitGuest ? false,
# Whether to enable the virtual UART in VirtualBox guests, allowing to see
# the guest console. There is currently a bug in VirtualBox where this will
# cause a crash if running with SW virtualization
# (https://www.virtualbox.org/ticket/18632). If you need to debug the tests
# then enable this and nested KVM to work around the crash (see above).
enableVBoxUART ? false
use64bitGuest ? false
}:

assert use64bitGuest -> useKvmNestedVirt;
assert enableVBoxUART -> useKvmNestedVirt; # VirtualBox bug, see above

with import ../lib/testing.nix { inherit system pkgs; };
with pkgs.lib;
Expand Down Expand Up @@ -65,9 +58,6 @@ let
"init=${pkgs.writeScript "mini-init.sh" miniInit}"
];

# XXX: Remove this once TSS location detection has been fixed in VirtualBox
boot.kernelPackages = pkgs.linuxPackages_4_9;

fileSystems."/" = {
device = "vboxshare";
fsType = "vboxsf";
Expand Down Expand Up @@ -162,11 +152,9 @@ let
"--register"
];

vmFlags = mkFlags (
(optionals enableVBoxUART [
"--uart1 0x3F8 4"
"--uartmode1 client /run/virtualbox-log-${name}.sock"
]) ++ [
vmFlags = mkFlags ([
"--uart1 0x3F8 4"
"--uartmode1 client /run/virtualbox-log-${name}.sock"
"--memory 768"
"--audio none"
] ++ (attrs.vmFlags or []));
Expand Down Expand Up @@ -199,15 +187,15 @@ let
];
in {
machine = {
systemd.sockets."vboxtestlog-${name}" = mkIf enableVBoxUART {
systemd.sockets."vboxtestlog-${name}" = {
description = "VirtualBox Test Machine Log Socket For ${name}";
wantedBy = [ "sockets.target" ];
before = [ "multi-user.target" ];
socketConfig.ListenStream = "/run/virtualbox-log-${name}.sock";
socketConfig.Accept = true;
};

systemd.services."vboxtestlog-${name}@" = mkIf enableVBoxUART {
systemd.services."vboxtestlog-${name}@" = {
description = "VirtualBox Test Machine Log For ${name}";
serviceConfig.StandardInput = "socket";
serviceConfig.StandardOutput = "syslog";
Expand Down

0 comments on commit ae93571

Please sign in to comment.