btrfs: add function _require_fssum()

To avoid repeating detection of fssum presence in many btrfs tests, as
suggested by Dave Chinner.

Also exported the variable "here" from the main control script, to avoid
repeating its declaration in every single testcase file. Also removed the
declaration of "here" from btrfs test cases that require the fssum program
only. Removing it from all other test cases will be a separate change.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Filipe David Borba Manana
2014-03-13 15:17:44 +11:00
committed by Dave Chinner
parent b50473c849
commit 2dd0dbe3f8
8 changed files with 13 additions and 25 deletions
+1 -4
View File
@@ -36,7 +36,6 @@ seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=`mktemp -d`
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -54,11 +53,9 @@ _cleanup()
_supported_fs btrfs
_supported_os Linux
_require_scratch
_require_fssum
_need_to_be_root
FSSUM_PROG=$here/src/fssum
[ -x $FSSUM_PROG ] || _notrun "fssum not built"
rm -f $seqres.full
_scratch_mkfs >/dev/null 2>&1