mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-07 00:00:12 +03:00
nix: Test module
This commit is contained in:
parent
d3ced65a68
commit
252a37e2cb
@ -135,6 +135,8 @@
|
||||
pname = "${prev.pname}-msrv";
|
||||
}
|
||||
);
|
||||
|
||||
nixos-test = pkgs.nixosTest (import ./nixos-test.nix self');
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
|
||||
34
nixos-test.nix
Normal file
34
nixos-test.nix
Normal file
@ -0,0 +1,34 @@
|
||||
self': {
|
||||
name = "bcachefs-nixos";
|
||||
|
||||
nodes.machine =
|
||||
{ config, ... }:
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
config.boot.bcachefs.modulePackage or null == self'.packages.bcachefs-module-linux-latest;
|
||||
message = "Local bcachefs module isn't being used; update nixpkgs?";
|
||||
}
|
||||
];
|
||||
|
||||
virtualisation.emptyDiskImages = [
|
||||
{
|
||||
size = 4096;
|
||||
driveConfig.deviceExtraOpts.serial = "test-disk";
|
||||
}
|
||||
];
|
||||
|
||||
boot.supportedFilesystems.bcachefs = true;
|
||||
boot.bcachefs.package = self'.packages.bcachefs-tools;
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.succeed(
|
||||
"modinfo bcachefs | grep updates/src/fs/bcachefs > /dev/null",
|
||||
"mkfs.bcachefs /dev/disk/by-id/virtio-test-disk",
|
||||
"mkdir /mnt",
|
||||
"mount /dev/disk/by-id/virtio-test-disk /mnt",
|
||||
)
|
||||
'';
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user