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;
13 node2 = { modulesPath, ... }: {
14 virtualisation.vlans = [ ];
15 environment.systemPackages = [ pkgs.hello ];
17 "${modulesPath}/installer/netboot/netboot-minimal.nix"
18 "${modulesPath}/testing/test-instrumentation.nix"
19 "${modulesPath}/profiles/qemu-guest.nix"
24 testScript = { nodes, ... }: ''
25 # Test whether reboot via kexec works.
26 node1.wait_for_unit("multi-user.target")
27 node1.succeed('kexec --load /run/current-system/kernel --initrd /run/current-system/initrd --command-line "$(</proc/cmdline)"')
28 node1.execute("systemctl kexec >&2 &", check_return=False)
29 node1.connected = False
31 node1.wait_for_unit("multi-user.target")
33 # Check if the machine with netboot-minimal.nix profile boots up
34 node2.wait_for_unit("multi-user.target")
37 # Kexec node1 to the toplevel of node2 via the kexec-boot script
38 node1.succeed('touch /run/foo')
40 node1.execute('${nodes.node2.system.build.kexecTree}/kexec-boot', check_output=False)
41 node1.connected = False
43 node1.wait_for_unit("multi-user.target")
44 node1.succeed('! test -e /run/foo')
45 node1.succeed('hello')
46 node1.succeed('[ "$(hostname)" = "node2" ]')