QA test to exercise unwritten extent conversion for sync direct I/O
[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 -q -TERM fsstress 2> /dev/null
25         _cleanup_testdir
26 }
27
28 workout()
29 {
30         procs=100
31         nops=15000
32         $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n $nops $FSSTRESS_AVOID \
33                 >>$seq.full &
34         sleep 2
35 }
36
37 # get standard environment, filters and checks
38 . ./common.rc
39 . ./common.filter
40
41 # real QA test starts here
42 _supported_fs xfs
43 _supported_os Linux
44
45 _setup_testdir
46 _require_scratch
47 _scratch_mkfs_xfs >/dev/null 2>&1
48 _scratch_mount
49
50 TEST_FILE=$SCRATCH_MNT/test_file
51 TEST_PROG=$here/src/unwritten_sync
52 LOOPS=100
53
54 echo "*** test unwritten extent conversion under heavy I/O"
55
56 workout
57
58 rm -f $TEST_FILE
59 $TEST_PROG $LOOPS $TEST_FILE
60 killall -q -TERM fsstress 2> /dev/null
61
62 echo "     *** test done"
63
64 status=0
65 exit