* Pass -cpu kvm64 in NixOS VMs (and add a simple regression test for

GMP).

svn path=/nixos/trunk/; revision=33849
This commit is contained in:
Eelco Dolstra 2012-04-19 18:56:35 +00:00
parent 43f43fd185
commit fa50d105d7
5 changed files with 26 additions and 2 deletions

View File

@ -27,7 +27,7 @@ sub new {
if (!$startCommand) {
# !!! merge with qemu-vm.nix.
$startCommand =
"qemu-system-x86_64 -m 384 " .
"qemu-kvm -m 384 " .
"-net nic,model=virtio \$QEMU_OPTS ";
$startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=virtio,boot=on,werror=report "
if defined $args->{hda};

View File

@ -158,9 +158,10 @@ let
${pkgs.vmTools.startSamba}
# Start QEMU.
exec ${pkgs.qemu_kvm}/bin/qemu-system-x86_64 \
exec ${pkgs.qemu_kvm}/bin/qemu-kvm \
-name ${vmName} \
-m ${toString config.virtualisation.memorySize} \
${optionalString (pkgs.stdenv.system == "x86_64-linux") "-cpu kvm64"} \
-net nic,vlan=0,model=virtio \
-chardev socket,id=samba,path=./samba \
-net user,vlan=0,guestfwd=tcp:10.0.2.4:445-chardev:samba''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS} \

View File

@ -216,6 +216,7 @@ let
ipv6 = t.ipv6.test;
kde4 = t.kde4.test;
login = t.login.test;
misc = t.misc.test;
mpich = t.mpich.test;
mysql = t.mysql.test;
mysql_replication = t.mysql_replication.test;

View File

@ -11,6 +11,7 @@ with import ../lib/testing.nix { inherit system; };
ipv6 = makeTest (import ./ipv6.nix);
kde4 = makeTest (import ./kde4.nix);
login = makeTest (import ./login.nix);
misc = makeTest (import ./misc.nix);
mpich = makeTest (import ./mpich.nix);
mysql = makeTest (import ./mysql.nix);
mysql_replication = makeTest (import ./mysql-replication.nix);

21
tests/misc.nix Normal file
View File

@ -0,0 +1,21 @@
# Miscellaneous small tests that don't warrant their own VM run.
{ pkgs, ... }:
{
machine = { config, pkgs, ... }: { };
testScript =
''
subtest "nixos-version", sub {
$machine->succeed("[ `nixos-version | wc -w` = 1 ]");
};
# Regression test for GMP aborts on QEMU.
subtest "gmp", sub {
$machine->succeed("expr 1 + 2");
};
'';
}