xfs/530: skip test if user MKFS_OPTIONS screw up formatting
[xfstests-dev.git] / tests / xfs / 084
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 084
6 #
7 # Exercises unwritten extent reads and writes, looking
8 # for data corruption (zeroes read) near the end of file.
9 #
10 . ./common/preamble
11 _begin_fstest ioctl rw auto
12
13 # Import common functions.
14 . ./common/filter
15
16 _filter_resv()
17 {
18         _filter_test_dir | sed -e 's/[0-9][0-9]* bytes/NUM bytes/g'
19 }
20
21 pgsize=`$here/src/feature -s`
22
23 # -i == number of iterations
24 # -l == bytes to leak on each iteration
25 # -b == read/write block size
26 # -s == preallocation size
27
28 # real QA test starts here
29 _supported_fs xfs
30 _require_xfs_io_command "falloc"
31 _require_test
32
33 echo
34 echo "*** First case - I/O blocksize same as pagesize"
35 $here/src/resvtest -i 20 -b $pgsize "$TEST_DIR/resv" | _filter_resv
36 res=${PIPESTATUS[0]}
37 [ $res -eq 137 ] && _notrun "resvtest -i 20 -b $pgsize was SIGKILLed (OOM?)"
38 [ $res -eq 0 ] && echo done
39 rm -f "$TEST_DIR/mumble"
40
41 echo
42 echo "*** Second case - 512 byte I/O blocksize"
43 $here/src/resvtest -i 40 -b 512 "$TEST_DIR/resv" | _filter_resv
44 res=${PIPESTATUS[0]}
45 [ $res -eq 137 ] && _notrun "resvtest -i 40 -b 512 was SIGKILLed (OOM?)"
46 [ $res -eq 0 ] && echo done
47 rm -f "$TEST_DIR/grumble"
48
49 # success, all done
50 status=0
51 exit