Files
apfstests/tests/generic/051
T
Jaegeuk Kim 9db4da5c43 generic: relocate xfs shutdown tests into tests/generic/
This patch moves the generic testcases defined in xfs into
tests/generic/.

  xfs/053 -> generic/042
  xfs/137 -> generic/043
  xfs/138 -> generic/044
  xfs/139 -> generic/045
  xfs/140 -> generic/046
  xfs/179 -> generic/047
  xfs/180 -> generic/048
  xfs/182 -> generic/049
  xfs/200 -> generic/050
  xfs/306 -> generic/051

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2015-02-12 14:20:27 +11:00

106 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# FS QA Test No. 051
#
# Basic log recovery stress test - do lots of stuff, shut down in the middle of
# it and check that recovery runs to completion and everything can be
# successfully removed afterwards..
#
#-----------------------------------------------------------------------
# Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#-----------------------------------------------------------------------
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
_cleanup()
{
cd /
umount $SCRATCH_MNT 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# real QA test starts here
_supported_fs generic
_supported_os Linux
_require_scratch
_require_scratch_shutdown
rm -f $seqres.full
_scratch_mkfs > $seqres.full 2>&1
_scratch_mount
SLEEP_TIME=$((30 * $TIME_FACTOR))
PROCS=$((2 * LOAD_FACTOR))
load_dir=$SCRATCH_MNT/test
# let this run for a while
$FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
sleep $SLEEP_TIME
killall -q $FSSTRESS_PROG
wait
sync
umount $SCRATCH_MNT
# now mount again, run the load again, this time with a shutdown.
_scratch_mount
$XFS_FSR_PROG -v $load_dir >> $seqres.full 2>&1
$FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
sleep $SLEEP_TIME
sync
# now shutdown and unmount
sleep 5
$here/src/godown $load_dir
killall -q $FSSTRESS_PROG
wait
# for some reason fsstress processes manage to live on beyond the wait?
sleep 5
umount $SCRATCH_MNT
# now recover, check the filesystem for consistency
_scratch_mount
umount $SCRATCH_MNT
_check_scratch_fs
# now clean up.
_scratch_mount
for d in $load_dir/*; do
rm -rf $d > /dev/null 2>&1 &
done
wait
umount $SCRATCH_MNT
echo "No output is good. Failures are loud."
status=0
exit