Message ID | 5717DB06.2060004@sandeen.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Apr 20, 2016 at 03:39:50PM -0400, Eric Sandeen wrote: > Fairly trivial test to use the dm-thin infrastructure. > > Right now it exhausts space in queue-on-error mode, > adds more space, does a bit more IO, then unmounts & > checks the fs. > > Not sure if that's valid to test, but it works here and > demonstrates the common/dmthin helpers. > > Signed-off-by: Eric Sandeen <sandeen@redhat.com> Tested with ext2, ext4, v5 xfs, v4 xfs and btrfs, all look good. Reviewed-by: Eryu Guan <eguan@redhat.com> Xiong Zhou helped resend v2 of this patch back in Feb., but seems that patch got lost. Thanks Eric for resending! Eryu -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 20, 2016 at 03:39:50PM -0400, Eric Sandeen wrote: > Fairly trivial test to use the dm-thin infrastructure. > > Right now it exhausts space in queue-on-error mode, > adds more space, does a bit more IO, then unmounts & > checks the fs. > > Not sure if that's valid to test, but it works here and > demonstrates the common/dmthin helpers. > > Signed-off-by: Eric Sandeen <sandeen@redhat.com> Had a wacky one-off failure on only one of my test machines: generic/347 [failed, exit status 1] - output mismatch (see /home/dave/src/xfstests-dev/results//generic/347.out.bad) --- tests/generic/347.out 2016-05-09 10:55:14.425279726 +1000 +++ /home/dave/src/xfstests-dev/results//generic/347.out.bad 2016-05-09 12:57:46.040915465 +1000 @@ -1,2 +1,4 @@ QA output created by 347 -=== completed +device-mapper: reload ioctl on thin-pool failed: Invalid or incomplete multibyte or wide character +Command failed +failed to create dm thin pool device ... (Run 'diff -u tests/generic/347.out /home/dave/src/xfstests-dev/results//generic/347.out.bad' to see the entire diff) It's worked on all the other test machines running the same kernel and userspace, so I'll commit it as it stands. If it continues to be a problem, I'll bug you for a fix... -Dave.
diff --git a/tests/generic/343 b/tests/generic/343 new file mode 100755 index 0000000..3bc81d0 --- /dev/null +++ b/tests/generic/343 @@ -0,0 +1,83 @@ +#! /bin/bash +# FS QA Test No. generic/343 +# +# Test very basic thin device usage, exhaustion, and growth +# +# Copyright (c) 2015 Red Hat, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ + +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M +VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M +GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M + +_cleanup() +{ + _dmthin_cleanup + rm -f $tmp.* +} + +_setup_thin() +{ + _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE + _dmthin_set_queue + _mkfs_dev $DMTHIN_VOL_DEV + _dmthin_mount +} + +_workout() +{ + # Overfill it by a bit + for I in `seq 1 500`; do + $XFS_IO_PROG -f -c "pwrite -W 0 1M" $SCRATCH_MNT/file$I &>/dev/null + done + + sync + + _dmthin_grow $GROW_SIZE + + # Write a little more, but don't fill + for I in `seq 501 510`; do + $XFS_IO_PROG -f -c "pwrite 0 1M" $SCRATCH_MNT/file$I &>/dev/null + done +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/dmthin + +_supported_fs generic +_supported_os Linux +_require_dm_target thin-pool + +_setup_thin +_workout +_dmthin_check_fs +_dmthin_cleanup + +echo "=== completed" + +status=0 +exit diff --git a/tests/generic/343.out b/tests/generic/343.out new file mode 100644 index 0000000..c64aec1 --- /dev/null +++ b/tests/generic/343.out @@ -0,0 +1,2 @@ +QA output created by 343 +=== completed diff --git a/tests/generic/group b/tests/generic/group index ef1a423..a371071 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -345,3 +345,4 @@ 340 auto 341 auto quick metadata 342 auto quick metadata +343 auto quick rw thin
Fairly trivial test to use the dm-thin infrastructure. Right now it exhausts space in queue-on-error mode, adds more space, does a bit more IO, then unmounts & checks the fs. Not sure if that's valid to test, but it works here and demonstrates the common/dmthin helpers. Signed-off-by: Eric Sandeen <sandeen@redhat.com> --- -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html