mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
nixos/tests/virtualbox: Improve logging.
This also makes showvminfo obsolete, as we get the same information from the hosts log. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
d85fabd68c
commit
8bbf1dc80e
@ -60,6 +60,12 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
|
||||
];
|
||||
};
|
||||
|
||||
mkLog = logfile: tag: let
|
||||
rotated = map (i: "${logfile}.${toString i}") (range 1 9);
|
||||
all = concatMapStringsSep " " (f: "\"${f}\"") ([logfile] ++ rotated);
|
||||
logcmd = "tail -F ${all} 2> /dev/null | logger -t \"${tag}\"";
|
||||
in "$machine->execute(ru '${logcmd} & disown');";
|
||||
|
||||
testVM = vmName: vmScript: let
|
||||
cfg = (import ../lib/eval-config.nix {
|
||||
system = "i686-linux";
|
||||
@ -166,7 +172,7 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
|
||||
description = "VirtualBox Test Machine Log";
|
||||
serviceConfig.StandardInput = "socket";
|
||||
serviceConfig.StandardOutput = "syslog";
|
||||
serviceConfig.SyslogIdentifier = "vbox-${name}";
|
||||
serviceConfig.SyslogIdentifier = "GUEST-${name}";
|
||||
serviceConfig.ExecStart = "${pkgs.coreutils}/bin/cat";
|
||||
};
|
||||
});
|
||||
@ -195,8 +201,9 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
|
||||
vbm("storageattach ${name} ${diskFlags}");
|
||||
vbm("sharedfolder add ${name} ${sharedFlags}");
|
||||
vbm("sharedfolder add ${name} ${nixstoreFlags}");
|
||||
vbm("showvminfo ${name} >&2");
|
||||
cleanup_${name};
|
||||
|
||||
${mkLog "$HOME/VirtualBox VMs/${name}/Logs/VBox.log" "HOST-${name}"}
|
||||
}
|
||||
|
||||
sub destroyVM_${name} {
|
||||
@ -314,6 +321,8 @@ in {
|
||||
|
||||
$machine->waitForX;
|
||||
|
||||
${mkLog "$HOME/.config/VirtualBox/VBoxSVC.log" "HOST-SVC"}
|
||||
|
||||
createVM_simple;
|
||||
|
||||
subtest "simple-gui", sub {
|
||||
|
Loading…
Reference in New Issue
Block a user