nixpkgs-suyu/nixos/tests/bcachefs.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1.1 KiB
Nix
Raw Normal View History

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