Otherwise we barf on btrfs: machine # [ 17.027621] EXT4-fs error (device vdb): ext4_lookup:1819: inode #2476: comm nix: iget: checksum invalid machine # error: getting status of '/mnt/nix/store/j8645yndikbrvn292zgvyv64xrrmwdcb-bash-5.3p3': Bad message machine # checking '/nix/store/m3954qff15v7z1l6lpyqf8v2h47c7hv2-mailcap-2.1.54'... machine # checking '/nix/store/xh1ff9c9c0yv1wxrwa5gnfp092yagh7v-tzdata-2025b'... machine # [ 17.172793] EXT4-fs error (device vdb): ext4_lookup:1819: inode #1777: comm nix: iget: checksum invalid machine # error: getting status of '/mnt/nix/store/xh1ff9c9c0yv1wxrwa5gnfp092yagh7v-tzdata-2025b/share/zoneinfo/leap-seconds.list': Bad message
58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
nixpkgs,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
pkg1 = pkgs.go;
|
|
in
|
|
|
|
{
|
|
name = "fsync";
|
|
|
|
nodes.machine =
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
virtualisation.emptyDiskImages = [ 1024 ];
|
|
environment.systemPackages = [ pkg1 ];
|
|
nix.settings.experimental-features = [ "nix-command" ];
|
|
nix.settings.fsync-store-paths = true;
|
|
nix.settings.require-sigs = false;
|
|
boot.supportedFilesystems = [
|
|
"ext4"
|
|
"btrfs"
|
|
"xfs"
|
|
];
|
|
};
|
|
|
|
testScript =
|
|
{ nodes }:
|
|
''
|
|
# fmt: off
|
|
for fs in ("ext4", "btrfs", "xfs"):
|
|
machine.succeed("mkfs.{} {} /dev/vdb".format(fs, "-F" if fs == "ext4" else "-f"))
|
|
machine.succeed("mkdir -p /mnt")
|
|
machine.succeed("mount -t {} /dev/vdb /mnt".format(fs))
|
|
machine.succeed("sync")
|
|
machine.succeed("nix copy --offline ${pkg1} --to /mnt")
|
|
machine.crash()
|
|
|
|
machine.start()
|
|
machine.wait_for_unit("multi-user.target")
|
|
machine.succeed("mkdir -p /mnt")
|
|
machine.succeed("mount -t {} /dev/vdb /mnt".format(fs))
|
|
machine.succeed("nix path-info --offline --store /mnt ${pkg1}")
|
|
machine.succeed("nix store verify --all --store /mnt --no-trust")
|
|
|
|
machine.succeed("umount /dev/vdb")
|
|
'';
|
|
}
|