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