Modify dassi QA scratch device
[xfstests-dev.git] / 166
1 #! /bin/sh
2 # FSQA Test No. 166
3 #
4 # ->page-mkwrite test - unwritten extents and mmap
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 status=1    # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     _cleanup_testdir
24 }
25
26 # get standard environment, filters and checks
27 . ./common.rc
28 . ./common.filter
29
30 _filter_blocks()
31 {
32         $AWK_PROG '/[0-9]/ {
33                 if ($7)
34                         print $1, $2, "XX..YY", "AG", "(AA..BB)", $6, $7;
35                 else
36                         print $1, $2, "XX..YY", "AG", "(AA..BB)", $6;
37         }'
38 }
39
40 # real QA test starts here
41 _supported_fs xfs
42 _supported_os Linux
43
44 _setup_testdir
45 _require_scratch
46 _scratch_mkfs_xfs >/dev/null 2>&1
47 _scratch_mount
48
49 TEST_FILE=$SCRATCH_MNT/test_file
50 TEST_PROG=$here/src/unwritten_mmap
51 FILE_SIZE=131072
52
53 rm -f $TEST_FILE
54 $TEST_PROG $FILE_SIZE $TEST_FILE
55
56 xfs_bmap -vp $TEST_FILE | _filter_blocks
57
58 status=0
59 exit