1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

nixos/tests/bcachefs: init

This commit is contained in:
Okina Matara 2018-08-31 21:19:53 -05:00
parent f7d1953d8f
commit 3d1fecd5bd
2 changed files with 39 additions and 0 deletions

View file

@ -422,6 +422,7 @@ in rec {
tests.yabar = callTest tests/yabar.nix {};
tests.zookeeper = callTest tests/zookeeper.nix {};
tests.morty = callTest tests/morty.nix { };
tests.bcachefs = callTest tests/bcachefs.nix { };
/* Build a bunch of typical closures so that Hydra can keep track of
the evolution of closure sizes. */

38
nixos/tests/bcachefs.nix Normal file
View file

@ -0,0 +1,38 @@
import ./make-test.nix ({ pkgs, ... }: {
name = "bcachefs";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ chiiruno ];
machine = { pkgs, ... }: {
virtualisation.emptyDiskImages = [ 4096 ];
networking.hostId = "deadbeef";
boot.supportedFilesystems = [ "bcachefs" ];
environment.systemPackages = with pkgs; [ parted ];
};
testScript = ''
$machine->succeed("modprobe bcachefs");
$machine->succeed("bcachefs version");
$machine->succeed("ls /dev");
$machine->succeed(
"mkdir /tmp/mnt",
"udevadm settle",
"parted --script /dev/vdb mklabel msdos",
"parted --script /dev/vdb -- mkpart primary 1024M -1s",
"udevadm settle",
# Due to #32279, we cannot use encryption for this test yet
# "echo password | bcachefs format --encrypted /dev/vdb1",
# "echo password | bcachefs unlock /dev/vdb1",
"bcachefs format /dev/vdb1",
"mount -t bcachefs /dev/vdb1 /tmp/mnt",
"udevadm settle",
"bcachefs fs usage /tmp/mnt",
"umount /tmp/mnt",
"udevadm settle"
);
'';
})