common/rc: Add _require_{chown,chmod}()
[xfstests-dev.git] / tests / generic / 141
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. 141
6 #
7 # Test for xfs_io mmap read problem
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
22 # real QA test starts here
23 _supported_fs generic
24
25 _require_scratch
26 _scratch_mkfs >/dev/null 2>&1
27 _scratch_mount
28
29 # create file, mmap a region and mmap read it
30 file=$SCRATCH_MNT/mmap
31
32 $XFS_IO_PROG -f -c "pwrite 0 1024k" -c "mmap 64k 64k" -c "mread -r" $file > /dev/null
33
34 rm -f $file
35
36 status=0
37 exit