Ditch efi installer tests
They've been broken forever due to weirdness in qemu tests, and they don't add much over installer tests
This commit is contained in:
parent
c07579aa4a
commit
92837f2dbf
|
@ -47,12 +47,10 @@ in rec {
|
||||||
(all nixos.iso_graphical)
|
(all nixos.iso_graphical)
|
||||||
(all nixos.ova)
|
(all nixos.ova)
|
||||||
|
|
||||||
#(all nixos.tests.efi-installer.simple)
|
|
||||||
#(all nixos.tests.containers)
|
#(all nixos.tests.containers)
|
||||||
(all nixos.tests.firefox)
|
(all nixos.tests.firefox)
|
||||||
(all nixos.tests.firewall)
|
(all nixos.tests.firewall)
|
||||||
(all nixos.tests.gnome3)
|
(all nixos.tests.gnome3)
|
||||||
#(all nixos.tests.installer.efi)
|
|
||||||
(all nixos.tests.installer.grub1)
|
(all nixos.tests.installer.grub1)
|
||||||
(all nixos.tests.installer.lvm)
|
(all nixos.tests.installer.lvm)
|
||||||
(all nixos.tests.installer.separateBoot)
|
(all nixos.tests.installer.separateBoot)
|
||||||
|
|
|
@ -231,7 +231,6 @@ in rec {
|
||||||
tests.firefox = callTest tests/firefox.nix {};
|
tests.firefox = callTest tests/firefox.nix {};
|
||||||
tests.firewall = callTest tests/firewall.nix {};
|
tests.firewall = callTest tests/firewall.nix {};
|
||||||
tests.gnome3 = callTest tests/gnome3.nix {};
|
tests.gnome3 = callTest tests/gnome3.nix {};
|
||||||
tests.installer.efi = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).efi.test);
|
|
||||||
tests.installer.grub1 = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).grub1.test);
|
tests.installer.grub1 = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).grub1.test);
|
||||||
tests.installer.lvm = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).lvm.test);
|
tests.installer.lvm = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).lvm.test);
|
||||||
tests.installer.rebuildCD = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).rebuildCD.test);
|
tests.installer.rebuildCD = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).rebuildCD.test);
|
||||||
|
|
|
@ -35,7 +35,7 @@ let
|
||||||
|
|
||||||
|
|
||||||
# The configuration to install.
|
# The configuration to install.
|
||||||
makeConfig = { testChannel, useEFI, grubVersion, grubDevice, grubIdentifier
|
makeConfig = { testChannel, grubVersion, grubDevice, grubIdentifier
|
||||||
, readOnly ? true, forceGrubReinstallCount ? 0 }:
|
, readOnly ? true, forceGrubReinstallCount ? 0 }:
|
||||||
pkgs.writeText "configuration.nix" ''
|
pkgs.writeText "configuration.nix" ''
|
||||||
{ config, pkgs, modulesPath, ... }:
|
{ config, pkgs, modulesPath, ... }:
|
||||||
|
@ -46,18 +46,13 @@ let
|
||||||
<nixpkgs/nixos/modules/profiles/minimal.nix>
|
<nixpkgs/nixos/modules/profiles/minimal.nix>
|
||||||
];
|
];
|
||||||
|
|
||||||
${if useEFI then ''
|
boot.loader.grub.version = ${toString grubVersion};
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
${optionalString (grubVersion == 1) ''
|
||||||
boot.loader.gummiboot.enable = true;
|
boot.loader.grub.splashImage = null;
|
||||||
'' else ''
|
|
||||||
boot.loader.grub.version = ${toString grubVersion};
|
|
||||||
${optionalString (grubVersion == 1) ''
|
|
||||||
boot.loader.grub.splashImage = null;
|
|
||||||
''}
|
|
||||||
boot.loader.grub.device = "${grubDevice}";
|
|
||||||
boot.loader.grub.extraConfig = "serial; terminal_output.serial";
|
|
||||||
boot.loader.grub.fsIdentifier = "${grubIdentifier}";
|
|
||||||
''}
|
''}
|
||||||
|
boot.loader.grub.device = "${grubDevice}";
|
||||||
|
boot.loader.grub.extraConfig = "serial; terminal_output.serial";
|
||||||
|
boot.loader.grub.fsIdentifier = "${grubIdentifier}";
|
||||||
|
|
||||||
boot.loader.grub.configurationLimit = 100 + ${toString forceGrubReinstallCount};
|
boot.loader.grub.configurationLimit = 100 + ${toString forceGrubReinstallCount};
|
||||||
|
|
||||||
|
@ -100,16 +95,14 @@ let
|
||||||
# disk, and then reboot from the hard disk. It's parameterized with
|
# disk, and then reboot from the hard disk. It's parameterized with
|
||||||
# a test script fragment `createPartitions', which must create
|
# a test script fragment `createPartitions', which must create
|
||||||
# partitions and filesystems.
|
# partitions and filesystems.
|
||||||
testScriptFun = { createPartitions, testChannel, useEFI, grubVersion, grubDevice, grubIdentifier }:
|
testScriptFun = { createPartitions, testChannel, grubVersion, grubDevice, grubIdentifier }:
|
||||||
let
|
let
|
||||||
# FIXME: OVMF doesn't boot from virtio http://www.mail-archive.com/edk2-devel@lists.sourceforge.net/msg01501.html
|
# FIXME: OVMF doesn't boot from virtio http://www.mail-archive.com/edk2-devel@lists.sourceforge.net/msg01501.html
|
||||||
iface = if useEFI || grubVersion == 1 then "scsi" else "virtio";
|
iface = if grubVersion == 1 then "scsi" else "virtio";
|
||||||
qemuFlags =
|
qemuFlags =
|
||||||
(if iso.system == "x86_64-linux" then "-m 768 " else "-m 512 ") +
|
(if iso.system == "x86_64-linux" then "-m 768 " else "-m 512 ") +
|
||||||
(optionalString (iso.system == "x86_64-linux") "-cpu kvm64 ") +
|
(optionalString (iso.system == "x86_64-linux") "-cpu kvm64 ") +
|
||||||
(optionalString useEFI ''-L ${efiBios} -hda ''${\(Cwd::abs_path('harddisk'))} '');
|
hdFlags =''hda => "harddisk", hdaInterface => "${iface}", '';
|
||||||
hdFlags = optionalString (!useEFI)
|
|
||||||
''hda => "harddisk", hdaInterface => "${iface}", '';
|
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
createDisk("harddisk", 4 * 1024);
|
createDisk("harddisk", 4 * 1024);
|
||||||
|
@ -168,7 +161,7 @@ let
|
||||||
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
|
||||||
|
|
||||||
$machine->copyFileFromHost(
|
$machine->copyFileFromHost(
|
||||||
"${ makeConfig { inherit testChannel useEFI grubVersion grubDevice grubIdentifier; } }",
|
"${ makeConfig { inherit testChannel grubVersion grubDevice grubIdentifier; } }",
|
||||||
"/mnt/etc/nixos/configuration.nix");
|
"/mnt/etc/nixos/configuration.nix");
|
||||||
|
|
||||||
# Perform the installation.
|
# Perform the installation.
|
||||||
|
@ -189,11 +182,7 @@ let
|
||||||
# Did /boot get mounted?
|
# Did /boot get mounted?
|
||||||
$machine->waitForUnit("local-fs.target");
|
$machine->waitForUnit("local-fs.target");
|
||||||
|
|
||||||
${if useEFI then ''
|
$machine->succeed("test -e /boot/grub");
|
||||||
$machine->succeed("test -e /boot/efi");
|
|
||||||
'' else ''
|
|
||||||
$machine->succeed("test -e /boot/grub");
|
|
||||||
''}
|
|
||||||
|
|
||||||
# Did the swap device get activated?
|
# Did the swap device get activated?
|
||||||
$machine->waitForUnit("swap.target");
|
$machine->waitForUnit("swap.target");
|
||||||
|
@ -206,7 +195,7 @@ let
|
||||||
|
|
||||||
# We need to a writable nix-store on next boot
|
# We need to a writable nix-store on next boot
|
||||||
$machine->copyFileFromHost(
|
$machine->copyFileFromHost(
|
||||||
"${ makeConfig { inherit testChannel useEFI grubVersion grubDevice grubIdentifier; readOnly = false; forceGrubReinstallCount = 1; } }",
|
"${ makeConfig { inherit testChannel grubVersion grubDevice grubIdentifier; readOnly = false; forceGrubReinstallCount = 1; } }",
|
||||||
"/etc/nixos/configuration.nix");
|
"/etc/nixos/configuration.nix");
|
||||||
|
|
||||||
# Check whether nixos-rebuild works.
|
# Check whether nixos-rebuild works.
|
||||||
|
@ -223,7 +212,7 @@ let
|
||||||
$machine = createMachine({ ${hdFlags} qemuFlags => "${qemuFlags}" });
|
$machine = createMachine({ ${hdFlags} qemuFlags => "${qemuFlags}" });
|
||||||
$machine->waitForUnit("multi-user.target");
|
$machine->waitForUnit("multi-user.target");
|
||||||
$machine->copyFileFromHost(
|
$machine->copyFileFromHost(
|
||||||
"${ makeConfig { inherit testChannel useEFI grubVersion grubDevice grubIdentifier; readOnly = false; forceGrubReinstallCount = 2; } }",
|
"${ makeConfig { inherit testChannel grubVersion grubDevice grubIdentifier; readOnly = false; forceGrubReinstallCount = 2; } }",
|
||||||
"/etc/nixos/configuration.nix");
|
"/etc/nixos/configuration.nix");
|
||||||
$machine->succeed("nixos-rebuild boot >&2");
|
$machine->succeed("nixos-rebuild boot >&2");
|
||||||
$machine->shutdown;
|
$machine->shutdown;
|
||||||
|
@ -237,13 +226,13 @@ let
|
||||||
|
|
||||||
|
|
||||||
makeInstallerTest = name:
|
makeInstallerTest = name:
|
||||||
{ createPartitions, testChannel ? false, useEFI ? false, grubVersion ? 2, grubDevice ? "/dev/vda", grubIdentifier ? "uuid" }:
|
{ createPartitions, testChannel ? false, grubVersion ? 2, grubDevice ? "/dev/vda", grubIdentifier ? "uuid" }:
|
||||||
makeTest {
|
makeTest {
|
||||||
inherit iso;
|
inherit iso;
|
||||||
name = "installer-" + name;
|
name = "installer-" + name;
|
||||||
nodes = if testChannel then { inherit webserver; } else { };
|
nodes = if testChannel then { inherit webserver; } else { };
|
||||||
testScript = testScriptFun {
|
testScript = testScriptFun {
|
||||||
inherit createPartitions testChannel useEFI grubVersion grubDevice grubIdentifier;
|
inherit createPartitions testChannel grubVersion grubDevice grubIdentifier;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -369,25 +358,6 @@ in {
|
||||||
grubDevice = "/dev/sda";
|
grubDevice = "/dev/sda";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Test an EFI install.
|
|
||||||
efi = makeInstallerTest "efi"
|
|
||||||
{ createPartitions =
|
|
||||||
''
|
|
||||||
$machine->succeed(
|
|
||||||
"sgdisk -Z /dev/sda",
|
|
||||||
"sgdisk -n 1:0:+256M -n 2:0:+1024M -N 3 -t 1:ef00 -t 2:8200 -t 3:8300 -c 1:boot -c 2:swap -c 3:root /dev/sda",
|
|
||||||
"mkfs.vfat -n BOOT /dev/sda1",
|
|
||||||
"mkswap /dev/sda2 -L swap",
|
|
||||||
"swapon -L swap",
|
|
||||||
"mkfs.ext3 -L nixos /dev/sda3",
|
|
||||||
"mount LABEL=nixos /mnt",
|
|
||||||
"mkdir /mnt/boot",
|
|
||||||
"mount LABEL=BOOT /mnt/boot",
|
|
||||||
);
|
|
||||||
'';
|
|
||||||
useEFI = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Rebuild the CD configuration with a little modification.
|
# Rebuild the CD configuration with a little modification.
|
||||||
rebuildCD = makeTest
|
rebuildCD = makeTest
|
||||||
{ inherit iso;
|
{ inherit iso;
|
||||||
|
|
Loading…
Reference in New Issue