Author: eelco
Date: Thu Apr 19 18:56:35 2012
New Revision: 33849
URL: https://nixos.org/websvn/nix/?rev=33849&sc=1
Log:
* Pass -cpu kvm64 in NixOS VMs (and add a simple regression test for
GMP).
Added:
nixos/trunk/tests/misc.nix
Modified:
nixos/trunk/lib/test-driver/Machine.pm
nixos/trunk/modules/virtualisation/qemu-vm.nix
nixos/trunk/release.nix
nixos/trunk/tests/default.nix
Modified: nixos/trunk/lib/test-driver/Machine.pm
==============================================================================
--- nixos/trunk/lib/test-driver/Machine.pm Thu Apr 19 18:44:02 2012
(r33848)
+++ nixos/trunk/lib/test-driver/Machine.pm Thu Apr 19 18:56:35 2012
(r33849)
@@ -27,7 +27,7 @@
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};
Modified: nixos/trunk/modules/virtualisation/qemu-vm.nix
==============================================================================
--- nixos/trunk/modules/virtualisation/qemu-vm.nix Thu Apr 19 18:44:02
2012 (r33848)
+++ nixos/trunk/modules/virtualisation/qemu-vm.nix Thu Apr 19 18:56:35
2012 (r33849)
@@ -158,9 +158,10 @@
${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}
\
Modified: nixos/trunk/release.nix
==============================================================================
--- nixos/trunk/release.nix Thu Apr 19 18:44:02 2012 (r33848)
+++ nixos/trunk/release.nix Thu Apr 19 18:56:35 2012 (r33849)
@@ -216,6 +216,7 @@
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;
Modified: nixos/trunk/tests/default.nix
==============================================================================
--- nixos/trunk/tests/default.nix Thu Apr 19 18:44:02 2012 (r33848)
+++ nixos/trunk/tests/default.nix Thu Apr 19 18:56:35 2012 (r33849)
@@ -11,6 +11,7 @@
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);
Added: nixos/trunk/tests/misc.nix
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ nixos/trunk/tests/misc.nix Thu Apr 19 18:56:35 2012 (r33849)
@@ -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");
+ };
+ '';
+
+}
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits