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>
This commit is contained in:
David Sterba 2016-10-26 16:41:32 +02:00
parent 40de2f6279
commit c8d1c4c792
13 changed files with 22 additions and 36 deletions

View file

@ -176,7 +176,7 @@ convert_test_acl() {
convert_test_do_convert() {
run_check $TOP/btrfs-convert ${1:+-O "$1"} ${2:+-N "$2"} $TEST_DEV
run_check $TOP/btrfs check $TEST_DEV
run_check $TOP/btrfs-show-super -Ffa $TEST_DEV
run_check $TOP/btrfs inspect-internal dump-super -Ffa $TEST_DEV
}
# post conversion check, verify file permissions.

View file

@ -14,7 +14,6 @@ source $TOP/tests/common
check_prereq btrfs-convert
check_prereq btrfs
check_prereq btrfs-show-super
check_global_prereq e2fsck
check_global_prereq xzcat
@ -27,7 +26,7 @@ function check_image() {
run_check e2fsck -n -f $TEST_DEV
run_check $TOP/btrfs-convert $TEST_DEV
run_check $TOP/btrfs check $TEST_DEV
run_check $TOP/btrfs-show-super $TEST_DEV
run_check $TOP/btrfs inspect-internal dump-super $TEST_DEV
run_check_mount_test_dev
run_check $SUDO_HELPER e2fsck -n -f $TEST_MNT/ext2_saved/image

View file

@ -3,7 +3,6 @@
source $TOP/tests/common
check_prereq btrfs-corrupt-block
check_prereq btrfs-debug-tree
check_prereq mkfs.btrfs
check_prereq btrfs
@ -25,7 +24,7 @@ test_extent_tree_rebuild()
run_check_umount_test_dev
# get extent root bytenr
extent_root_bytenr=`$SUDO_HELPER $TOP/btrfs-debug-tree -r $TEST_DEV | \
extent_root_bytenr=`$SUDO_HELPER $TOP/btrfs inspect-internal dump-tree -r $TEST_DEV | \
grep extent | awk '{print $7}'`
if [ -z $extent_root_bytenr ];then
_fail "fail to get extent root bytenr"

View file

@ -3,8 +3,6 @@
source $TOP/tests/common
check_prereq btrfs-debug-tree
check_prereq btrfs-show-super
check_prereq mkfs.btrfs
check_prereq btrfstune
check_prereq btrfs
@ -16,7 +14,7 @@ prepare_test_dev
# parameters:
# - option for mkfs.btrfs -O, empty for defaults
# - option for btrfstune
# - string representing the feature in btrfs-show-super dump
# - string representing the feature in dump-super output
test_feature()
{
local mkfsfeatures
@ -28,12 +26,12 @@ test_feature()
sbflag="$3"
run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $mkfsfeatures $TEST_DEV
if run_check_stdout $TOP/btrfs-show-super $TEST_DEV | \
if run_check_stdout $TOP/btrfs inspect-internal dump-super $TEST_DEV | \
grep -q "$sbflag"; then
_fail "FAIL: feature $sbflag must not be set on the base image"
fi
run_check $TOP/btrfstune $tuneopt $TEST_DEV
if ! run_check_stdout $TOP/btrfs-show-super $TEST_DEV | \
if ! run_check_stdout $TOP/btrfs inspect-internal dump-super $TEST_DEV | \
grep -q "$sbflag"; then
_fail "FAIL: feature $sbflag not set"
fi

View file

@ -3,8 +3,6 @@
source $TOP/tests/common
check_prereq btrfs-debug-tree
check_prereq btrfs-show-super
check_prereq mkfs.btrfs
check_prereq btrfstune
check_prereq btrfs
@ -15,7 +13,7 @@ get_fs_uuid() {
local image
image="$1"
run_check_stdout $TOP/btrfs-show-super "$image" | \
run_check_stdout $TOP/btrfs inspect-internal dump-super "$image" | \
grep '^fsid' | awk '{print $2}'
}
@ -29,13 +27,13 @@ test_uuid_random()
--uuid $origuuid \
--rootdir $TOP/Documentation \
$TEST_DEV
run_check $TOP/btrfs-show-super "$TEST_DEV"
run_check $TOP/btrfs inspect-internal dump-super "$TEST_DEV"
currentfsid=$(run_check_stdout $TOP/btrfstune -f -u $TEST_DEV | \
grep -i 'current fsid:' | awk '{print $3}')
if ! [ $currentfsid = $origuuid ]; then
_fail "FAIL: current UUID mismatch"
fi
run_check $TOP/btrfs-show-super "$TEST_DEV"
run_check $TOP/btrfs inspect-internal dump-super "$TEST_DEV"
run_check $SUDO_HELPER $TOP/btrfs check $TEST_DEV
}
@ -51,10 +49,10 @@ test_uuid_user()
--uuid $origuuid \
--rootdir $TOP/Documentation \
$TEST_DEV
run_check $TOP/btrfs-show-super "$TEST_DEV"
run_check $TOP/btrfs inspect-internal dump-super "$TEST_DEV"
run_check $TOP/btrfstune -f -U $newuuid \
$TEST_DEV
# btrfs-show-super is called within get_fs_uuid
# btrfs inspect-internal dump-super is called within get_fs_uuid
fsid=$(get_fs_uuid $TEST_DEV)
if ! [ $fsid = $newuuid ]; then
_fail "FAIL: UUID not rewritten"

View file

@ -3,7 +3,6 @@
source $TOP/tests/common
check_prereq btrfs-show-super
check_prereq mkfs.btrfs
check_prereq btrfs
prepare_test_dev
@ -13,14 +12,14 @@ get_log_root()
local image
image="$1"
$TOP/btrfs-show-super "$image" | \
$TOP/btrfs inspect-internal dump-super "$image" | \
grep '^log_root\>' | awk '{print $2}'
}
get_log_root_level() {
local image
image="$1"
$TOP/btrfs-show-super "$image" | \
$TOP/btrfs inspect-internal dump-super "$image" | \
grep '^log_root_level' | awk '{print $2}'
}
@ -30,7 +29,7 @@ test_zero_log()
run_check $SUDO_HELPER $TOP/mkfs.btrfs -f \
--rootdir $TOP/Documentation \
$TEST_DEV
run_check $TOP/btrfs-show-super $TEST_DEV
run_check $TOP/btrfs inspect-internal dump-super $TEST_DEV
if [ "$1" = 'standalone' ]; then
run_check $TOP/btrfs rescue zero-log $TEST_DEV
else
@ -44,7 +43,7 @@ test_zero_log()
if [ "$log_root_level" != 0 ]; then
_fail "FAIL: log_root_level not reset"
fi
run_check $TOP/btrfs-show-super $TEST_DEV
run_check $TOP/btrfs inspect-internal dump-super $TEST_DEV
run_check $SUDO_HELPER $TOP/btrfs check $TEST_DEV
}

View file

@ -6,7 +6,6 @@
source $TOP/tests/common
check_prereq btrfs-show-super
check_prereq btrfs-image
check_prereq mkfs.btrfs
check_prereq btrfs

View file

@ -6,7 +6,6 @@
source $TOP/tests/common
check_prereq btrfs-convert
check_prereq btrfs-debug-tree
check_prereq btrfs
setup_root_helper
@ -15,11 +14,11 @@ prepare_test_dev
run_check truncate -s 2G "$TEST_DEV"
run_check mkfs.ext4 -F "$TEST_DEV"
run_check $TOP/btrfs-convert "$TEST_DEV"
run_check $TOP/btrfs-debug-tree "$TEST_DEV"
run_check $TOP/btrfs inspect-internal dump-tree "$TEST_DEV"
run_check_mount_test_dev
run_check $SUDO_HELPER $TOP/btrfs subvolume delete -c "$TEST_MNT/ext2_saved"
run_check_umount_test_dev
run_check $TOP/btrfs-debug-tree "$TEST_DEV"
run_check $TOP/btrfs inspect-internal dump-tree "$TEST_DEV"
run_check_stdout $TOP/btrfs-convert --rollback "$TEST_DEV" |
grep -q 'is it deleted' || _fail "unexpected rollback"

View file

@ -3,7 +3,6 @@
source $TOP/tests/common
check_prereq btrfs-show-super
check_prereq mkfs.btrfs
check_prereq btrfs
@ -39,7 +38,7 @@ cleanup_devices()
test_do_mkfs()
{
run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $@ ${devs[@]}
run_check $TOP/btrfs-show-super $dev1
run_check $TOP/btrfs inspect-internal dump-super $dev1
run_check $SUDO_HELPER $TOP/btrfs check $dev1
run_check $TOP/btrfs filesystem show
}

View file

@ -4,7 +4,6 @@
source $TOP/tests/common
check_prereq btrfs-show-super
check_prereq mkfs.btrfs
check_prereq btrfs
@ -38,7 +37,7 @@ cleanup_devices()
test_get_info()
{
run_check $TOP/btrfs-show-super $dev1
run_check $TOP/btrfs inspect-internal dump-super $dev1
run_check $SUDO_HELPER $TOP/btrfs check $dev1
run_check $SUDO_HELPER mount $dev1 $TEST_MNT
run_check $TOP/btrfs filesystem df $TEST_MNT

View file

@ -4,7 +4,6 @@
source $TOP/tests/common
check_prereq mkfs.btrfs
check_prereq btrfs-show-super
setup_root_helper
prepare_test_dev
@ -33,7 +32,7 @@ run_check cat $rot
# test
run_check_stdout $SUDO_HELPER $TOP/mkfs.btrfs -f $@ $dmdev |
grep -q 'SSD detected:.*yes' || _fail 'SSD not detected'
run_check $TOP/btrfs-show-super $dmdev
run_check $TOP/btrfs inspect-internal dump-super $dmdev
# cleanup
run_check $SUDO_HELPER dmsetup remove $dmname

View file

@ -4,7 +4,6 @@
source $TOP/tests/common
check_prereq mkfs.btrfs
check_prereq btrfs-show-super
setup_root_helper
@ -19,7 +18,7 @@ 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
run_check $TOP/btrfs inspect-internal dump-super $looppart
done
# cleanup

View file

@ -3,7 +3,6 @@
source $TOP/tests/common
check_prereq btrfs-show-super
check_prereq mkfs.btrfs
check_prereq btrfs
@ -13,7 +12,7 @@ prepare_test_dev
test_mkfs_single()
{
run_check $SUDO_HELPER $TOP/mkfs.btrfs -f "$@" $TEST_DEV
run_check $TOP/btrfs-show-super $TEST_DEV
run_check $TOP/btrfs inspect-internal dump-super $TEST_DEV
run_check $SUDO_HELPER $TOP/btrfs check $TEST_DEV
}