mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
tests/virtualbox: Add systemd-detect-virt subtest.
Addresses #9876 in the way that we want to make sure that VirtualBox 5.x is going to be properly detected. Right now the result is "kvm", so the subtest fails as expected with: error: systemd-detect-virt returned "kvm" instead of "oracle" at (eval 14) line 414, <__ANONIO__> line 92. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
f81982e779
commit
da0e642c2b
@ -189,6 +189,8 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
|
||||
};
|
||||
|
||||
testSubs = ''
|
||||
my ${"$" + name}_sharepath = '${sharePath}';
|
||||
|
||||
sub checkRunning_${name} {
|
||||
my $cmd = 'VBoxManage list runningvms | grep -q "^\"${name}\""';
|
||||
my ($status, $out) = $machine->execute(ru $cmd);
|
||||
@ -295,9 +297,15 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
|
||||
echo "$otherIP reachable" | ${pkgs.netcat}/bin/netcat -clp 5678 || :
|
||||
'';
|
||||
|
||||
sysdDetectVirt = pkgs: ''
|
||||
${pkgs.systemd}/bin/systemd-detect-virt > /mnt-root/result
|
||||
'';
|
||||
|
||||
vboxVMs = mapAttrs createVM {
|
||||
simple = {};
|
||||
|
||||
detectvirt.vmScript = sysdDetectVirt;
|
||||
|
||||
test1.vmFlags = hostonlyVMFlags;
|
||||
test1.vmScript = dhcpScript;
|
||||
|
||||
@ -381,6 +389,18 @@ in {
|
||||
|
||||
destroyVM_simple;
|
||||
|
||||
subtest "systemd-detect-virt", sub {
|
||||
createVM_detectvirt;
|
||||
vbm("startvm detectvirt");
|
||||
waitForStartup_detectvirt;
|
||||
waitForVMBoot_detectvirt;
|
||||
shutdownVM_detectvirt;
|
||||
my $result = $machine->succeed("cat '$detectvirt_sharepath/result'");
|
||||
chomp $result;
|
||||
die "systemd-detect-virt returned \"$result\" instead of \"oracle\""
|
||||
if $result ne "oracle";
|
||||
};
|
||||
|
||||
subtest "net-hostonlyif", sub {
|
||||
createVM_test1;
|
||||
createVM_test2;
|
||||
|
Loading…
Reference in New Issue
Block a user