2014-11-19 22:18:44 +00:00
|
|
|
{ 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
|
2015-07-09 00:23:42 +01:00
|
|
|
{ key = "serial"; }
|
2014-11-19 22:18:44 +00:00
|
|
|
];
|
|
|
|
}).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 {
|
2016-03-01 18:02:36 +00:00
|
|
|
biosCdrom = makeBootTest "bios-cdrom" ''
|
2014-11-19 22:18:44 +00:00
|
|
|
cdrom => glob("${iso}/iso/*.iso")
|
|
|
|
'';
|
2016-03-01 18:02:36 +00:00
|
|
|
biosUsb = makeBootTest "bios-usb" ''
|
2014-11-19 22:18:44 +00:00
|
|
|
usb => glob("${iso}/iso/*.iso")
|
|
|
|
'';
|
2016-03-01 18:02:36 +00:00
|
|
|
uefiCdrom = makeBootTest "uefi-cdrom" ''
|
2014-11-19 22:18:44 +00:00
|
|
|
cdrom => glob("${iso}/iso/*.iso"),
|
|
|
|
bios => '${pkgs.OVMF}/FV/OVMF.fd'
|
|
|
|
'';
|
2016-03-01 18:02:36 +00:00
|
|
|
uefiUsb = makeBootTest "uefi-usb" ''
|
2014-11-19 22:18:44 +00:00
|
|
|
usb => glob("${iso}/iso/*.iso"),
|
|
|
|
bios => '${pkgs.OVMF}/FV/OVMF.fd'
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|