2019-11-05 14:27:15 +03:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
2018-09-01 05:19:53 +03:00
|
|
|
name = "bcachefs";
|
2022-04-18 02:13:36 +03:00
|
|
|
meta.maintainers = with pkgs.lib.maintainers; [ Madouura ];
|
2018-09-01 05:19:53 +03:00
|
|
|
|
2022-03-21 02:15:30 +03:00
|
|
|
nodes.machine = { pkgs, ... }: {
|
2018-09-01 05:19:53 +03:00
|
|
|
virtualisation.emptyDiskImages = [ 4096 ];
|
|
|
|
networking.hostId = "deadbeef";
|
|
|
|
boot.supportedFilesystems = [ "bcachefs" ];
|
2022-03-06 08:29:58 +03:00
|
|
|
environment.systemPackages = with pkgs; [ parted keyutils ];
|
2018-09-01 05:19:53 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-05 14:27:15 +03:00
|
|
|
machine.succeed("modprobe bcachefs")
|
|
|
|
machine.succeed("bcachefs version")
|
|
|
|
machine.succeed("ls /dev")
|
2020-08-02 12:25:04 +03:00
|
|
|
|
2019-11-05 14:27:15 +03:00
|
|
|
machine.succeed(
|
|
|
|
"mkdir /tmp/mnt",
|
|
|
|
"udevadm settle",
|
|
|
|
"parted --script /dev/vdb mklabel msdos",
|
2022-01-01 18:13:34 +03:00
|
|
|
"parted --script /dev/vdb -- mkpart primary 1024M 50% mkpart primary 50% -1s",
|
2019-11-05 14:27:15 +03:00
|
|
|
"udevadm settle",
|
2022-03-06 08:29:58 +03:00
|
|
|
"keyctl link @u @s",
|
|
|
|
"echo password | bcachefs format --encrypted --metadata_replicas 2 --label vtest /dev/vdb1 /dev/vdb2",
|
|
|
|
"echo password | bcachefs unlock /dev/vdb1",
|
2022-01-01 18:13:34 +03:00
|
|
|
"mount -t bcachefs /dev/vdb1:/dev/vdb2 /tmp/mnt",
|
2019-11-05 14:27:15 +03:00
|
|
|
"udevadm settle",
|
|
|
|
"bcachefs fs usage /tmp/mnt",
|
|
|
|
"umount /tmp/mnt",
|
|
|
|
"udevadm settle",
|
|
|
|
)
|
2018-09-01 05:19:53 +03:00
|
|
|
'';
|
|
|
|
})
|