summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-05-25 13:37:33 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-25 13:37:35 -0400
commitb8e11c7c0427c389288d5f152f17c990ef8cfdaf (patch)
treeca4683fe1cb646a9088bb8a6645ad3a0d099b91a
parent207e9688cf2be993cc3ae26e390619972e459a14 (diff)
bcachefs: test_single_device
Add a test for verifying that single device mode works, i.e. we can mount multiple single device filesystems with the same UUID. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rwxr-xr-xtests/fs/bcachefs/single_device.ktest16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/fs/bcachefs/single_device.ktest b/tests/fs/bcachefs/single_device.ktest
index 6f4fb4a..975d621 100755
--- a/tests/fs/bcachefs/single_device.ktest
+++ b/tests/fs/bcachefs/single_device.ktest
@@ -1914,4 +1914,20 @@ test_recover_super()
check_counters ${ktest_scratch_dev[0]}
}
+# Check that we can mount multiple single device filesystems with the same UUID
+test_single_device()
+{
+ run_quiet "" bcachefs format --single_device -f --no_initialize ${ktest_scratch_dev[0]}
+
+ dd if=${ktest_scratch_dev[0]} of=${ktest_scratch_dev[1]} bs=1M count=8 oflag=direct
+
+ mkdir -p /mnt2
+
+ mount ${ktest_scratch_dev[0]} /mnt
+ mount ${ktest_scratch_dev[1]} /mnt2
+
+ umount /mnt2
+ umount /mnt
+}
+
main "$@"