blob: 5ee4dfdbad70be0099c0a1520c0735b8100b60ac [file] [log] [blame]
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
#
# 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..
#
. ./common/preamble
_begin_fstest shutdown auto stress log metadata repair
# Import common functions.
. ./common/filter
_require_scratch
_require_scratch_shutdown
_scratch_mkfs > $seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
SLEEP_TIME=$((30 * $TIME_FACTOR))
PROCS=$((2 * LOAD_FACTOR))
load_dir=$SCRATCH_MNT/test
# let this run for a while
_run_fsstress_bg -n 10000000 -p $PROCS -d $load_dir
sleep $SLEEP_TIME
_kill_fsstress
_scratch_sync
_scratch_unmount
# now mount again, run the load again, this time with a shutdown.
_scratch_mount
$XFS_FSR_PROG -v $load_dir >> $seqres.full 2>&1
_run_fsstress_bg -n10000000 -p $PROCS -d $load_dir
sleep $SLEEP_TIME
_scratch_sync
# now shutdown and unmount
sleep 5
_scratch_shutdown
_kill_fsstress
# for some reason fsstress processes manage to live on beyond the wait?
sleep 5
_scratch_unmount
# now recover, check the filesystem for consistency
_scratch_mount
_scratch_unmount
_check_scratch_fs
# now clean up.
_scratch_mount
for d in $load_dir/*; do
rm -rf $d > /dev/null 2>&1 &
done
wait
_scratch_unmount
echo "No output is good. Failures are loud."
status=0
exit