2020-04-24 23:36:52 +00:00
|
|
|
# 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")
|
2021-12-06 16:07:01 +00:00
|
|
|
machine.succeed('kexec --load /run/current-system/kernel --initrd /run/current-system/initrd --command-line "$(</proc/cmdline)"')
|
|
|
|
machine.execute("systemctl kexec >&2 &", check_return=False)
|
2020-04-24 23:36:52 +00:00
|
|
|
machine.connected = False
|
2021-12-06 16:07:01 +00:00
|
|
|
machine.connect()
|
2020-04-24 23:36:52 +00:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
2021-12-06 16:07:01 +00:00
|
|
|
machine.shutdown()
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
})
|