/
boot.nix
43 lines (40 loc) · 1.29 KB
/
boot.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ system }:
with import <nixpkgs/nixos/lib/testing-python.nix> { inherit system; };
let
config = (import ./.. { inherit system; extraModules = [ ./test-instrumentation.nix ../qemu.nix ]; }).config;
in
{
ipxeCrypto = makeTest {
name = "ipxe-crypto";
nodes = {};
testScript = ''
import time
machine = create_machine(
{
"qemuFlags": "-device virtio-rng-pci -kernel ${config.system.build.ipxe}/ipxe.lkrn -m 768 -net nic,model=e1000 -net user,tftp=${config.system.build.ftpdir}/",
}
)
machine.start()
time.sleep(6)
machine.screenshot("test1")
machine.sleep(1)
machine.screenshot("test2")
machine.shutdown()
'';
};
normalBoot = makeTest {
name = "normal-boot";
nodes = {};
testScript = ''
machine = create_machine(
{
"qemuFlags": '-device virtio-rng-pci -kernel ${config.system.build.kernel}/bzImage -initrd ${config.system.build.initialRamdisk}/initrd -append "console=tty0 console=ttyS0 ${toString config.boot.kernelParams}" -drive index=0,id=drive1,file=${config.system.build.squashfs},readonly,media=cdrom,format=raw,if=virtio',
}
)
machine.start()
machine.sleep(1)
machine.screenshot("test")
machine.shutdown()
'';
};
}