From patchwork Thu Dec 8 18:49:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 9466965 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 DC0526071E for ; Thu, 8 Dec 2016 18:49:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CECE3285E2 for ; Thu, 8 Dec 2016 18:49:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3D61285EE; Thu, 8 Dec 2016 18:49:31 +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 498A8285E2 for ; Thu, 8 Dec 2016 18:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932309AbcLHSt3 (ORCPT ); Thu, 8 Dec 2016 13:49:29 -0500 Received: from mx141.netapp.com ([216.240.21.12]:34231 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbcLHSt0 (ORCPT ); Thu, 8 Dec 2016 13:49:26 -0500 X-IronPort-AV: E=Sophos;i="5.33,320,1477983600"; d="scan'208";a="168395163" Received: from hioexcmbx01-prd.hq.netapp.com ([10.122.105.34]) by mx141-out.netapp.com with ESMTP; 08 Dec 2016 10:47:26 -0800 Received: from VMWEXCCAS05-PRD.hq.netapp.com (10.122.105.21) by hioexcmbx01-prd.hq.netapp.com (10.122.105.34) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 8 Dec 2016 10:49:25 -0800 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS05-PRD.hq.netapp.com (10.122.105.21) with Microsoft SMTP Server (TLS) id 15.0.1210.3 via Frontend Transport; Thu, 8 Dec 2016 10:49:25 -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=6ykWxo6MpIIYjRcn56dpp+PXt5L9uE7VHzw5MOaE4WY=; b=pkSP3DYcmxpmYgCV8rAmDed9CUM1/bj06VGPgeZPxjj58APAMZJ8Tsp933nHWdFdBobndJ/LDTB+xZx80CBbWOeYi80pYpUv2+8DabwNM+erPgtu/WMgwuyfu/KEF1eJE6wqLR/sNDJPrXfIZTLdc0IUOZ8+Setb1clAS0YeuM0= 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:24 +0000 From: Anna Schumaker To: CC: , , Subject: [PATCH v4 3/5] generic/394: Add copy test that overwrites data Date: Thu, 8 Dec 2016 13:49:06 -0500 Message-ID: <20161208184909.23321-4-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: 17305ebe-05f7-4b95-02a3-08d41f9aee56 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0601MB1636; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 3:dNgsr5RBy6+lhgrlQrxQQrc61YK44tgT48njxs+uOIpllRsyOj9LPCu22Ct6nvQFvJbSVy3oyHF48HPNNDa3YrGmbKFHMiONL26ivcKKc1r1ak15JMXH1eNR2WkWC+HnD/24hvGu2c1akp86X2B22nyUVLA1wmO/478KoVtQAjt+Qh/IMM8WvvoP5KaXbK5HI1xp0iH8euyep3EbvClPV0Gft/k5bBiNOm9NCFZx3YIkvd7eXI9xy2zRCrairv92YIlJQz8nX2HHmLEevysWFw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 25:4ts8USaukqMUAc38wAsvpIo8+0YWrgTk/I8FXFKwI51dKQhkF5PAV4vxqI0knZxD/S4WtJS6BA+7E2LK9jNDmaoaoreeEFwfuse3Ny9JlDGVSetJexLiRyeuEzNnWN2b5vpfFcffWkw/wGFx8PWaCC3Y5Ga6QDier6ecrpO4vOcF703m1bbDaDfZGjpGwAgZlbDwusyjIq7mfawpqlrjRPE06fouw8br1ucn8p5nQC71fd+eYmGucpJNN7oZinDk2TNN4iZvBZ1zbAj2cvd/nHTlAIEHnPnTxr133OzdbFouGejnZe4Kg4Ki3lB1k7s6cy221unj46x9ShQWkBSpwyvDB7i3gocfQgKeFa0xjAERVGVDD5XebCnwTuy346y1kViZ1qyXZyqgCdb63DEFNvSjZf0UwSO1+cndy2IEyw+Pkq44TqBLDO3I97kYZwcLn2yrMUgaZGl4JYwSdPfJnhce5nmtUKcPFYx0dJ5FMU6pDfhzZXGTFcZcTz4Qrv8vvtK58E7bBcAlQnpViG2o5+Nanut55ZANThBXCPQdpyHhjRAIvfSSu9jsUw28/TOGkSpyR9YxLHrK6LmWdczgMLeo3ztMKrIG32+I+7wHCRsbSL2FwtQfg5YYeu0inmG0AEPPfrECGrHZgKC3TDkvvwFLFPXHgqV7eZlwCxj2zdrpLZy0EEiNKZtYWl0CfMVwtcMREHrMwkU8kLvMzS2kZVr8SLKg6SNl2wr3BwMXi2AXMJ36PqJ7mpyasO93F3E7UUHvLptimg+rBk75CbZhPJcixYizqJl/kT9EwrS71UwnxjfD/O0xfDDm6GTSa2QYUUT4p8pizoLOQvGEnJhdRg== X-LD-Processed: 4b0911a0-929b-4715-944b-c03745165b3a,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 31:+PpEaNpObTsEjOox9Es/GfpEnd3G+WWGybtG58kRZIhjymi584m3YiOdhtMlo0/H8FizOLKkQSx9bcqLUdGAAFs+LZOU5puPEK+aEGB51JKRwZ9DQ0ydvVTpKXhCBRltSsMW9maGBavzk5zmQQpDFxRiXwwJcrP6qVBV5e3NlX/Rg+EBn0lLmhdp0r63NfrxVR8OmwYncU5yiVsBsSi5XY5zkgXWJuJamPJLxSetRCXe5ig7ot6vP8xsIumasYCk; 20:zNIZHyl7yDwZaJdwu6eA8Pr/JhQWTfg+emIrrUkt0M99mKWKJscm5QfWZ+wbz0+NwaMRvP1BBYc7+iCbeCnw3i8r4rYzcFT39lHNyEjn7eAMDTjAZEsBHMGwUhgG3za2Xlh7V2bgGV94+WYERzxe0pAj+4blci/M0cMF3werSPCc4rwyro9A70ktwSBvVUj0tW1dg5YwsCVZ4ZMnEWjgRRCFDVhxgTfcsaozgYJZII/aTY7vfjT1coR3E99diKdwDb5ng9uIv/EedaF/+/cNqG3oW3hLqpS7d1VoAQWzhONa7Jcoq8tU2GukMymIxNtgy9yfHTkJbB7Ye3iJ9JONkh9M/3WLWQSPgeDQig3S8Qr6A3Tf6T0nQ1x1wfF/mKm+RAsOQ/ZN6uUUAmgTIJtibBvC+1Sfb4YqTExZL0z0tbXjiyEdrtm/kM2IC2jjUwV2qtezz6RvtQKaKnVCNJYynLzIxIxWn8TK7Ru6sKgG7ARaxve4AIstk5p6U11EEJh5 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:7vRX/fiIwfYKGIVoaPwXJ7aE4l0Ug/Q1/gayDtdqOP/U4MC8JNc0Q3Pnwfmo/b08fvVvHNegiJJSJ9/lpCd2fAsKJjsH9lf68CpGRHEoBk04lptukmcYZgE9oaENFjiymV3vWYyf10AXhMwNjqtqEIaBiSI9NstUOJ9iQtx0qJdHFu3Jwoaa1LDEGKGRszn6twZzrgKcPt49LkfJNgujdhnmXl+oEoyXsWU22eM0SA1NQ+4vTQzosmy4ZwFYQuObLaW9hBAXN/ksCqZA02OaZWGoXeapmr1nWQBmkRNyC4h25cxVF3GAnnT9gy/osithD++ub10RHRG+ppPcT4i7OJNe4z9tG46fxhVpBkbbE4QcuZzPmVzoMUAYW8D7t0vdzvhesa5xeYJbpmRykcxm0/ZBg90csUIUtBkphG+LWO5H1PxzP6TFYsGgSh8EI3QHbk7nmJUxqEXsLgWmuE+N/k5XPq+u8FhC9EB2JoyIJMi913pp4KDBhJp8rEO2xUvCDr9d2skESG36+vulyCGLV7jA6JQigNb9ut6L4+SVmYU5JxP1uJS1jodn9l9MTGjU1uaXV1NzyDFBw3pf0Kbok2C03XlwiIATGLBhIEJWK8g= 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:jYTj3EtWiHC6Dtjd1wuZ0mOHj2O+x78ODe6jmQR?= =?us-ascii?Q?urhF8m4OkywKO6BzDMCuBKGvKqZ4nLadAvG7DUqHEOGR5ej4Psk1Wd+SPtBy?= =?us-ascii?Q?UBL182/+c4h4pRyJ9k3xOA5cFzPlIyQaKTz0eiLHBqvI4cNqg70KJ6CHSFlu?= =?us-ascii?Q?sDuz6QgSNXfT0xfpEpRZxbj7mAlyBjsQfpmVF35O/qZZy+7rOCBeV1Clu23b?= =?us-ascii?Q?eVG1+Vm1NjRw5P/eu3zO/G37YSCJd8WTt6TmAuh6wE30DuoYm00VK3fmPjM0?= =?us-ascii?Q?swEw6c0xIN7P1X7AmyAI8auwPWJxmymsevcdO60TgbKN3/Y7bVfhvj7D/+u+?= =?us-ascii?Q?Sp1HWUT9NGEysjySG8Wy1UUJAXUYIxYJpJeEedOQICTVuJcUzsohrIn0/8Qc?= =?us-ascii?Q?OkwFa8RCsLLvdkk2RRILQEKi0j2jC3MYw6dnEXrFFq68Xj/7UloFmZJAZMhJ?= =?us-ascii?Q?RL8jefBNql5Ig/sxn/lLJDhpWeuF5GaOIHIOFgvfnTWR60zHlmPlwVa+t78n?= =?us-ascii?Q?KOyXcKsbJ1fH7sUoVRVt8nZpIqxpYd7DhcjAehJbymXIgR+d1wxGmNDVjPuw?= =?us-ascii?Q?NkAp5EhBUBadJmppahB+4y0Zq+fUl7Oza7gmFFmm8sawDWIUhcb49biuxYXu?= =?us-ascii?Q?Ekf3wDMHdjFnnpHHc0Y+IIDufWX4TBLJWE10ZLlsovwAG49wWfrkN0K6fDhH?= =?us-ascii?Q?FabtcquFpoDf+ofsQjseU9cnbb4VYWHbc/gTpp5t5JON7c1glMUf7vlMZuH3?= =?us-ascii?Q?T4CBQpNf479DF8UjWEPnrwCrbwqI7gl4j0DpRDrER54KRfc8IVBUsW+VncNL?= =?us-ascii?Q?U3qtoUsThOF/73R5kioNZhwqEq+StAUrmReLDR9msy7WJ7aTAHFvpkVOdtak?= =?us-ascii?Q?xBL0DFSTbVMvQp9EdsLWFTmaOrNChh4Db4GYAbxGoKB5QgLbY+DYQ2z6/syl?= =?us-ascii?Q?6MCVr/74IOdKLbmJEyuI6rLYA6OAfR9OlfkSRAJC5zDcY1c4NATaDZHCrD92?= =?us-ascii?Q?91OKzyiZuppduin6diV4hSxsqUg4L7+jOC3EwseiWpjAlhNPTsP757qRHjo1?= =?us-ascii?Q?c1jArU/IZaV6IQO3Dnnlfxk5Ma7lT25fbvdXuRgA3BiQzE4td1xB5IO3Uec9?= =?us-ascii?Q?iCctS7m9Vdx5+yfw47Q/tKOQiY0AxvN0i8ly+34uaRAStKnB7x43OE7zYvqA?= =?us-ascii?Q?EjTKQfHteuyDbs+DnAox0I72PpeHZoFZQQboufb7gNHDk/1ZYEWfrJ+8m3PZ?= =?us-ascii?Q?Y4S4MH3YYtw1Bg8NPOSs=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 6:syvk0OVnCF9Tfswukr4fmXslXMhrWUSck8KPZiaKFk+se9ikpp1xGaJqY3VJHqco76NHqXK/RDGS6KjZO4A03fIkgOcY5cVX3/0+BnGWMhCiQpTJcvB2Wl8ogFNtiHeqA51FgdnduVpQuUWHRCaKkQs14kIm5Hz0dEfVHkeILUjGX8N7w8OSn63w6KTIYh3pxP6J3MhylSAxLfcG/0xJi+xxpPqAq98tNROeFtZxBYvxqQfAwXec2DjB7XYdTtBdQhktmmI93raOWkEFDjyNkdncaIGH5LoLBjP2W5ss5alAudx4ArnOp2EHi6kZPQPHOI5jx+71sWA3nIXe7dORKBb999pc7mycB/ZDrtabb8Y76FPWQ1DmfVv++164Ks+8k+PpYnSwWsq/eSztp0KA8d/PAZlBmfrgFY+Q7hNGloQ=; 5:OCJzVBWr9ASQkLvaGx5VpQT/FP24Fg7QjdB4UK24gYE2pwGNjXFwXtsC9TMIETBHX//0xQboIgrdtEC6hRa6kjYohBXwGkR5aX4PCvhblSjoXGWyXQsh73ilQ0lxkMsAjYYK9zEaiWIc72nmnjif+ye9zA2D9icTLBwzUbXicEM=; 24:tXqp3PkRjKLO0RKmJcYxw9cx9tG0K3EhN5f4zzo0awG7WGoVRqCFpNPziZoUhsmf9jnoiCyhfwEFXINr1z3pL8r+f0eZLbGDUkhL9K27JIw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0601MB1636; 7:xI2+BshWWNHmvDFct2XaxzQNhESdMQATmUNyi4P+KRi76fRbhPAx0ZM1r4pvIBnjSIxC9fQJ855yDEplajqeYEv1htePlCRZE1TqAxv+f8N1G2GBjPyNAiFxArPejdJ5aTB/1rbr6mAxYltRV1rADGhl8Ne4ni9ULe8T0MvtrUSMK5q3ebVMMftDO99YNouOi972zbk84A8mOZcg2nlgURELZGNqAfFifbfqU1s1y/vYVdBTojXyIZmK5oQGTuGClr7iSkspZ6uE7hKcOKB/Hx8oHEz0Xg0Pe9qsa3W9sSzy0FplpKtQL0HGQpqvJbSjr9i3goBAVJeKht1pX7FnYBdp0o4s7kYBKRMGWWMnWCtgifcZrgfRrGvB97xBPcDRBzqw6wGtQbISCQySpMe5LLYcmPobtpdWlYmYNXEC8XyHYdVSEu94dCMHYvcjoo85c/XjU5rvsy1Y/shDmhLkNQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2016 18:49:24.6758 (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 Using copy to overwrite data in the destination file is perfectly valid, so let's make sure this case works as expected. Signed-off-by: Anna Schumaker --- tests/generic/394 | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/394.out | 17 +++++++++ tests/generic/group | 1 + 3 files changed, 118 insertions(+) create mode 100755 tests/generic/394 create mode 100644 tests/generic/394.out diff --git a/tests/generic/394 b/tests/generic/394 new file mode 100755 index 0000000..8095644 --- /dev/null +++ b/tests/generic/394 @@ -0,0 +1,100 @@ +#!/bin/bash +# FS QA Test No. 394 +# +# Tests vfs_copy_file_range(): +# - Copy a file +# - Use copy to swap data at beginning and end +# - Use copy to swap data in the middle +# - Use copy to simultaneously overwrite and append to destination 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" +$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x62 1000 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x63 2000 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x64 3000 1000' $testdir/file >> $seqres.full 2>&1 +$XFS_IO_PROG -f -c 'pwrite -S 0x65 4000 1000' $testdir/file >> $seqres.full 2>&1 +$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 4000 -l 1000 $testdir/file" "$testdir/copy" +$XFS_IO_PROG -f -c "copy_range -d 4000 -l 1000 $testdir/file" "$testdir/copy" +cmp -n 1000 $testdir/file $testdir/copy 4000 +cmp -n 3000 $testdir/file $testdir/copy 1000 1000 +cmp -n 1000 $testdir/file $testdir/copy 0 4000 +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 1000 -d 3000 -l 1000 $testdir/file" "$testdir/copy" +$XFS_IO_PROG -f -c "copy_range -s 3000 -d 1000 -l 1000 $testdir/file" "$testdir/copy" +cmp -n 1000 $testdir/file $testdir/copy 4000 +cmp -n 1000 $testdir/file $testdir/copy 3000 1000 +cmp -n 1000 $testdir/file $testdir/copy 2000 2000 +cmp -n 1000 $testdir/file $testdir/copy 1000 3000 +cmp -n 1000 $testdir/file $testdir/copy 0 4000 +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 1000 -d 3000 -l 4000 $testdir/file" "$testdir/copy" +cmp -n 1000 $testdir/file $testdir/copy 4000 +cmp -n 1000 $testdir/file $testdir/copy 3000 1000 +cmp -n 1000 $testdir/file $testdir/copy 2000 2000 +cmp -n 4000 $testdir/file $testdir/copy 1000 3000 +echo "md5sums after copying tail:" +md5sum $testdir/{file,copy} | _filter_test_dir + +#success, all done +status=0 +exit diff --git a/tests/generic/394.out b/tests/generic/394.out new file mode 100644 index 0000000..4121d24 --- /dev/null +++ b/tests/generic/394.out @@ -0,0 +1,17 @@ +QA output created by 394 +Create the original file and then copy +Original md5sums: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-394/file +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-394/copy +Swap beginning and end of original file +md5sums after swapping beginning and end: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-394/file +5f4e111811dd9a810143c9db9bec6d80 TEST_DIR/test-394/copy +Swap middle parts of original file +md5sums after swapping middle: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-394/file +8c81889a5a50b311197110bcf769a695 TEST_DIR/test-394/copy +Copy tail of original file onto copy +md5sums after copying tail: +e11fbace556cba26bf0076e74cab90a3 TEST_DIR/test-394/file +e5fbacd993eaa5e80ebc2b14b969887d TEST_DIR/test-394/copy diff --git a/tests/generic/group b/tests/generic/group index 7b40a3d..00f4f46 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -396,3 +396,4 @@ 391 auto quick rw 392 auto quick copy 393 auto quick copy +394 auto quick copy