fstests: move test group info to test files
[xfstests-dev.git] / tests / xfs / 069
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Google Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 069
6 #
7 # Determine whether the extent size hint can be set on directories
8 # with allocated extents correctly.
9 #
10 . ./common/preamble
11 _begin_fstest ioctl auto quick
12
13 # Import common functions.
14 . ./common/filter
15 . ./common/punch
16
17 # real QA test starts here
18
19 # Modify as appropriate.
20 _supported_fs xfs
21 _require_scratch
22
23 _scratch_mkfs_xfs >/dev/null 2>&1
24 _scratch_mount
25
26 small=$SCRATCH_MNT/small
27 big=$SCRATCH_MNT/big
28
29 # sanity check on a small directory
30 mkdir $small
31 # expect that an empty directory has no extents
32 $XFS_IO_PROG -c "bmap" $small | _filter_scratch
33 # and that we can set an extent size on it
34 $XFS_IO_PROG -c 'extsize 8m' $small
35 # and finally check that the extent size update has taken place
36 $XFS_IO_PROG -c "extsize" $small | _filter_scratch
37
38 # now create a 'big' (with extents) directory
39 mkdir $big
40 for idx in {0..1000}; do
41     touch $big/$idx
42 done
43 $XFS_IO_PROG -c 'bmap -vp' $big | _filter_bmap | \
44     grep -q '^0: .*data'
45 [ $? -eq 0 ] || echo "Can't force allocating extents!" 1>&2
46
47 # expect that we can set the extent size on $big as well
48 $XFS_IO_PROG -c 'extsize 8m' $big | _filter_scratch
49 # and that it took effect
50 $XFS_IO_PROG -c 'extsize' $big | _filter_scratch
51
52 # success, all done
53 status=0
54 exit