nixos/fsck: port test to python

This commit is contained in:
Marijan 2019-11-05 00:38:50 +01:00 committed by Marijan
parent 04f0961627
commit 1afa50aef1

View File

@ -1,4 +1,4 @@
import ./make-test.nix {
import ./make-test-python.nix {
name = "fsck";
machine = { lib, ... }: {
@ -14,16 +14,18 @@ import ./make-test.nix {
};
testScript = ''
$machine->waitForUnit('default.target');
machine.wait_for_unit("default.target")
subtest "root fs is fsckd", sub {
$machine->succeed('journalctl -b | grep "fsck.ext4.*/dev/vda"');
};
with subtest("root fs is fsckd"):
machine.succeed("journalctl -b | grep 'fsck.ext4.*/dev/vda'")
subtest "mnt fs is fsckd", sub {
$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');
};
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"
)
'';
}