From c430bf5cc304945f152be81efd0a59ef28353388 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 19 Mar 2011 08:58:56 +0000 Subject: [PATCH] * Add virtio_console to the CD because the backdoor requires it. * The booted CD no longer requires "-net user". svn path=/nixos/trunk/; revision=26427 --- lib/test-driver/Machine.pm | 2 +- modules/profiles/base.nix | 2 +- tests/installer.nix | 13 +++---------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index 4f8dcf441a86..919ab7c0764c 100644 --- a/lib/test-driver/Machine.pm +++ b/lib/test-driver/Machine.pm @@ -28,7 +28,7 @@ sub new { # !!! merge with qemu-vm.nix. $startCommand = "qemu-system-x86_64 -m 384 " . - "-net nic,model=virtio -net user,\$QEMU_NET_OPTS \$QEMU_OPTS "; + "-net nic,model=virtio \$QEMU_OPTS "; $startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=virtio,boot=on,werror=report " if defined $args->{hda}; $startCommand .= "-cdrom $args->{cdrom} " diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 68456e81f546..e8c583f76930 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -35,7 +35,7 @@ "ohci1394" "sbp2" # Virtio (QEMU, KVM etc.) support. - "virtio_net" "virtio_pci" "virtio_blk" "virtio_balloon" + "virtio_net" "virtio_pci" "virtio_blk" "virtio_balloon" "virtio_console" # Add vfat to enable people to copy the contents of the CD to a # bootable USB stick. diff --git a/tests/installer.nix b/tests/installer.nix index 759bd3e2068a..bc88c7c68a46 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -41,7 +41,7 @@ let boot.loader.grub.version = 2; boot.loader.grub.device = "/dev/vda"; boot.loader.grub.extraConfig = "serial; terminal_output.serial"; - boot.initrd.kernelModules = [ "ext3" ]; + boot.initrd.kernelModules = [ "ext3" "virtio_console" ]; fileSystems = [ ${fileSystems} ]; swapDevices = [ { label = "swap"; } ]; @@ -114,10 +114,7 @@ let $machine->waitForJob("tty1"); $machine->waitForJob("rogue"); $machine->waitForJob("nixos-manual"); - - # Make sure that we don't try to download anything. - $machine->stopJob("dhclient"); - $machine->mustSucceed("rm /etc/resolv.conf"); + $machine->waitForJob("dhclient"); ${optionalString testChannel '' # Allow the machine to talk to the fake nixos.org. @@ -183,7 +180,7 @@ let # And just to be sure, check that the machine still boots after # "nixos-rebuild switch". my $machine = createMachine({ hda => "harddisk" }); - $machine->mustSucceed("echo hello"); + $machine->waitForJob("network-interfaces"); $machine->shutdown; ''; @@ -308,10 +305,6 @@ in { my $machine = createMachine({ cdrom => glob("${iso}/iso/*.iso"), qemuFlags => '-m 1024' }); $machine->start; - # Make sure that we don't try to download anything. - $machine->stopJob("dhclient"); - $machine->mustSucceed("rm /etc/resolv.conf"); - # Enable sshd service. $machine->mustSucceed( "sed -i 's,^}\$,jobs.sshd.startOn = pkgs.lib.mkOverride 0 \"startup\"; },' /etc/nixos/configuration.nix"