2020-04-24 23:36:52 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
|
|
name = "bcachefs";
|
2022-04-27 09:35:20 +00:00
|
|
|
meta.maintainers = with pkgs.lib.maintainers; [ Madouura ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
nodes.machine = { pkgs, ... }: {
|
2020-04-24 23:36:52 +00:00
|
|
|
virtualisation.emptyDiskImages = [ 4096 ];
|
|
|
|
networking.hostId = "deadbeef";
|
|
|
|
boot.supportedFilesystems = [ "bcachefs" ];
|
2022-03-30 09:31:56 +00:00
|
|
|
environment.systemPackages = with pkgs; [ parted keyutils ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.succeed("modprobe bcachefs")
|
|
|
|
machine.succeed("bcachefs version")
|
|
|
|
machine.succeed("ls /dev")
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
machine.succeed(
|
|
|
|
"mkdir /tmp/mnt",
|
|
|
|
"udevadm settle",
|
|
|
|
"parted --script /dev/vdb mklabel msdos",
|
2022-01-26 04:04:25 +00:00
|
|
|
"parted --script /dev/vdb -- mkpart primary 1024M 50% mkpart primary 50% -1s",
|
2020-04-24 23:36:52 +00:00
|
|
|
"udevadm settle",
|
2022-03-30 09:31:56 +00:00
|
|
|
"echo password | bcachefs format --encrypted --metadata_replicas 2 --label vtest /dev/vdb1 /dev/vdb2",
|
2023-10-09 19:29:22 +00:00
|
|
|
"echo password | bcachefs unlock -k session /dev/vdb1",
|
2023-07-15 17:15:38 +00:00
|
|
|
"echo password | mount -t bcachefs /dev/vdb1:/dev/vdb2 /tmp/mnt",
|
2020-04-24 23:36:52 +00:00
|
|
|
"udevadm settle",
|
|
|
|
"bcachefs fs usage /tmp/mnt",
|
|
|
|
"umount /tmp/mnt",
|
|
|
|
"udevadm settle",
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
})
|