2 # FS QA Test No. generic/347
4 # Test very basic thin device usage, exhaustion, and growth
6 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation.
12 # This program is distributed in the hope that it would be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 seqres=$RESULT_DIR/$seq
24 echo "QA output created by $seq"
29 status=1 # failure is the default!
30 trap "_cleanup; exit \$status" 0 1 2 3 15
32 BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M
33 VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M
34 GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M
44 _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
46 _mkfs_dev $DMTHIN_VOL_DEV
52 # Overfill it by a bit
53 for I in `seq 1 500`; do
54 $XFS_IO_PROG -f -c "pwrite -W 0 1M" $SCRATCH_MNT/file$I &>/dev/null
59 _dmthin_grow $GROW_SIZE
61 # Write a little more, but don't fill
62 for I in `seq 501 510`; do
63 $XFS_IO_PROG -f -c "pwrite 0 1M" $SCRATCH_MNT/file$I &>/dev/null
67 # get standard environment, filters and checks
73 _require_scratch_nocheck
74 _require_dm_target thin-pool