Merge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev
[xfstests-dev.git] / 167
1 #! /bin/sh
2 # FSQA Test No. 167
3 #
4 # unwritten extent conversion test
5 #
6 #-----------------------------------------------------------------------
7 #  Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=dgc@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 rm -f $seq.full
19 status=1    # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24         $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
25         sync    # ensures all fsstress processes died
26         _cleanup_testdir
27 }
28
29 workout()
30 {
31         procs=100
32         nops=15000
33         $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n $nops $FSSTRESS_AVOID \
34                 >>$seq.full &
35         sleep 2
36 }
37
38 # get standard environment, filters and checks
39 . ./common.rc
40 . ./common.filter
41
42 # real QA test starts here
43 _supported_fs xfs
44 _supported_os Linux
45
46 [ -x $KILLALL_PROG ] || _notrun "killall executable not found"
47
48 _setup_testdir
49 _require_scratch
50 _scratch_mkfs_xfs >/dev/null 2>&1
51 _scratch_mount
52
53 TEST_FILE=$SCRATCH_MNT/test_file
54 TEST_PROG=$here/src/unwritten_sync
55 LOOPS=50
56
57 echo "*** test unwritten extent conversion under heavy I/O"
58
59 workout
60
61 rm -f $TEST_FILE
62 $TEST_PROG $LOOPS $TEST_FILE
63
64 echo "     *** test done"
65
66 status=0
67 exit