Skip to content

Commit

Permalink
xfs/195: Use XFSDUMP_PROG instead of xfsdump directly
Browse files Browse the repository at this point in the history
Use appropriate environment variable (XFSDUMP_PROG) instead of
hardcoding 'xfsdump' name. Also make the test fail graciously when
xfsdump isn't installed.

We also make XFSDUMP_PROG be equal to empty string instead of -e when
xfsdump isn't installed. The changes require some tweaking to output
filtering since full command path now appears in the output.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
  • Loading branch information
jankara authored and dchinner committed Nov 10, 2014
1 parent 027bcfa commit fa7f9fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion common/config
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ export XFS_IO_PROG="`set_prog_path xfs_io`"
export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`"
export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
export __XFSDUMP_PROG="`set_prog_path xfsdump`"
export XFSDUMP_PROG="$__XFSDUMP_PROG -e"
if [ -n "$__XFSDUMP_PROG" ]; then
export XFSDUMP_PROG="$__XFSDUMP_PROG -e"
else
export XFSDUMP_PROG=""
fi
export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
export GETFATTR_PROG="`set_prog_path getfattr`"
Expand Down
7 changes: 4 additions & 3 deletions tests/xfs/195
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
#
_do_dump()
{
xfsdump -l 0 -s d -F \
$XFSDUMP_PROG -l 0 -s d -F \
-L prova -M prova \
-f $TEST_DIR/dumpfile -e -v excluded_files=debug $TEST_DIR \
-f $TEST_DIR/dumpfile -v excluded_files=debug $TEST_DIR \
| grep "ino $inum" \
| sed -e 's/xfsdump: pruned ino [0-9]*, owner 0, estimated size 0: skip flag set/xfsdump: pruned ino NNN, owner 0, estimated size 0: skip flag set/'
| sed -e 's/.*xfsdump: pruned ino [0-9]*, owner 0, estimated size 0: skip flag set/xfsdump: pruned ino NNN, owner 0, estimated size 0: skip flag set/'
}

# get standard environment, filters and checks
Expand All @@ -65,6 +65,7 @@ _supported_os Linux

_require_test
_require_user
_require_command $XFSDUMP_PROG xfsdump

echo "Preparing subtree"
mkdir $TEST_DIR/d
Expand Down

0 comments on commit fa7f9fb

Please sign in to comment.