Files
nixpkgs/nixos/tests/fsck.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

46 lines
1.1 KiB
Nix

{ systemdStage1, ... }:
{
name = "fsck";
nodes.machine = {
virtualisation.emptyDiskImages = [ 1 ];
virtualisation.fileSystems = {
"/mnt" = {
device = "/dev/vdb";
fsType = "ext4";
autoFormat = true;
};
};
boot.initrd.systemd.enable = systemdStage1;
};
testScript =
{ nodes, ... }:
let
rootDevice = nodes.machine.virtualisation.rootDevice;
in
''
machine.wait_for_unit("default.target")
with subtest("root fs is fsckd"):
machine.succeed("journalctl -b | grep '${
if systemdStage1 then
"fsck.*${builtins.baseNameOf rootDevice}.*clean"
else
"fsck.ext4.*${rootDevice}"
}'")
with subtest("mnt fs is fsckd"):
machine.succeed("journalctl -b | grep 'fsck.*vdb.*clean'")
machine.succeed(
"grep 'Requires=systemd-fsck@dev-vdb.service' /run/systemd/generator/mnt.mount"
)
machine.succeed(
"grep 'After=systemd-fsck@dev-vdb.service' /run/systemd/generator/mnt.mount"
)
'';
}