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