2013-09-16 15:15:42 +00:00
|
|
|
# Test whether fast reboots via kexec work.
|
|
|
|
|
2019-12-24 15:17:39 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ...} : {
|
2014-06-28 14:04:49 +00:00
|
|
|
name = "kexec";
|
2019-12-24 15:17:39 +00:00
|
|
|
meta = with lib.maintainers; {
|
2019-02-22 15:14:13 +00:00
|
|
|
maintainers = [ eelco ];
|
2015-07-12 10:09:40 +00:00
|
|
|
};
|
2013-09-16 15:15:42 +00:00
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = { ... }:
|
2013-09-16 15:15:42 +00:00
|
|
|
{ virtualisation.vlans = [ ]; };
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
2019-12-24 15:17:39 +00:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
2021-10-24 22:15:56 +00:00
|
|
|
machine.succeed('kexec --load /run/current-system/kernel --initrd /run/current-system/initrd --command-line "$(</proc/cmdline)"')
|
2021-11-05 00:43:22 +00:00
|
|
|
machine.execute("systemctl kexec >&2 &", check_return=False)
|
2019-12-24 15:17:39 +00:00
|
|
|
machine.connected = False
|
2021-10-24 22:15:56 +00:00
|
|
|
machine.connect()
|
2019-12-24 15:17:39 +00:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
2021-10-24 22:15:56 +00:00
|
|
|
machine.shutdown()
|
2013-09-16 15:15:42 +00:00
|
|
|
'';
|
2015-07-12 10:09:40 +00:00
|
|
|
})
|