fix XFSQA 145 / test_hole
[xfstests-dev.git] / 177
1 #! /bin/sh
2 # FS QA Test No. 177
3 #
4 # Test to reproduce PV#: 964316
5 # Check sync reclaims and flushes unlinked inodes to their buffers.
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=mohamedb@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     cd /
24     rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common.rc
29 . ./common.filter
30 . ./common.dmapi
31
32 # real QA test starts here
33
34 # Modify as appropriate.
35 _supported_fs xfs 
36 _supported_os Linux
37
38 # Setup Filesystem
39 _require_scratch
40
41 # test that we have DMAPI support
42 _dmapi_scratch_mount
43 umount $SCRATCH_MNT > /dev/null 2>&1
44
45 _scratch_mkfs_xfs >/dev/null 2>&1 \
46         || _fail "mkfs failed"
47
48 _scratch_mount \
49         || _fail "mount failed"
50
51 # run Mark Goodwin test here
52 # Usage: ./bulkstat_unlink_test iterations nfiles stride dir
53 #        Create dir with nfiles, unlink each stride'th file, sync, bulkstat
54 echo "Start original bulkstat_unlink_test"
55 $here/src/bulkstat_unlink_test 10 100 1 $SCRATCH_MNT/bulkstat
56 $here/src/bulkstat_unlink_test 10 1000 1 $SCRATCH_MNT/bulkstat
57 $here/src/bulkstat_unlink_test 15 100 6 $SCRATCH_MNT/bulkstat
58 $here/src/bulkstat_unlink_test 20 1000 3 $SCRATCH_MNT/bulkstat
59
60 # Mount scratch with ikeep enabled
61 umount $SCRATCH_MNT
62 _scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT" \
63         || _fail "mount failed"
64
65 echo "Start bulkstat_unlink_test_modified"
66 $here/src/bulkstat_unlink_test_modified 10 1000 1 $SCRATCH_MNT/bulkstat
67
68
69 # success, all done
70 status=0
71 exit