From patchwork Wed Oct 21 20:56:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 7460511 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 583D7BEEA4 for ; Wed, 21 Oct 2015 20:56:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53C9520591 for ; Wed, 21 Oct 2015 20:56:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60D3220462 for ; Wed, 21 Oct 2015 20:56:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756397AbbJUU4K (ORCPT ); Wed, 21 Oct 2015 16:56:10 -0400 Received: from sandeen.net ([63.231.237.45]:38945 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756389AbbJUU4K (ORCPT ); Wed, 21 Oct 2015 16:56:10 -0400 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 5DED96000438; Wed, 21 Oct 2015 15:56:09 -0500 (CDT) Subject: [PATCH 2/2] dm-thinp demo test To: Eric Sandeen , fstests References: <5627FA00.70003@redhat.com> Cc: Mike Snitzer From: Eric Sandeen Message-ID: <5627FBE8.3030408@sandeen.net> Date: Wed, 21 Oct 2015 15:56:08 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5627FA00.70003@redhat.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eryu Guan --- -- 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 diff --git a/tests/generic/115 b/tests/generic/115 new file mode 100755 index 0000000..ef9d881 --- /dev/null +++ b/tests/generic/115 @@ -0,0 +1,85 @@ +#! /bin/bash +# FS QA Test No. generic/115 +# +# 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 +_need_to_be_root +_require_dm_target thin + +_setup_thin +_dmthin_set_queue +_workout +_dmthin_check_fs +_dmthin_cleanup + +echo "=== completed" + +status=0 +exit diff --git a/tests/generic/115.out b/tests/generic/115.out new file mode 100644 index 0000000..39ebd87 --- /dev/null +++ b/tests/generic/115.out @@ -0,0 +1,2 @@ +QA output created by 115 +=== completed diff --git a/tests/generic/group b/tests/generic/group index 1dd4269..729578d 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -115,6 +115,7 @@ 112 rw aio auto quick 113 rw aio auto quick 114 rw aio auto quick +115 rw thin auto quick 117 attr auto quick 120 other auto quick 123 perms auto quick