mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 09:31:01 +00:00
1f89aa6c7f
As @bobvanderlinden suggests in #13585: "Looks like that cleans things up quite a bit! Just one aesthetics note, the boot tests could now be renamed from boot.bootBiosCdrom to boot.biosCdrom in nixos/tests/boot.nix:L33. That makes them more consistent with the other tests." Signed-off-by: aszlig <aszlig@redmoonstudios.org>
49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{ system ? builtins.currentSystem }:
|
|
|
|
with import ../lib/testing.nix { inherit system; };
|
|
with import ../lib/qemu-flags.nix;
|
|
with pkgs.lib;
|
|
|
|
let
|
|
|
|
iso =
|
|
(import ../lib/eval-config.nix {
|
|
inherit system;
|
|
modules =
|
|
[ ../modules/installer/cd-dvd/installation-cd-minimal.nix
|
|
../modules/testing/test-instrumentation.nix
|
|
{ key = "serial"; }
|
|
];
|
|
}).config.system.build.isoImage;
|
|
|
|
makeBootTest = name: machineConfig:
|
|
makeTest {
|
|
inherit iso;
|
|
name = "boot-" + name;
|
|
nodes = { };
|
|
testScript =
|
|
''
|
|
my $machine = createMachine({ ${machineConfig}, qemuFlags => '-m 768' });
|
|
$machine->start;
|
|
$machine->waitForUnit("multi-user.target");
|
|
$machine->shutdown;
|
|
'';
|
|
};
|
|
in {
|
|
biosCdrom = makeBootTest "bios-cdrom" ''
|
|
cdrom => glob("${iso}/iso/*.iso")
|
|
'';
|
|
biosUsb = makeBootTest "bios-usb" ''
|
|
usb => glob("${iso}/iso/*.iso")
|
|
'';
|
|
uefiCdrom = makeBootTest "uefi-cdrom" ''
|
|
cdrom => glob("${iso}/iso/*.iso"),
|
|
bios => '${pkgs.OVMF}/FV/OVMF.fd'
|
|
'';
|
|
uefiUsb = makeBootTest "uefi-usb" ''
|
|
usb => glob("${iso}/iso/*.iso"),
|
|
bios => '${pkgs.OVMF}/FV/OVMF.fd'
|
|
'';
|
|
}
|
|
|