mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
2b4eae7fd8
Enable shutdown tests on overlayfs. This requires configuring overlayfs with TEST|SCRATCH_DEV pointing to block device, which act as base fs of overlay. The legacy config (pointing TEST|SCRATCH_DEV to existing directories) won't support shutdown. Extend _require_scratch_shutdown() to deal with overlay by checking shutdown support on $OVL_BASE_SCRATCH_MNT instead of $SCRATCH_MNT, so we check shutdown support status against the underlying upper fs of overlay. Introduce new _scratch_shutdown() helper to do the actual shutdown work and shutdown upper fs in the case of overlay. Also converting existing bare 'src/godown' calls to use this helper to avoid false failures when testing overlayfs. generic/042 and generic/050 assume $SCRATCH_DEV to be a local device, so add _require_local_device $SCRATCH_DEV rule. [eguan: rewrite commit log] Signed-off-by: Chengguang Xu <cgxu519@icloud.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
84 lines
2.0 KiB
Bash
Executable File
84 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# FS QA Test No. 461
|
|
#
|
|
# Shutdown stress test - exercise shutdown codepath with fsstress,
|
|
# make sure we don't BUG/WARN. Coverage for all fs with shutdown.
|
|
#
|
|
#-----------------------------------------------------------------------
|
|
# Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
|
|
# Copyright (c) 2017 Google, 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 /
|
|
_scratch_unmount 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_nocheck
|
|
_require_scratch_shutdown
|
|
_require_command "$KILLALL_PROG" killall
|
|
|
|
rm -f $seqres.full
|
|
|
|
_scratch_mkfs > $seqres.full 2>&1
|
|
_scratch_mount
|
|
|
|
SLEEP_TIME=$((10 * $TIME_FACTOR))
|
|
PROCS=$((4 * LOAD_FACTOR))
|
|
|
|
load_dir=$SCRATCH_MNT/test
|
|
|
|
$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
|
|
sleep $SLEEP_TIME
|
|
sync
|
|
|
|
# now shutdown and unmount
|
|
sleep 5
|
|
_scratch_shutdown
|
|
$KILLALL_PROG -q $FSSTRESS_PROG
|
|
wait
|
|
|
|
# for some reason fsstress processes manage to live on beyond the wait?
|
|
sleep 5
|
|
|
|
_scratch_unmount
|
|
|
|
echo "Silence is golden"
|
|
|
|
status=0
|
|
exit
|