From patchwork Thu Dec 8 18:49:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 9466969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D4B29607D4 for ; Thu, 8 Dec 2016 18:49:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C83B2285E2 for ; Thu, 8 Dec 2016 18:49:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD24A285F2; Thu, 8 Dec 2016 18:49:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52F16285E7 for ; Thu, 8 Dec 2016 18:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932291AbcLHSta (ORCPT ); Thu, 8 Dec 2016 13:49:30 -0500 Received: from mx144.netapp.com ([216.240.21.25]:29725 "EHLO mx144.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932177AbcLHSt1 (ORCPT ); Thu, 8 Dec 2016 13:49:27 -0500 X-IronPort-AV: E=Sophos;i="5.33,320,1477983600"; d="scan'208";a="163321400" Received: from vmwexchts01-prd.hq.netapp.com ([10.122.105.12]) by mx144-out.netapp.com with ESMTP; 08 Dec 2016 10:47:04 -0800 Received: from VMWEXCCAS11-PRD.hq.netapp.com (10.122.105.29) by VMWEXCHTS01-PRD.hq.netapp.com (10.122.105.12) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 8 Dec 2016 10:49:27 -0800 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS11-PRD.hq.netapp.com (10.122.105.29) with Microsoft SMTP Server (TLS) id 15.0.1210.3 via Frontend Transport; Thu, 8 Dec 2016 10:49:26 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netapp.onmicrosoft.com; s=selector1-netapp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tj5Nynr1OoPP2qaPUOoAI6+do+qX6rSDwaw0lwFdOmA=; b=Jp3kgZZ8zUvzMHc+fSfZwf+ta8Ndzbllwgl0q+j0tJAh3aAB/4nOpXzXr7cK7S8GH3m73ePo2VP+FV1D2ao/fDI8nVCWNIyONQd6zz3jIkaYzq+c4f1ctxdyTJN88/PPTwCcfiwmlm39CV33Ar8c6cGvhmPsEKVtuPradyR1n3M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anna.Schumaker@netapp.com; Received: from gouda.nowheycreamery.com.nowheycreamery.com (99.9.112.69) by BLUPR0601MB1636.namprd06.prod.outlook.com (10.163.212.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.761.9; Thu, 8 Dec 2016 18:49:25 +0000 From: Anna Schumaker To: CC: , , Subject: [PATCH v4 4/5] generic/395: Add a copy test for overwriting small amounts of data Date: Thu, 8 Dec 2016 13:49:07 -0500 Message-ID: <20161208184909.23321-5-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161208184909.23321-1-Anna.Schumaker@Netapp.com> References: <20161208184909.23321-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 X-Originating-IP: [99.9.112.69] X-ClientProxiedBy: BN3PR04CA0032.namprd04.prod.outlook.com (10.166.70.170) To BLUPR0601MB1636.namprd06.prod.outlook.com (10.163.212.142) X-MS-Office365-Filtering-Correlation-Id: 39834420-f837-423b-37be-08d41f9aeef4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0601MB1636; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 3:tGAxhqMZk1dhjADUD2a/ZkysV0BtrETnW4sv3MwQm6dZXT2xNjIi1bu6LpznqVMvof6+vDegHKxVkBB7MSN6xau1AEWKuJq4UqXYpALmApxDQCNVsvMWwcPMzoy7tRmjsGfyx7rw/6fzlTE5ZVHKhl+4INsfveqxtNfA88Mg7g/BDcw7B+9lXcmlk5eZyKuYcYGAVL36DdHcub6O2l/38gamytzKdbUMe8PZASFm2cDqKZeNxtRpsr5FqDwJqRJC0O/60nRLpDQyfoyAMyY7fA==; 25:+5E7umwQ/I/phWqipyThjPtKhkfvL7yF2MZf65aFSbH55q6jKew+O38i/6nz4w0gGAbaaXlQzqQXp6hXMEUd7BBqUL/2mUSaX4aRQVrN4bKhLwl7mGmC8JBRc5aW3UkghYKAyIPX3sxUiEXNnzzOcj9NuofBj1G/6fpdOODBOdVQ/dWU4da9cIqkugFAuq8JAshStHJY6LgkRKUt/AZorD4yUlZ+tkEbZRL2RIwhuzs/g2MV5jcYtPtbBGOosLVsI+BK4RGBfr2xAa6yXWUtWPgeTmuQYcBQxDWPKkEqNxaztL9dSx7qhxak2eJtsH5ZfYOtVp3zR6nA1JNyxg2mSdvuPSj75+w4BEaV2Y0D07H78FuHG5Q7c6V3jSv5UIAuxIcdEDAoxDBaEKgZCuDlTwdHQWn9kJIfpjzFPUmaVCU+XqDw0aodHN8jNNlJu8R737Eh0A/sPfx/Kk9lsIwYww== X-LD-Processed: 4b0911a0-929b-4715-944b-c03745165b3a,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 31:boK+W2aOhO+pqnpmuMTyazkkhJcJfCiDrp0o/raNqTyDZMAFr5PIYzv5gp40HotzGuWXXuKl9k+QeML8IBUr3iPJMwLNYKbydLvH4os0f1O+UOokNCcTaTiezOZUkAxb7wIFQW724eufP+8w6IFvR1ugYJgkWk6tXX+x/dO0psKpVVVpBFnWFbKq0NmuCKd7Isgm5LmulAGHB23h0/Xpx9tCq/9uYSkYSLwIS40sZWQgyiKb94PjFXLV+BzPBPQY; 20:zzhSXuioQZ5L3b6KR7dx6yJ1xjIMjyQAIVc4kcINAmECYt/0XHwZGbNkn3u2NxLzhvgx0cuVzJPWTL3faWIaizM60LLDoYMGM7Kpy7S3xxSntt01PAy+DdZxDZRjIIp1qjz+67or+1mENtfUUZtpOeSpZTD4umW9wIMxGV6Jr2uzpiiXKCUVNbyt8F12HKBupgMrOBQTgJDLb23T7ho42pImK9nu197bcuUvuOuL5ezzHiLx8c7JCGfHfqubSC7w3JG18lwHD9noaVfJ+aqG2t+FKmxqsBLJXMvFpU1BVIvs+4PolYtvMHIIJX+9dMb13IYoukiUe7QDC2QYaAsy5clAJV/xViiNL8yGg3rMcZMQ6mJnl7x/ipC7Cw6YTxZzPV4/XRermgDp2DlM1P/1aJB/Oi8SyLbui/3xXEpaV2s1ojyNuYA+sqknIAPWh6wY19qO+wLEvlEzWuAzwuCnb4IMhs0EUIInpjb5+fMUr7i5YtiSWTf/YFSV79D+TkRa X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148); SRVR:BLUPR0601MB1636; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0601MB1636; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 4:GKdRFNFc8VIsA4yrF0u6LPzXBr/ACGuWayWyfeUQDGZ4XyLQjeM/YcJLjbg3JJIe4MD29VKfYcVcjaRLonPbvSGimU1Fy8y9GveQko7B/bKYDbJPCQn9wvqw+51bgPoRygE33SJARgODMT0buA/23fvzCkCb0E4iXg8NEGCFvcCxM8lsRKzM0Zg7uEhT2e9JZOCy8S8MsD1TLxfTQyLF22ayF0EhwFhFUOpjrlkFdRpvp1dnnWaC2o20ifLS0ma4OPGwpommuae3BFjoU7wOFrUo3vAgdf6GLbJJctECitSzmvvQ8qnrcuYf/ylpAJ30++OdKAXucju2MgeW6ldHuaP8hVMIuHoMBtlSY07XPQFoRXM/tJAplLStFZT95fHowV3ZYJTbQNCo5ziX8WYlV4KWxYyMUCfvPYTgwflQ4pPUQNSuWXUpg9UuZIKIJbn/c8C6t03EkJPZg6lhsih2ViIibQM5y5Fn13wfa+byiHoWm4seAxjt2Cs37/fzHOvOI6nWPfgAcO30Ek/3AFAcGowvUeEmr+ofnWi0Fi+2X3oGdMQ/1jHVNmETkXyTMvQe/2de0IcA3i2aZM6vjULi/Q== X-Forefront-PRVS: 0150F3F97D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39840400002)(39410400002)(39450400003)(39860400002)(39850400002)(189002)(199003)(189998001)(50226002)(50466002)(4326007)(1076002)(48376002)(7846002)(81166006)(81156014)(101416001)(7736002)(92566002)(305945005)(8676002)(68736007)(86362001)(110136003)(106356001)(105586002)(2906002)(47776003)(42186005)(38730400001)(5003940100001)(76176999)(36756003)(733004)(6512006)(5660300001)(6116002)(97736004)(6486002)(2351001)(6916009)(3846002)(6666003)(6506006)(2950100002)(66066001)(50986999)(41533002)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0601MB1636; H:gouda.nowheycreamery.com.nowheycreamery.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: netapp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0601MB1636; 23:7gE62RFwuYd6fvOOl9J8cWv/ZXypVteRLwhXKQ8?= =?us-ascii?Q?GCYPZWR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azehhxL4rOHpEx+QmzILCmTYQCs71jKwJQb/9daDRAmo21xYltetqsPIS3yVAgzy0VSHRLd0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 7:5eyquJXkSxvV3vsXZzBurqrmdp+/9IyApg59r0BgGBezOIg2BR8TZ1fwPFQ36vQAurPapS8Kdo21tNC9fEmTT2pz8ya0JoNP/H9O4p9E59fCNzkDcH/LCfszKRqfd5tpFg3jMLUb/FaXm1KgXYrQYuOyfk3VKoB3wlEVmmkwn5bYaJwJ/GIRT0bWYE7R95rsb0uMJ5o5y7C+ST/uTB0QCXWXzdfwp4rBPdRiMB0IsMesevft3a4rgv89oQ9EbsU2kX/pYe0QZqzQ7r1yAA6UTafqZLkuLVM/aKJ3gWfjTPlfs4EwKdIkJtPd/5VAceO28JZOt2Uc0w1Y1h3J3LBtJY22b7Q8QqbXj6XJYjl0kvaQ20YF1eDRlMjYCDMDhVBAQ/f2YYLbFQY/4vMdm8hqFg9b1fygBBBCwwsoDNlDByggsnZ+Zrxvy/DRImjCMrQr1BAL4Bo20c9M7VmW1Owmcg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2016 18:49:25.7056 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0601MB1636 X-OriginatorOrg: netapp.com Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test is similar to 345, except that it copies one byte at a time to make sure that this case works as expected. Signed-off-by: Anna Schumaker --- tests/generic/395 | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/395.out | 17 ++++++++++ tests/generic/group | 1 + 3 files changed, 105 insertions(+) create mode 100755 tests/generic/395 create mode 100644 tests/generic/395.out diff --git a/tests/generic/395 b/tests/generic/395 new file mode 100755 index 0000000..993a356 --- /dev/null +++ b/tests/generic/395 @@ -0,0 +1,87 @@ +#!/bin/bash +# FS QA Test No. 395 +# +# Tests vfs_copy_file_range(): +# - Copy a small file +# - Use copy to swap data at beginning and end +# - Use copy to swap data in the middle +# - Use copy to swap data in a small file +#----------------------------------------------------------------------- +# Copyright (c) 2016 Netapp, 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 + +_cleanup() +{ + cd / + rm -rf $tmp.* +} + +# get standard environment +. common/rc +. common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux + +_require_xfs_io_command "copy_range" +_require_test + +testdir=$TEST_DIR/test-$seq +rm -rf $testdir +mkdir $testdir +rm -f $seqres.full + +echo "Create the original file and then copy" +echo -n "abcde" > $testdir/file +$XFS_IO_PROG -f -c "copy_range $testdir/file" "$testdir/copy" +cmp $testdir/file $testdir/copy +echo "Original md5sums:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap beginning and end of original file" +$XFS_IO_PROG -f -c "copy_range -s 0 -d 4 -l 1 $testdir/file" "$testdir/copy" +$XFS_IO_PROG -f -c "copy_range -s 4 -d 0 -l 1 $testdir/file" "$testdir/copy" +echo -n "ebcda" | cmp $testdir/copy +echo "md5sums after swapping beginning and end:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Swap middle parts of original file" +$XFS_IO_PROG -f -c "copy_range -s 1 -d 3 -l 1 $testdir/file" "$testdir/copy" +$XFS_IO_PROG -f -c "copy_range -s 3 -d 1 -l 1 $testdir/file" "$testdir/copy" +echo -n "edcba" | cmp $testdir/copy +echo "md5sums after swapping middle:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Copy tail of original file onto copy" +$XFS_IO_PROG -f -c "copy_range -s 1 -d 3 -l 4 $testdir/file" "$testdir/copy" +echo -n "edcbcde" | cmp $testdir/copy +echo "md5sums after copying tail:" +md5sum $testdir/{file,copy} | _filter_test_dir + +#success, all done +status=0 +exit diff --git a/tests/generic/395.out b/tests/generic/395.out new file mode 100644 index 0000000..f120056 --- /dev/null +++ b/tests/generic/395.out @@ -0,0 +1,17 @@ +QA output created by 395 +Create the original file and then copy +Original md5sums: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-395/file +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-395/copy +Swap beginning and end of original file +md5sums after swapping beginning and end: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-395/file +32db1f6d06d15f7e38e1ab1c69da498a TEST_DIR/test-395/copy +Swap middle parts of original file +md5sums after swapping middle: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-395/file +295228f3d82d344bbcf2f0030519c2ea TEST_DIR/test-395/copy +Copy tail of original file onto copy +md5sums after copying tail: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-395/file +0c4aac952f72fa078e2f8419aca70b28 TEST_DIR/test-395/copy diff --git a/tests/generic/group b/tests/generic/group index 00f4f46..2b50ddb 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -397,3 +397,4 @@ 392 auto quick copy 393 auto quick copy 394 auto quick copy +395 auto quick copy