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-2002 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
|
#
|
2009-05-28 17:04:15 +02:00
|
|
|
# FS QA Test No. 013
|
|
|
|
|
#
|
|
|
|
|
# fsstress
|
2001-01-15 05:01:19 +00:00
|
|
|
#
|
|
|
|
|
seq=`basename $0`
|
2013-03-15 12:28:02 +00:00
|
|
|
seqres=$RESULT_DIR/$seq
|
2001-01-15 05:01:19 +00:00
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=/tmp/$$
|
|
|
|
|
status=0 # success is the default!
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
2004-06-15 07:32:36 +00:00
|
|
|
cd /
|
2001-01-15 05:01:19 +00:00
|
|
|
# we might get here with a RO FS
|
2016-02-19 10:45:04 +11:00
|
|
|
_test_cycle_mount
|
2005-06-02 06:03:36 +00:00
|
|
|
# now remove fsstress directory.
|
2017-07-20 21:22:05 -07:00
|
|
|
rm -rf $TEST_DIR/fsstress.$$.*
|
2001-01-15 05:01:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
2013-03-15 12:28:04 +00:00
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
_do_test()
|
|
|
|
|
{
|
|
|
|
|
_n="$1"
|
|
|
|
|
_param="$2"
|
|
|
|
|
_count="$3"
|
2005-12-09 02:52:22 +00:00
|
|
|
|
2013-12-03 10:29:26 +11:00
|
|
|
out=$TEST_DIR/fsstress.$$.$_n
|
2001-01-15 05:01:19 +00:00
|
|
|
rm -rf $out
|
|
|
|
|
if ! mkdir $out
|
|
|
|
|
then
|
|
|
|
|
echo " failed to mkdir $out"
|
|
|
|
|
status=1
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2005-12-09 02:52:22 +00:00
|
|
|
|
2001-01-15 05:01:19 +00:00
|
|
|
echo ""
|
|
|
|
|
echo "-----------------------------------------------"
|
|
|
|
|
echo "fsstress.$_n : $_param"
|
|
|
|
|
echo "-----------------------------------------------"
|
2003-07-17 23:06:11 +00:00
|
|
|
# -m limits number of users/groups so check doesn't fail (malloc) later
|
2013-03-15 12:28:02 +00:00
|
|
|
dbgoutfile=$seqres.full
|
2005-12-09 02:52:22 +00:00
|
|
|
if ! $FSSTRESS_PROG $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1
|
2001-01-15 05:01:19 +00:00
|
|
|
then
|
2013-03-15 12:28:02 +00:00
|
|
|
echo " fsstress (count=$_count) returned $? - see $seqres.full"
|
2013-03-15 12:28:06 +00:00
|
|
|
echo "--------------------------------------" >>$seqres.full
|
|
|
|
|
echo "$_n - output from fsstress:" >>$seqres.full
|
|
|
|
|
echo "--------------------------------------" >>$seqres.full
|
|
|
|
|
echo "<NOT LOGGED>" >>$seqres.full
|
|
|
|
|
#cat $tmp.out >>$seqres.full
|
2001-01-15 05:01:19 +00:00
|
|
|
status=1
|
|
|
|
|
fi
|
2003-07-14 05:12:23 +00:00
|
|
|
|
2003-05-22 04:16:45 +00:00
|
|
|
_check_test_fs
|
2001-01-15 05:01:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# real QA test starts here
|
2009-05-28 11:37:38 -05:00
|
|
|
_supported_fs generic
|
2017-07-20 21:22:05 -07:00
|
|
|
_supported_os Linux
|
2014-08-13 11:08:41 +10:00
|
|
|
_require_test
|
2004-06-15 07:32:36 +00:00
|
|
|
|
2013-03-15 12:28:06 +00:00
|
|
|
rm -f $seqres.full
|
2002-01-22 05:41:53 +00:00
|
|
|
echo "brevity is wit..."
|
2001-01-15 05:01:19 +00:00
|
|
|
|
2004-08-10 03:55:47 +00:00
|
|
|
count=1000
|
2003-07-14 05:12:23 +00:00
|
|
|
procs=20
|
2001-01-15 05:01:19 +00:00
|
|
|
|
2003-05-22 04:16:45 +00:00
|
|
|
_check_test_fs
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
# the default
|
|
|
|
|
|
|
|
|
|
_do_test 1 "-r" $count
|
|
|
|
|
|
|
|
|
|
# and the default with multiprocess
|
|
|
|
|
|
2003-07-14 05:12:23 +00:00
|
|
|
_do_test 2 "-p $procs -r" $count
|
2001-01-15 05:01:19 +00:00
|
|
|
|
|
|
|
|
# from Glen's notes
|
|
|
|
|
|
|
|
|
|
_do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count
|
|
|
|
|
|
2013-03-15 12:28:02 +00:00
|
|
|
# if all ok by here then probably don't need $seqres.full
|
|
|
|
|
rm -f $seqres.full
|
2004-08-10 03:55:47 +00:00
|
|
|
|
2001-01-15 05:01:19 +00:00
|
|
|
exit
|
|
|
|
|
|
|
|
|
|
# Test with error injection:
|
2005-12-09 02:52:22 +00:00
|
|
|
#
|
2001-01-15 05:01:19 +00:00
|
|
|
# (error injection)
|
|
|
|
|
# fsstress -n 1000 -d $scratch -p 4 -z -f rmdir=10 -f link=10 -f creat=10 \
|
|
|
|
|
# -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20 \
|
|
|
|
|
# -e 1
|
2005-12-09 02:52:22 +00:00
|
|
|
#
|
2001-01-15 05:01:19 +00:00
|
|
|
# Error values 1 - 6 test IFLUSH
|
|
|
|
|
# 1 - corrupt buffer being flushed to di_core.di_magic
|
|
|
|
|
# 2 - corrupt inode being flushed i_d.di_magic
|
2003-10-07 21:21:25 +00:00
|
|
|
# 3 - corrupt S_IFREG format check
|
|
|
|
|
# 4 - corrupt S_IFDIR format check
|
2001-01-15 05:01:19 +00:00
|
|
|
# 5 - corrupt i_d.di_nextents
|
|
|
|
|
# 6 - corrupt i_d.di_forkoff > sb_inodesize
|