Update xfsprogs to latest kernel headers and functions
[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 killall="/usr/bin/killall"
17 here=`pwd`
18 tmp=/tmp/$$
19 rm -f $seq.full
20 status=1    # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
22
23 _cleanup()
24 {
25         killall -r -q -TERM fsstress 2> /dev/null
26         sync    # ensures all fsstress processes died
27         _cleanup_testdir
28 }
29
30 workout()
31 {
32         procs=100
33         nops=15000
34         $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n $nops $FSSTRESS_AVOID \
35                 >>$seq.full &
36         sleep 2
37 }
38
39 # get standard environment, filters and checks
40 . ./common.rc
41 . ./common.filter
42
43 # real QA test starts here
44 _supported_fs xfs
45 _supported_os Linux
46
47 [ -x $killall ] || _notrun "$killall executable not found"
48
49 _setup_testdir
50 _require_scratch
51 _scratch_mkfs_xfs >/dev/null 2>&1
52 _scratch_mount
53
54 TEST_FILE=$SCRATCH_MNT/test_file
55 TEST_PROG=$here/src/unwritten_sync
56 LOOPS=50
57
58 echo "*** test unwritten extent conversion under heavy I/O"
59
60 workout
61
62 rm -f $TEST_FILE
63 $TEST_PROG $LOOPS $TEST_FILE
64
65 echo "     *** test done"
66
67 status=0
68 exit