btrfs-progs: tests: add 006-partitioned-loopdev
Create filesystem on a partitioned loop device, test for "btrfs-progs: Fix partitioned loop devices resolving". Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
882f319761
commit
a343805d58
Binary file not shown.
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
# recognize partitioned loop devices
|
||||
|
||||
source $TOP/tests/common
|
||||
|
||||
check_prereq mkfs.btrfs
|
||||
check_prereq btrfs
|
||||
setup_root_helper
|
||||
|
||||
run_check truncate -s0 img
|
||||
chmod a+w img
|
||||
cp partition-1g-1g img
|
||||
run_check truncate -s2g img
|
||||
|
||||
loopdev=$(run_check_stdout $SUDO_HELPER losetup --partscan --find --show img)
|
||||
base=$(basename $loopdev)
|
||||
|
||||
# expect partitions named like loop0p1 etc
|
||||
for looppart in $(ls /dev/$base?*); do
|
||||
run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $looppart
|
||||
run_check $TOP/btrfs-show-super $looppart
|
||||
done
|
||||
|
||||
# cleanup
|
||||
run_check $SUDO_HELPER losetup -d $loopdev
|
||||
run_check truncate -s0 img
|
Loading…
Reference in New Issue