From 0e0be9baa62bc680533fc2af392a11ab8dbee9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BChlbacher?= Date: Sun, 30 Jun 2024 12:54:26 +0200 Subject: [PATCH] test: add failing sub-test w/ dev added post mkfs The second mount works if the device is already part of the `bcachefs format` but fails if it's added afterwards. In particular the `blkid` output is interesting. --- checks/default.nix | 5 ++++- checks/encrypted-multidev.sh | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/checks/default.nix b/checks/default.nix index 7f535f80..42581433 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -23,7 +23,10 @@ let nodes.machine = { pkgs, ... }: { - virtualisation.emptyDiskImages = [ 4096 ]; + virtualisation.emptyDiskImages = [ + 4096 + 1024 + ]; boot.supportedFilesystems = [ "bcachefs" ]; boot.kernelPackages = pkgs.linuxPackages_latest; diff --git a/checks/encrypted-multidev.sh b/checks/encrypted-multidev.sh index d4e5c9ff..3048d61e 100755 --- a/checks/encrypted-multidev.sh +++ b/checks/encrypted-multidev.sh @@ -2,6 +2,7 @@ set -euxo pipefail blkdev="/dev/vdb" +blkdev2="/dev/vdc" mnt=$(mktemp -d) pw=$(genpass) uuid=$(uuidgen) @@ -24,14 +25,21 @@ echo "$pw" | bcachefs format \ --replicas=2 \ --uuid "$uuid" \ --fs_label test-fs \ - "$blkdev"? + "${blkdev}"{1,2} udevadm settle echo "$pw" | bcachefs mount "UUID=$uuid" "$mnt" +bcachefs device add "$mnt" "${blkdev}3" +bcachefs device add "$mnt" "$blkdev2" + +udevadm settle + +blkid + keyctl search @u user "bcachefs:$uuid" umount "$mnt" -bcachefs mount "${blkdev}1" "$mnt" +bcachefs mount "UUID=$uuid" "$mnt"