<commit_before># Test whether fast reboots via kexec work.

import ./make-test-python.nix ({ pkgs, lib, ...} : {
  name = "kexec";
  meta = with lib.maintainers; {
    maintainers = [ eelco ];
    # Currently hangs forever; last output is:
    #     machine # [   10.239914] dhcpcd[707]: eth0: adding default route via fe80::2
    #     machine: waiting for the VM to finish booting
    #     machine # Cannot find the ESP partition mount point.
    #     machine # [   28.681197] nscd[692]: 692 checking for monitored file `/etc/netgroup': No such file or directory
    broken = true;
  };

  machine = { ... }:
    { virtualisation.vlans = [ ]; };

  testScript =
    ''
      machine.wait_for_unit("multi-user.target")
      machine.execute("systemctl kexec &")
      machine.connected = False
      machine.wait_for_unit("multi-user.target")
    '';
})<commit_msg>nixos/kexec: fix test<commit_after># Test whether fast reboots via kexec work.

import ./make-test-python.nix ({ pkgs, lib, ...} : {
  name = "kexec";
  meta = with lib.maintainers; {
    maintainers = [ eelco ];
  };

  machine = { ... }:
    { virtualisation.vlans = [ ]; };

  testScript =
    ''
      machine.wait_for_unit("multi-user.target")
      machine.succeed('kexec --load /run/current-system/kernel --initrd /run/current-system/initrd --command-line "$(</proc/cmdline)"')
      machine.succeed("systemctl kexec &")
      machine.connected = False
      machine.connect()
      machine.wait_for_unit("multi-user.target")
      machine.shutdown()
    '';
})
{'fraction_non_alphanumeric': 0.1484375, 'fraction_numerical': 0.018880208333333332, 'mean_word_length': 2.71256038647343, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '315058', 'n_tokens_mistral': 535, 'n_tokens_neox': 500, 'n_words': 115}