@@ -218,6 +218,19 @@ _scratch_xfs_db()
$XFS_DB_PROG "$@" $(_scratch_xfs_db_options)
}
+_test_xfs_db_options()
+{
+ TEST_OPTIONS=""
+ [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
+ TEST_OPTIONS="-l$TEST_LOGDEV"
+ echo $TEST_OPTIONS $* $TEST_DEV
+}
+
+_test_xfs_db()
+{
+ $XFS_DB_PROG "$@" $(_test_xfs_db_options)
+}
+
_scratch_xfs_admin()
{
local options=("$SCRATCH_DEV")
@@ -38,32 +38,32 @@ test_done()
# real QA test starts here
echo "=== TEST 1 ==="
-xfs_db -r -c 'pop' -c 'type sb' $TEST_DEV
+_test_xfs_db -r -c 'pop' -c 'type sb'
test_done
echo "=== TEST 2 ==="
-xfs_db -r -c 'push sb' $TEST_DEV
+_test_xfs_db -r -c 'push sb'
test_done
echo "=== TEST 3 ==="
-xfs_db -r -c 'pop' -c 'push sb' $TEST_DEV
+_test_xfs_db -r -c 'pop' -c 'push sb'
test_done
echo "=== TEST 4 ==="
-xfs_db -r -c 'type sb' -c 'print' $TEST_DEV
+_test_xfs_db -r -c 'type sb' -c 'print'
test_done
echo "=== TEST 5 ==="
-xfs_db -r -c 'inode 128' -c 'push' -c 'type' $TEST_DEV >$tmp.out 2>&1
+_test_xfs_db -r -c 'inode 128' -c 'push' -c 'type' >$tmp.out 2>&1
test_done
if ! grep -q "current type is \"inode\"" $tmp.out; then
cat $tmp.out
fi
echo "=== TEST 6 ==="
-xfs_db -r -c 'sb' -c 'a' $TEST_DEV >$tmp.out 2>&1 # don't care about output
+_test_xfs_db -r -c 'sb' -c 'a' >$tmp.out 2>&1 # don't care about output
test_done
echo "=== TEST 7 ==="
-xfs_db -r -c 'ring' $TEST_DEV
+_test_xfs_db -r -c 'ring'
test_done
@@ -149,7 +149,7 @@ _log_sunit()
_after_log()
{
- xfs_db -r $1 -c "sb" -c "print" | $AWK_PROG '
+ _scratch_xfs_db -r -c "sb" -c "print" | $AWK_PROG '
/logstart/ { logstart = $3 }
/logblocks/ { logblocks = $3 }
END {
@@ -163,7 +163,7 @@ _check_corrupt()
f="c6c6c6c6"
echo "*** check for corruption"
echo "expect $f..." >>$seqres.full
- xfs_db -r -c "fsblock $2" -c "print" $1 | head | tee -a $seqres.full | \
+ _scratch_xfs_db -r -c "fsblock $2" -c "print" | head | tee -a $seqres.full | \
grep -q -v "$f $f $f $f $f $f $f $f" && \
_fail "!!! block $2 corrupted!"
}
@@ -21,7 +21,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
_get_existing_uuid()
{
- xfs_db -r $TEST_DEV -c "uuid" | $AWK_PROG '/^UUID/ { print $3 }'
+ _test_xfs_db -r -c "uuid" | $AWK_PROG '/^UUID/ { print $3 }'
}
# real QA test starts here