3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/tests/fsck.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
818 B
Nix
Raw Normal View History

2019-11-04 23:38:50 +00:00
import ./make-test-python.nix {
name = "fsck";
machine = { lib, ... }: {
virtualisation.emptyDiskImages = [ 1 ];
virtualisation.fileSystems = {
"/mnt" = {
device = "/dev/vdb";
fsType = "ext4";
autoFormat = true;
};
};
};
testScript = ''
2019-11-04 23:38:50 +00:00
machine.wait_for_unit("default.target")
2019-11-04 23:38:50 +00:00
with subtest("root fs is fsckd"):
machine.succeed("journalctl -b | grep 'fsck.ext4.*/dev/vda'")
2019-11-04 23:38:50 +00:00
with subtest("mnt fs is fsckd"):
machine.succeed("journalctl -b | grep 'fsck.*/dev/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"
)
'';
}