4 # Run fsstress and ENSPC hitters in parallel, check quota and
5 # fs consistency an the end
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
26 owner=dmonakhov@openvz.org
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
41 # Disable all sync operations to get higher load
42 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
50 out=$SCRATCH_MNT/fsstress.$$
51 args="-p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out"
52 echo "fsstress $args" >> $here/$seq.full
53 # Grant chown capability
54 cp $FSSTRESS_PROG $tmp.fsstress.bin
55 if [ "`whereis setcap`" == "setcap:" ]; then
56 _notrun "setcap not installed."
58 setcap cap_chown=epi $tmp.fsstress.bin
60 (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1
63 echo "Run dd writers in parallel"
64 for ((i=0; i < num_iterations; i++))
66 # File will be opened with O_TRUNC each time
67 su $qa_user -c "dd if=/dev/zero \
68 of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M " \
69 >> $here/$seq.full 2>&1
73 killall $tmp.fsstress.bin
77 # real QA test starts here
85 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seq.full 2>&1
86 _scratch_mount "-o usrquota,grpquota"
87 chmod 777 $SCRATCH_MNT
88 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
89 quotaon -u -g $SCRATCH_MNT 2>/dev/null
92 _scratch_unmount 2>/dev/null
96 if ! _check_quota_usage; then
97 _scratch_unmount 2>/dev/null
102 echo Comparing filesystem consistency
103 if ! _scratch_unmount; then
104 echo "failed to umount"