1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
3 meta = with lib.maintainers; {
4 maintainers = [ flokli lassulus ];
9 virtualisation.vlans = [ ];
10 virtualisation.memorySize = 4 * 1024;
11 virtualisation.useBootLoader = true;
12 virtualisation.useEFIBoot = true;
13 boot.loader.systemd-boot.enable = true;
14 boot.loader.efi.canTouchEfiVariables = true;
17 node2 = { modulesPath, ... }: {
18 virtualisation.vlans = [ ];
19 environment.systemPackages = [ pkgs.hello ];
21 "${modulesPath}/installer/netboot/netboot-minimal.nix"
26 testScript = { nodes, ... }: ''
27 # Test whether reboot via kexec works.
28 node1.wait_for_unit("multi-user.target")
29 node1.succeed('kexec --load /run/current-system/kernel --initrd /run/current-system/initrd --command-line "$(</proc/cmdline)"')
30 node1.execute("systemctl kexec >&2 &", check_return=False)
31 node1.connected = False
33 node1.wait_for_unit("multi-user.target")
35 # Check if the machine with netboot-minimal.nix profile boots up
36 node2.wait_for_unit("multi-user.target")
39 # Kexec node1 to the toplevel of node2 via the kexec-boot script
40 node1.succeed('touch /run/foo')
42 node1.execute('${nodes.node2.config.system.build.kexecTree}/kexec-boot', check_return=False)
43 node1.succeed('! test -e /run/foo')
44 node1.succeed('hello')
45 node1.succeed('[ "$(hostname)" = "node2" ]')