summaryrefslogtreecommitdiffstats
path: root/nixos/tests/bcachefs.nix
diff options
context:
space:
mode:
authorOkina Matara <okinan@chiru.no>2018-08-31 21:19:53 -0500
committerOkina Matara <okinan@chiru.no>2018-08-31 21:19:53 -0500
commit3d1fecd5bd92a17ac853d52cb875eb7031f0a139 (patch)
tree52ebed0e7a6c251cc08fa517f1e36c25db92e65f /nixos/tests/bcachefs.nix
parentf7d1953d8f6f7ebc727db904d11ccf246d24c1f7 (diff)
nixos/tests/bcachefs: init
Diffstat (limited to 'nixos/tests/bcachefs.nix')
-rw-r--r--nixos/tests/bcachefs.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixos/tests/bcachefs.nix b/nixos/tests/bcachefs.nix
new file mode 100644
index 000000000000..658676ef0ab9
--- /dev/null
+++ b/nixos/tests/bcachefs.nix
@@ -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"
+ );
+ '';
+})