2010-01-20 10:27:08 +11:00
|
|
|
#! /bin/bash
|
2018-06-09 11:35:42 +10:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
|
#
|
2015-02-12 14:22:59 +11:00
|
|
|
# FS QA Test No. 052
|
2009-05-28 17:04:15 +02:00
|
|
|
#
|
|
|
|
|
# To test log replay by shutdown of file system
|
|
|
|
|
# This is the first simple initial test to ensure that
|
|
|
|
|
# the goingdown ioctl is working and recovery of
|
|
|
|
|
# create transactions is working.
|
2009-05-12 13:24:15 -05:00
|
|
|
#
|
2004-02-10 03:10:49 +00:00
|
|
|
seq=`basename $0`
|
2013-03-15 12:28:02 +00:00
|
|
|
seqres=$RESULT_DIR/$seq
|
2004-02-10 03:10:49 +00:00
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=/tmp/$$
|
|
|
|
|
status=1 # failure is the default!
|
2004-04-23 04:08:39 +00:00
|
|
|
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
2013-03-15 12:28:04 +00:00
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
|
|
|
|
. ./common/log
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
# real QA test starts here
|
2015-02-12 14:22:59 +11:00
|
|
|
_supported_fs generic
|
2017-07-20 21:22:05 -07:00
|
|
|
_supported_os Linux
|
2004-02-10 03:10:49 +00:00
|
|
|
|
2013-03-15 12:28:02 +00:00
|
|
|
rm -f $seqres.full
|
2004-02-10 03:10:49 +00:00
|
|
|
rm -f $tmp.log
|
|
|
|
|
|
|
|
|
|
_require_scratch
|
2015-02-12 14:14:52 +11:00
|
|
|
_require_scratch_shutdown
|
2015-02-12 14:20:58 +11:00
|
|
|
_require_logstate
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
echo "mkfs"
|
2015-02-12 14:22:59 +11:00
|
|
|
_scratch_mkfs >>$seqres.full 2>&1 \
|
2004-02-10 03:10:49 +00:00
|
|
|
|| _fail "mkfs scratch failed"
|
2017-03-06 19:45:57 +08:00
|
|
|
_require_metadata_journaling $SCRATCH_DEV
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
echo "mount"
|
2018-02-07 17:31:36 +08:00
|
|
|
_scratch_mount
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
echo "touch files"
|
|
|
|
|
touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
|
|
|
|
|
|
|
|
|
|
echo "godown"
|
2017-12-15 15:47:33 +08:00
|
|
|
_scratch_shutdown -v -f >> $seqres.full
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
echo "unmount"
|
2015-12-21 18:07:43 +11:00
|
|
|
_scratch_unmount
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
echo "logprint after going down..."
|
2004-06-25 03:09:08 +00:00
|
|
|
_print_logstate
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
# curious if FS consistent at start
|
|
|
|
|
if false; then
|
2016-09-26 16:44:42 +08:00
|
|
|
if _check_scratch_fs; then
|
2004-02-10 03:10:49 +00:00
|
|
|
echo "*** checked ok ***"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "mount with replay"
|
2018-02-07 17:31:36 +08:00
|
|
|
_try_scratch_mount $mnt >>$seqres.full 2>&1 \
|
2004-02-10 03:10:49 +00:00
|
|
|
|| _fail "mount failed: $mnt $MOUNT_OPTIONS"
|
|
|
|
|
|
2004-02-20 02:47:33 +00:00
|
|
|
echo "ls SCRATCH_MNT"
|
2017-02-05 01:53:36 -05:00
|
|
|
ls $SCRATCH_MNT | _filter_lostfound
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
echo "unmount"
|
2015-12-21 18:07:43 +11:00
|
|
|
_scratch_unmount
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
echo "logprint after mount and replay..."
|
2004-06-25 03:09:08 +00:00
|
|
|
_print_logstate
|
2004-02-10 03:10:49 +00:00
|
|
|
|
|
|
|
|
# success, all done
|
|
|
|
|
status=0
|
|
|
|
|
exit
|