Add GPL license plate to SGI's test files.
[xfstests-dev.git] / 167
1 #! /bin/sh
2 #
3 #-----------------------------------------------------------------------
4 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
9 #
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 #
19 #-----------------------------------------------------------------------
20 #
21 # FSQA Test No. 167
22 #
23 # unwritten extent conversion test
24 #
25 # creator
26 owner=dgc@sgi.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 killall="/usr/bin/killall"
32 here=`pwd`
33 tmp=/tmp/$$
34 rm -f $seq.full
35 status=1    # failure is the default!
36 trap "_cleanup; exit \$status" 0 1 2 3 15
37
38 _cleanup()
39 {
40         killall -r -q -TERM fsstress 2> /dev/null
41         sync    # ensures all fsstress processes died
42         _cleanup_testdir
43 }
44
45 workout()
46 {
47         procs=100
48         nops=15000
49         $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n $nops $FSSTRESS_AVOID \
50                 >>$seq.full &
51         sleep 2
52 }
53
54 # get standard environment, filters and checks
55 . ./common.rc
56 . ./common.filter
57
58 # real QA test starts here
59 _supported_fs xfs
60 _supported_os Linux
61
62 [ -x $killall ] || _notrun "$killall executable not found"
63
64 _setup_testdir
65 _require_scratch
66 _scratch_mkfs_xfs >/dev/null 2>&1
67 _scratch_mount
68
69 TEST_FILE=$SCRATCH_MNT/test_file
70 TEST_PROG=$here/src/unwritten_sync
71 LOOPS=50
72
73 echo "*** test unwritten extent conversion under heavy I/O"
74
75 workout
76
77 rm -f $TEST_FILE
78 $TEST_PROG $LOOPS $TEST_FILE
79
80 echo "     *** test done"
81
82 status=0
83 exit