From patchwork Fri Mar 17 19:52:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 9631523 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 3CCF660249 for ; Fri, 17 Mar 2017 20:04:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ECFB28593 for ; Fri, 17 Mar 2017 20:04:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 239E9285A1; Fri, 17 Mar 2017 20:04:44 +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 A71B8285B7 for ; Fri, 17 Mar 2017 20:04:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751174AbdCQUEm (ORCPT ); Fri, 17 Mar 2017 16:04:42 -0400 Received: from mx144.netapp.com ([216.240.21.25]:38477 "EHLO mx144.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbdCQUE2 (ORCPT ); Fri, 17 Mar 2017 16:04:28 -0400 X-IronPort-AV: E=Sophos;i="5.36,178,1486454400"; d="scan'208";a="182789191" Received: from vmwexchts02-prd.hq.netapp.com ([10.122.105.23]) by mx144-out.netapp.com with ESMTP; 17 Mar 2017 12:41:21 -0700 Received: from VMWEXCCAS03-PRD.hq.netapp.com (10.122.105.19) by VMWEXCHTS02-PRD.hq.netapp.com (10.122.105.23) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 17 Mar 2017 12:52:44 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS03-PRD.hq.netapp.com (10.122.105.19) with Microsoft SMTP Server (TLS) id 15.0.1210.3 via Frontend Transport; Fri, 17 Mar 2017 12:52:44 -0700 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=NN2j6/MHTUgiqwG7/i9/KTbO+LnwDcLqaiFQWEuWcqE=; b=CurA3CEXljceDOoH1JckoSRr8upAywWdf+b2Vn4QCrUF5nARtaLpe9U2ARteQyYr5WoRMJxYa0loX1h200raJ1bekSINV7CEXWxAvQTI8Yt8bjVGuAcRbB3VBH+ndFsdtrakYceIvME6Y8Si9O+7TtOJyGlNyL7bXYJ2vPBjcrY= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=Netapp.com; Received: from gouda.nowheycreamery.com.nowheycreamery.com (68.40.188.1) by MWHPR06MB2479.namprd06.prod.outlook.com (10.168.248.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Fri, 17 Mar 2017 19:52:44 +0000 From: Anna Schumaker To: CC: , , Subject: [PATCH v5 4/5] generic/419: Add a copy test for overwriting small amounts of data Date: Fri, 17 Mar 2017 15:52:32 -0400 Message-ID: <20170317195233.4042-5-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170317195233.4042-1-Anna.Schumaker@Netapp.com> References: <20170317195233.4042-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 X-Originating-IP: [68.40.188.1] X-ClientProxiedBy: MWHPR08CA0031.namprd08.prod.outlook.com (10.174.103.172) To MWHPR06MB2479.namprd06.prod.outlook.com (10.168.248.15) X-MS-Office365-Filtering-Correlation-Id: 84f22f79-2da2-403a-f8df-08d46d6f2e22 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR06MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 3:58D7T73cFOgZ0foQWG3WI8DGbwedAZQ1Pj2RpbnLjewQFrJw9EDNrxeK/06ZnUThrdaN4y96QZMYjWsTvhv8HViDRpLT4cpm8FHD+LYEOWz2qckXTPxD8P9QM23YpDbN4lSql5Q0m0btgow+Cyic/M/Vdjgz2HmtYzig/+b2qt0a8bK5OaOfX+LZUNC51nxDbTFkKjc3KxSkdmOu0tkLJ6fg1dtMh+SIonIsxbarNMT+38sc1rH0NwEqhryhkvsYX4erOVyXnt0j70nnpYWugw==; 25:Up23A3ZFZnARtT5hljG/haow27MtsLGZj0ZV4bYZxDDzbiF57VZQ/xXRxNPc+svsvhl91aTGNAVUXN3Y3RwsvlLRV5QIwPCWCbmDAuCol9MyzYB8hIh8Waju7G/uyBWUi/Ltcw1rRpYWEcd2b+pGCXa/tjx+jxWBFQTfkEVoYfdwBqNRtUvVM4lC5scKFSn5K1OZPio+92NZK3SAWOlsp9hi9BWx3SCUJedoqAmdWaQ4VHQm0cOGYdN9hejooR27KgFy0D8LRAZQGOBHRaaOwQVrBpGZxwCORtaRe8iRF++35m75zIRim0N3cyeRu1FE2/kDupyeX61Kjj1uyWOj4i3WJl3Q2+SuOIVTHAsH+LQ/ttNyxEbdwB7lDjR7C2JbAc8PcvRj1tf39o39g9Nj74l5Kb38Ta6ZvpBPQ5QLnxAXo5NMmsY4N4DUIT6oExx64brNTKjnFNqkhAGw9NU2yg== X-LD-Processed: 4b0911a0-929b-4715-944b-c03745165b3a,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 31:MKaGzgBZNB/h6+qY/5oU6HN7bNcJJ5NXeerhNUL1cVtptXoiYUqi7rK82H5aIOMfRGpWN/QwFJk0gROQPHfyznzwcfMiQ8wYUM3/cNtiD/eY9InCRwQGXpsxAHMr/7cba5le7BSJyp1TacBP1Fcf+1YHihe6PpPYkMGmPNNayuZXLbK51F+LAIg+eurVXYQh3/ah24ozPO/0QcnQQb57zbLapDC3BNNF7Tocc2WISr/+rc6jxwf33fJNsSOoIqdc; 20:a0N4QrOi/rHJ+EEo1IMtFC3c712QvpFGT4RCJLLnAXbeCEK/PbycsSycC+twxLqt5szDeXlJA+YG0y9pWl+x5PkKZxodsRPnQa1iOCwIVtl6EtfWagsT3dS57meNwUywu6/k5eEj1ll019C0qlJ6zvDwoqfFbcLyIP3mBsT7HS59u5LVl91qoVCixS61ruyO9BGCEt78q9eCI1v3wa076e8+N7MSz7MaFOsWABZRb7Z5Qzi33FfyXleCDdJtexYFzg26uWdsjhz9f1UPK4qz+mVwWd80PL33mUon9eC8XrQollhHSKGOcSoQSnIdm87LxlVSFc8hYOfF1MHMQE5kGP39EBvv7kblvKDFBEe7aj85K+2byEuoXaiB+uMhnSmNrlEgYkRrU8UFifLIm8Fvh40fEFQP73zmYZrrikapvyLV2PNrUkjBkgB46xVyOD/Da2bPW49o+WCWRk3k3X/iTcBqkC+2QktlOuWluSbG1KnCOzbuKuVA5f86Svbjksrh 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)(20161123562025)(20161123558025)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:MWHPR06MB2479; BCL:0; PCL:0; RULEID:; SRVR:MWHPR06MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 4:jYT1Tl92sNlovHLLAF/MwhRkBoYZxcNWE8u2BZT1xoLRuwsT/ubkwF7W3vzc1EnWCfpXwYE+mF6JTVRk4RbP/tNy1mgF7I1KZVwu8pIbRtatq55g3te2U0RQEVt+r7HoEwe8MuTdpKiagtHlyTQy62vQS9eVUoeYaMgrFWELQTYjR1kbI6ikyut91gTwERjnNWidKPpqjQ1Ewd268ljgtPAF3eM1S43JyZVRY6XQ0WJ/8FY4T5Vwp7ZZrY18S6Qu3oSVD1HRq5fFclIrxTAgTtB7TkW0cvO2g5Kq0E08UQZz+GNH8TxVS/DuDoBcfTHlpVemBy2eXIuJgLfhxihv4n5a8B9Xp8JoaAVpfRyrwaMGmOe/kAkqCEvC2uzoWv2fttykHp68qj8i+HHgk8YWMi8/jFcN80sfIbDTvWnNKn2z3ZlQI0UiFkB8Ql9r7XfDMpsbJd5jx/KydFW0NLIDT09GoqnRI3BkkXDyUH1wJref+BxWWKC3667Vrdb3DOQbuGDGCjq9Mm0WZAgKR+sYE4li2uRuD2DOAhRA9cbM15xEbvNtySAh1vm2kRn1xKCzULS/uOHTO9XJCnXIdL0IWmrhcf2xd0O+r9VP9gsSJv7URna+cffzLkwPSDld1LPD X-Forefront-PRVS: 0249EFCB0B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(4326008)(50986999)(81166006)(86362001)(2906002)(76176999)(1076002)(6116002)(48376002)(189998001)(2351001)(8676002)(50466002)(38730400002)(110136004)(305945005)(6666003)(6486002)(42186005)(36756003)(6512007)(47776003)(6916009)(2950100002)(54906002)(6506006)(66066001)(25786008)(5660300001)(7736002)(50226002)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR06MB2479; H:gouda.nowheycreamery.com.nowheycreamery.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 23:ZI76nC/5s2lQqtWCh5qPMKYJtibU0oD9xnksb6I00IzxpVKHlOMAAq6keCIFrlok/XE89WDGNsBaFqgTPkiTrBKeKzLJaXpqvNuBcisX7NrZ6KHr36a+pe5Y7BYHKGE6dleWlha5qoyNRRGx2cRu9yHaFd4Z/RTiWiox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JfbGZxcGFD5lDhMyg6ctOdHkD02PaveH7zYfvXIy5qdfLp01i4YrJgdYT0INXJh5Vn7FOTzdxmVc1X+YpZm/pADyt8z1XSE+aezxrAjptcA==; 5:X8+Lo51pOeeYYmlTw/bTjVgMacduplo2p/E4lWkBuggO9HjI6ZcnQk6/SsXZxZx5XpYxFzQEby2ai7AYaEI2AsAbG0IAUYb9FtSOFi4Fc0oUWUJLdu9o3BsZ6o0AdmVOtCfp+pIy+N83sW2+GbaN9w==; 24:QpZk1LXrMFMbITPdWKFHsjJDHMzOIYIKEb4d2jRm7IzrB5IRmk8caOXq+nWEXN3gfpldk1L2iTtZBaokrTUFP19Dgalub3TuapbNqdUugcU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 7:CdlK52DcI3mVu7AtNM+ykFTrjTYXgT/jIjZNtNdcSLUl4Wj+ZhS8KsmFMESL9dBYsHvBOvukQ6y0LHTTPd4gDp37PAPHrLB/AvMfQE5bnGP/daTs/nTWbjZtzf3c046wRssRQuY5JCONkar7Wkffk4PKzcQSYCKmzwdG6T7jOFeftubKUFKn5Lb0gI9ymd3NRdYv9wsVYpCjXEgmKFijMt1Hvjv4VRQWCKKeIWY+OoM2enWL49FulBhWFFsenueGtQQ/ROB+rD7csODnfRyjx9ROMvQhguGL40nbIOWyZPiqR54KlPZazwxalmYeq2KUUPlmqXAB5Sw0wSvxEE55wA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2017 19:52:44.4500 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR06MB2479 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/419 | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/419.out | 17 ++++++++++ tests/generic/group | 1 + 3 files changed, 105 insertions(+) create mode 100755 tests/generic/419 create mode 100644 tests/generic/419.out diff --git a/tests/generic/419 b/tests/generic/419 new file mode 100755 index 00000000..967412a2 --- /dev/null +++ b/tests/generic/419 @@ -0,0 +1,87 @@ +#!/bin/bash +# FS QA Test No. 419 +# +# 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" 2>&1 +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" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 4 -d 0 -l 1 $testdir/file" "$testdir/copy" 2>&1 +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" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 3 -d 1 -l 1 $testdir/file" "$testdir/copy" 2>&1 +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" 2>&1 +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/419.out b/tests/generic/419.out new file mode 100644 index 00000000..a5ab24db --- /dev/null +++ b/tests/generic/419.out @@ -0,0 +1,17 @@ +QA output created by 419 +Create the original file and then copy +Original md5sums: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/copy +Swap beginning and end of original file +md5sums after swapping beginning and end: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +32db1f6d06d15f7e38e1ab1c69da498a TEST_DIR/test-419/copy +Swap middle parts of original file +md5sums after swapping middle: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +295228f3d82d344bbcf2f0030519c2ea TEST_DIR/test-419/copy +Copy tail of original file onto copy +md5sums after copying tail: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-419/file +0c4aac952f72fa078e2f8419aca70b28 TEST_DIR/test-419/copy diff --git a/tests/generic/group b/tests/generic/group index f55b2b49..6a2d3ee8 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -421,3 +421,4 @@ 416 auto quick copy 417 auto quick copy 418 auto quick copy +419 auto quick copy