at 23.05-pre 834 B view raw
1import ./make-test-python.nix ({ pkgs, systemdStage1 ? false, ...} : let 2 msg = "Shutting down NixOS"; 3in { 4 name = "systemd-shutdown"; 5 meta = with pkgs.lib.maintainers; { 6 maintainers = [ das_j ]; 7 }; 8 9 nodes.machine = { 10 imports = [ ../modules/profiles/minimal.nix ]; 11 systemd.shutdownRamfs.contents."/etc/systemd/system-shutdown/shutdown-message".source = pkgs.writeShellScript "shutdown-message" '' 12 echo "${msg}" 13 ''; 14 }; 15 16 testScript = '' 17 machine.wait_for_unit("multi-user.target") 18 # .shutdown() would wait for the machine to power off 19 machine.succeed("systemctl poweroff") 20 # Message printed by systemd-shutdown 21 machine.wait_for_console_text("Unmounting '/oldroot'") 22 machine.wait_for_console_text("${msg}") 23 # Don't try to sync filesystems 24 machine.booted = False 25 ''; 26})