diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index 947291b52c4b..9018dc589e40 100644 --- a/lib/test-driver/Machine.pm +++ b/lib/test-driver/Machine.pm @@ -29,10 +29,9 @@ sub new { $startCommand = "qemu-kvm -m 384 " . "-net nic,model=virtio \$QEMU_OPTS "; - my $iface = $args->{hdaInterface} or "virtio"; + my $iface = $args->{hdaInterface} || "virtio"; $startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=$iface,boot=on,werror=report " if defined $args->{hda}; - $startCommand .= "-cdrom $args->{cdrom} " if defined $args->{cdrom}; $startCommand .= $args->{qemuFlags} || ""; diff --git a/tests/installer.nix b/tests/installer.nix index c6b84c1d9551..b16206547a44 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -47,7 +47,7 @@ let ''} boot.loader.grub.device = "${grubDevice}"; boot.loader.grub.extraConfig = "serial; terminal_output.serial"; - boot.initrd.kernelModules = [ "ext3" "virtio_console" ]; + boot.initrd.kernelModules = [ "ext3" "ext4" "xfs" "virtio_console" ]; fileSystems = [ ${fileSystems} ]; swapDevices = [ { label = "swap"; } ]; @@ -187,7 +187,7 @@ let # And just to be sure, check that the machine still boots after # "nixos-rebuild switch". - my $machine = createMachine({ hda => "harddisk" }); + my $machine = createMachine({ hda => "harddisk", hdaInterface => "${iface}" }); $machine->waitForJob("network-interfaces"); $machine->shutdown; ''; @@ -250,28 +250,32 @@ in { }; # Create two physical LVM partitions combined into one volume group - # that contains the logical swap and root partitions. + # that contains the logical swap and root partitions. Uses a lvm = makeTest { createPartitions = '' $machine->mustSucceed( "parted /dev/vda mklabel msdos", - "parted /dev/vda -- mkpart primary 1M 2048M", # first PV + "parted /dev/vda -- mkpart primary ext2 1M 30MB", # /boot + "parted /dev/vda -- mkpart primary 31M 2048M", # first PV "parted /dev/vda -- set 1 lvm on", "parted /dev/vda -- mkpart primary 2048M -1s", # second PV "parted /dev/vda -- set 2 lvm on", "udevadm settle", - "pvcreate /dev/vda1 /dev/vda2", - "vgcreate MyVolGroup /dev/vda1 /dev/vda2", + "pvcreate /dev/vda2 /dev/vda3", + "vgcreate MyVolGroup /dev/vda2 /dev/vda3", "lvcreate --size 1G --name swap MyVolGroup", "lvcreate --size 2G --name nixos MyVolGroup", "mkswap -f /dev/MyVolGroup/swap -L swap", "swapon -L swap", - "mkfs.ext3 -L nixos /dev/MyVolGroup/nixos", + "mkfs.xfs -L nixos /dev/MyVolGroup/nixos", "mount LABEL=nixos /mnt", + "mkfs.ext4 -L boot /dev/vda1", + "mkdir /mnt/boot", + "mount LABEL=boot /mnt/boot", ); ''; - fileSystems = rootFS; + fileSystems = rootFS + bootFS; }; swraid = makeTest