Wipe the scratch devices in between each test to ensure that tests are
formatting them and not making assumptions about previous contents.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
if [ -f ${RESULT_DIR}/require_scratch ]; then
_check_scratch_fs || err=true
rm -f ${RESULT_DIR}/require_scratch*
if [ -f ${RESULT_DIR}/require_scratch ]; then
_check_scratch_fs || err=true
rm -f ${RESULT_DIR}/require_scratch*
- else
- _scratch_unmount 2> /dev/null
+ _scratch_unmount 2> /dev/null
echo "check: failed to mount \$SCRATCH_DEV using specified options"
status=1
exit
echo "check: failed to mount \$SCRATCH_DEV using specified options"
status=1
exit
+ else
+ _scratch_unmount
# _check_dmesg depends on this log in dmesg
touch ${RESULT_DIR}/check_dmesg
fi
# _check_dmesg depends on this log in dmesg
touch ${RESULT_DIR}/check_dmesg
fi
+ _try_wipe_scratch_devs > /dev/null 2>&1
if [ "$DUMP_OUTPUT" = true ]; then
./$seq 2>&1 | tee $tmp.out
# Because $? would get tee's return code
if [ "$DUMP_OUTPUT" = true ]; then
./$seq 2>&1 | tee $tmp.out
# Because $? would get tee's return code
+_try_wipe_scratch_devs()
+{
+ test -x "$WIPEFS_PROG" || return 0
+
+ for dev in $SCRATCH_DEV_POOL $SCRATCH_DEV $SCRATCH_LOGDEV $SCRATCH_RTDEV; do
+ test -b $dev && $WIPEFS_PROG -a $dev
+ done
+}
+
init_rc
################################################################################
init_rc
################################################################################
+ _scratch_mkfs_xfs >/dev/null 2>&1
_scratch_xfs_db -x -c "help" | grep $command > /dev/null || \
_notrun "xfs_db $command support is missing"
}
_scratch_xfs_db -x -c "help" | grep $command > /dev/null || \
_notrun "xfs_db $command support is missing"
}