xfs/029: filter out "extended-header: cycle: 1" from output
[xfstests-dev.git] / tests / xfs / 185
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FSQA Test No. 185
6 #
7 # Dmapi Punch/Probe Alignment compared to xfsctl(FREESPACE); 
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1    # failure is the default!
16 trap "exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/filter
21 . ./common/dmapi
22
23 # real QA test starts here
24 _supported_fs xfs
25 _supported_os Linux
26
27 _require_scratch
28 _scratch_mkfs_xfs -b size=512 >/dev/null 2>&1
29 _dmapi_scratch_mount
30
31 cat > $tmp.dmapi-param <<EOF
32 # length        offset
33   16k           0    # page aligned
34   1k            0    # not page aligned
35 # random tests
36   1k            4k
37   4k            1k
38   1024k         512k
39 EOF
40
41 mkdir -p $SCRATCH_MNT/dmapi
42 f=$SCRATCH_MNT/dmapi/holly_file
43 e=${DMAPI_QASUITE1_DIR}cmd/probe_punch_xfsctl_hole
44
45 cat $tmp.dmapi-param | sed s/'\#.*'//g| grep . |while read l o; do
46     echo "======================================================="
47         echo "Testing with length = $l, offset = $o"
48
49         echo "Method:   xfsctl"
50         dd if=/dev/zero bs=1024k count=3 of=$f >/dev/null 2>&1
51         $e -x -l$l -o$o $f | _filter_scratch
52
53         echo "Method:   dmapi_probe"
54         dd if=/dev/zero bs=1024k count=3 of=$f >/dev/null 2>&1
55         $e -l$l -o$o $f | _filter_scratch
56
57         echo "Method:   dmapi_punch"
58         $e -p -l$l -o$o $f | _filter_scratch
59         echo "======================================================="
60 done
61
62 rm -rf $tmp.dmapi-param
63
64 status=0
65 exit