change scratch fs to xfs_scratch
[xfstests-dev.git] / 161
1 #! /bin/sh
2 # FSQA Test No. 161
3 #
4 # DMAPI function punch hole. Create 3Mb file and punch a hole from
5 # offset 1Mb to EOF
6 #
7 #-----------------------------------------------------------------------
8 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
9 #-----------------------------------------------------------------------
10 #
11 # creator
12 owner=allanr@sgi.com
13
14 seq=`basename $0`
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1    # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24     _cleanup_testdir
25 }
26
27 _filter_get_allocinfo()
28 {
29     $SED_PROG -e "s#$qa_file#QA_FILE#g" \
30               -e "s#18014398509481983\|34359738367#MAX_FILE_BLOCKS#g"
31 }
32
33 # get standard environment, filters and checks
34 . ./common.rc
35 . ./common.filter
36 . ./common.dmapi
37
38 # real QA test starts here
39 _supported_fs xfs
40 _supported_os Linux IRIX
41
42 _require_scratch
43 _scratch_mkfs_xfs >/dev/null 2>&1
44 _dmapi_scratch_mount
45
46 qa_file=$SCRATCH_MNT/dmapi_hole_file
47
48 dd if=/dev/zero bs=1024k count=3 of=$qa_file
49
50 ${DMAPI_QASUITE1_DIR}cmd/get_allocinfo $qa_file | _filter_get_allocinfo
51 ${DMAPI_QASUITE1_DIR}cmd/probe_hole -o 1048576 -l 0 $qa_file
52 ${DMAPI_QASUITE1_DIR}cmd/punch_hole -o 1048576 -l 0 $qa_file
53 ${DMAPI_QASUITE1_DIR}cmd/get_allocinfo $qa_file | _filter_get_allocinfo
54
55 status=0
56 exit