generic: add test for boundary in xfs_attr_shortform_verify
[xfstests-dev.git] / tests / generic / 226
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Eric Sandeen.  All Rights Reserved.
4 #
5 # FS QA Test No. 226
6 #
7 # Test for prealloc space leaks by rewriting the same file in a loop
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 "rm -f $tmp.*; exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20
21 _supported_fs generic
22 _supported_os Linux
23 _require_scratch
24 _require_odirect
25
26 # real QA test starts here
27 rm -f $seqres.full
28
29 _scratch_unmount 2>/dev/null
30 echo "--> mkfs 256m filesystem"
31 _scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1
32 _scratch_mount
33
34 loops=16
35
36 # Buffer size argument supplied to xfs_io "pwrite" command
37 buffer="-b $(expr 512 \* 1024)"
38
39 echo "--> $loops buffered 64m writes in a loop"
40 for I in `seq 1 $loops`; do
41         echo -n "$I "
42         $XFS_IO_PROG -f \
43                 -c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
44         rm -f $SCRATCH_MNT/test
45 done
46
47 echo
48 _scratch_cycle_mount
49
50 echo "--> $loops direct 64m writes in a loop"
51 for I in `seq 1 $loops`; do
52         echo -n "$I "
53         $XFS_IO_PROG -f -d \
54                 -c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
55         rm -f $SCRATCH_MNT/test 
56 done
57
58 echo
59 _scratch_unmount
60
61 status=0
62 exit