xfs: minor fixes to the fsmap tests

Refactor the fsmap tests slightly to use new helpers, and
fix some minor output scanning issues.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2017-02-24 17:12:51 -08:00
committed by Eryu Guan
parent 58a0630b2b
commit 47bef98866
3 changed files with 3 additions and 6 deletions
+1 -2
View File
@@ -50,8 +50,7 @@ _require_xfs_io_command "fsmap"
rm -f "$seqres.full"
echo "Format and mount"
_scratch_mkfs > "$seqres.full" 2>&1
_scratch_populate >> $seqres.full
_scratch_populate_cached nofill > $seqres.full 2>&1
echo "Compare fsmap" | tee -a $seqres.full
_scratch_mount
+1 -3
View File
@@ -42,11 +42,9 @@ _cleanup()
# real QA test starts here
_supported_os Linux
_supported_fs xfs
_require_logdev
_require_scratch
_require_xfs_io_command "fsmap"
if [ "$USE_EXTERNAL" != "yes" ] || [ -z "$SCRATCH_LOGDEV" ]; then
_notrun "Need external log device"
fi
rm -f "$seqres.full"
+1 -1
View File
@@ -77,7 +77,7 @@ done
echo "Check device field of FS metadata and realtime file"
data_dev=$(grep 'static fs metadata' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
rt_dev=$(grep "${ino}[[:space:]]*[0-9]*\.\.[0-9]*" $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
rt_dev=$(grep "${ino}[[:space:]]*[0-9]*\.\.[0-9]*[[:space:]]*[0-9]*$" $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
test "${data_dev}" != "${rt_dev}" || echo "data ${data_dev} realtime ${rt_dev}?"
# success, all done