3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/tests/kexec.nix
2021-10-27 21:36:05 +02:00

23 lines
634 B
Nix

# 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()
'';
})