fsx: Use %ll instead of %q in printf format statements
[xfstests-dev.git] / 185
1 #! /bin/sh
2 # FSQA Test No. 185
3 #
4 # Dmapi Punch/Probe Alignment compared to xfsctl(FREESPACE); 
5 #
6 #-----------------------------------------------------------------------
7 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=xaiki@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 . ./common.dmapi
30
31 # real QA test starts here
32 _supported_fs xfs
33 _supported_os Linux IRIX
34
35 _require_scratch
36 _scratch_mkfs_xfs -b size=512 >/dev/null 2>&1
37 _dmapi_scratch_mount
38
39
40 cat > $tmp.dmapi-param <<EOF
41 # length        offset
42   16k           0    # page aligned
43   1k            0    # not page aligned
44 # random tests
45   1k            4k
46   4k            1k
47   1024k         512k
48 EOF
49
50 mkdir -p $SCRATCH_MNT/dmapi
51 f=$SCRATCH_MNT/dmapi/holly_file
52 e=${DMAPI_QASUITE1_DIR}cmd/probe_punch_xfsctl_hole
53
54 cat $tmp.dmapi-param | sed s/'\#.*'//g| grep . |while read l o; do
55     echo "======================================================="
56         echo "Testing with length = $l, offset = $o"
57
58         echo "Method:   xfsctl"
59         dd if=/dev/zero bs=1024k count=3 of=$f >/dev/null 2>&1
60         $e -x -l$l -o$o $f
61
62         echo "Method:   dmapi_probe"
63         dd if=/dev/zero bs=1024k count=3 of=$f >/dev/null 2>&1
64         $e -l$l -o$o $f
65
66         echo "Method:   dmapi_punch"
67         $e -p -l$l -o$o $f 
68         echo "======================================================="
69 done
70
71 rm -rf $tmp.dmapi-param
72
73 status=0
74 exit