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.
This commit is contained in:
Thomas Mühlbacher 2024-06-30 12:54:26 +02:00
parent 65f1c3f52a
commit 0e0be9baa6
2 changed files with 14 additions and 3 deletions

View File

@ -23,7 +23,10 @@ let
nodes.machine =
{ pkgs, ... }:
{
virtualisation.emptyDiskImages = [ 4096 ];
virtualisation.emptyDiskImages = [
4096
1024
];
boot.supportedFilesystems = [ "bcachefs" ];
boot.kernelPackages = pkgs.linuxPackages_latest;

View File

@ -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"