mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
nixos/shutdown: Create /run/initramfs with mode 0700
This commit is contained in:
parent
098fb93ebd
commit
1cd8c7fcfe
2 changed files with 9 additions and 0 deletions
|
@ -23,6 +23,8 @@ import ./make-test-python.nix (
|
|||
};
|
||||
|
||||
testScript = ''
|
||||
# Check that 'generate-shutdown-ramfs.service' is started
|
||||
# automatically and that 'systemd-shutdown' runs our script.
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
# .shutdown() would wait for the machine to power off
|
||||
machine.succeed("systemctl poweroff")
|
||||
|
@ -31,6 +33,12 @@ import ./make-test-python.nix (
|
|||
machine.wait_for_console_text("${msg}")
|
||||
# Don't try to sync filesystems
|
||||
machine.wait_for_shutdown()
|
||||
|
||||
# In a separate boot, start 'generate-shutdown-ramfs.service'
|
||||
# manually in order to check the permissions on '/run/initramfs'.
|
||||
machine.systemctl("start generate-shutdown-ramfs.service")
|
||||
stat = machine.succeed("stat --printf=%a:%u:%g /run/initramfs")
|
||||
assert stat == "700:0:0", f"Improper permissions on /run/initramfs: {stat}"
|
||||
'';
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue