btrfs-progs/tests/mkfs-tests/006-partitioned-loopdev/test.sh
David Sterba c8d1c4c792 btrfs-progs: tests: switch to dump- commands from inspect
The dump-super and debug-tree commands are replacements for the
standalone tools.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-11-09 13:13:37 +01:00

27 lines
599 B
Bash
Executable File

#!/bin/bash
# recognize partitioned loop devices
source $TOP/tests/common
check_prereq mkfs.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 inspect-internal dump-super $looppart
done
# cleanup
run_check $SUDO_HELPER losetup -d $loopdev
run_check truncate -s0 img