From patchwork Fri Mar 17 19:52:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 9631511 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 3EE03602D7 for ; Fri, 17 Mar 2017 19:55:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FFDB28593 for ; Fri, 17 Mar 2017 19:55:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24847285EB; Fri, 17 Mar 2017 19:55: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=ham 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 15F1C28593 for ; Fri, 17 Mar 2017 19:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751263AbdCQTzc (ORCPT ); Fri, 17 Mar 2017 15:55:32 -0400 Received: from mx144.netapp.com ([216.240.21.25]:36095 "EHLO mx144.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdCQTz1 (ORCPT ); Fri, 17 Mar 2017 15:55:27 -0400 X-IronPort-AV: E=Sophos;i="5.36,178,1486454400"; d="scan'208";a="182789185" Received: from hioexcmbx04-prd.hq.netapp.com ([10.122.105.37]) by mx144-out.netapp.com with ESMTP; 17 Mar 2017 12:41:19 -0700 Received: from VMWEXCCAS08-PRD.hq.netapp.com (10.122.105.26) by hioexcmbx04-prd.hq.netapp.com (10.122.105.37) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 17 Mar 2017 12:52:43 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS08-PRD.hq.netapp.com (10.122.105.26) 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=/UPlvQ7tkaWj/oplBxc8Qigv5OyIyg89DSeBniMjLik=; b=Ma+YX3PTxKBdzE8HSrEFBA9vENTLqgVXzrT7olMidmM+4zvfYFpYxqcAdTHCuBj2MABDz+qEjdf0EHDEPVl8H5fYkKEXC6hn3pXbF4+n7u5PhUtwoXcEXl6v8xmnb9YrO99Xs01DXj5FM9be0xV7pcGZBIs+vaI7K3GZJx6lqfw= 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:42 +0000 From: Anna Schumaker To: CC: , , Subject: [PATCH v5 2/5] generic/417: Add small copies to new file test Date: Fri, 17 Mar 2017 15:52:30 -0400 Message-ID: <20170317195233.4042-3-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: 457a0751-843c-475e-63d5-08d46d6f2d10 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR06MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 3:+tOUJ9ENT/4D8xUAzJHJAS2SMW+GJBV/c555WiF4l0bAaJ//oJ2g8oUBiFIpo/PJpuFAKuNcRtyRPVPbNKIO1iStsqufsMXdVUMnnVmHr9DxCNd/T8Ss7HVt+HO/znVhZhjHD73BjkwujCRGWGtEXZ/KEpxxvRQaeela89vWiicheBlRiYI+ouOh3omhduCXb6aMcUEBh8Fhl2JqgoaB3NG2oPw5yFNhSImJmrSyfuOPt1lQ7+xEZlvskVvPOlQ7SCYPb1RCVKUb9f8XMfVaNg==; 25:uQl0TpArsBJX5PLaa6nS/Fe6ZHXZ1i0IJ897pmUh0ELQcLOk4zdJcdI5IrBmDomKrh0ACatHLVP79SODJU7Bfe8qeXYR8QNcUWxVG8jcDKpv4zOXqrGLsOH+visUDwuqm+jmRsb2z1woAa340nMaugYkmCjsmr6EDoDfRN8mrNTMnP89+TITVq+Xm3x7+Il7h51ONsraSMxlfhOfos7wa7xOOhZ77QVqZwAHGgHWL93Fwep8eCj+8oC7GxaaVo3oG/x7UIea+jN3oC3bxcxCA/dK4EZ02f8Pfrz5Mvno+eZR02vNqXNMMdza85/PYsXrCHPKrzNCVGUbIq9bXerXtTp8X6ORpmxgZou9/Y7W/bVFs0BXnfzYU2nOQAKGjZBY5lA670I3GpoexawLW7VB2HwncVl3ISHi9Z2irgsif2nJPV1zN38q7C59O+hJ8io55hpsUP0On1gSsCHwHIoUEA== X-LD-Processed: 4b0911a0-929b-4715-944b-c03745165b3a,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 31:Gl+Yg1uwuls9wNTvzppagZgiQlHJWNn3PQfLEYB0+xOvwrkHg0cE16U8luqzoWftyoZpT32Yrs6yQR7PvjhFKfczMJtNH1BIn4LUQX6r43H9c0IdcNymOUZzDvAyH6sn8CArIz755/BSbs5ZQ6z+8M3tJI49Vsanh9ylp3v9Fn/6dezFEm7VZ4tW9l0kss9P03qlduahQ0gp5nktmv+RWiSZ2DVkcgwQbryhy9MBzbQ=; 20:ADfZd6aGOPt/nIIMOfy8lHBh30bL3R0/jajHR6iCp7x98dWEXLxfQM5qgbCQlJKJAskMTugT+AjYvmOEA4EYUUJiZ8znQS9k/L5Pc4E6smETuIBGih4iGUSgIUzqcdErpqEu7YBHkHVY8EvXTcTQTzGB776rFK+rEK8kumgWeqYEQ5MdFTw1OW5cufcPJQIYbdNJAhqjleuE3PmUinSY77QENJakfB27mYk7OtWhQapwpcaf6SaWqFl8Iv1cljht8kSp6jdFgfVJJt0l3E5iEj9yfZ5OCLE7rmcmbUpGAcH9P1cYjz2nk3l/bNHkq8C8FYhXJd2EcgCTqrTzR99ECdBUdST4MVl2Eb5a0gLaadZ7H04/ti2WngOVlzcW5oVcWT/2D3Sxvdlj3Imv/LUm02+rEUuUUFSQnlStKRv3QCymo260hOyk2KK/JqvT6ALXHSgvntzMY3oRN2WRVheRSwB3FwNSA7Ai30xG/1KkYQ90AakplSGqVsf+N+Al43pl 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:DvVzOXl7NKfpli90X/PaVcNb+go/YU4H2z+NoTL6gUL6fKMsksy5nP7TC+K6ksYO2kHmL+J40MCcTmzeKhH1vSzg/BBntAEKKZpOLwzbwYeXn4VKU/uA3ug0N1y4CRPuWmE5pRr5Jml9sqIz8rmOQj2+gsmqFKmGlmASgLPiMp7mOHThnIU0uKzpSoL89/yOILOLDgNkA76NnQxIWR4qBUq6IwFf52y8oz9dReqjA7VlvigiyhkKdF71wZXrVK4LEZzqkH+jPFiOgASaDxjYNoG4PfZrpSqNKdhXjrjbP/0/y2l+kwfAXD6Yr60h7Mt//IFUHVN6fZe4Bzraut+YXA03gfrVel8W6jo+KiTEzW9BJu79kXIfLR/RXrcju8Jg2AerUY+MDJ69BPr1NsoIHmE1DL5E9ni1LD/mbeH6fQGCPsPKyGv+GckdgJYe1YmNIJuqZgnAEOCPpe0SOhlnLSNp4vyGYsFiwO8KSYad/yKR9Yj2h5hl7OckOkqmGl6yTzcy07ALG8JfybLIIdQar7Ah0RdLPvVsQF6pqRXfLpZFtDuO5+qHehv8UuGuRtyCyVCcLCjRA/D1aWpksuFqMjTPavZ9DZOPFhaYVJH2VjnAN+zj+XU7X7ikikUgDmPi X-Forefront-PRVS: 0249EFCB0B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(4326008)(50986999)(81166006)(86362001)(2906002)(575784001)(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:QWm1tFhcOVWIAFn/Xom4qsUt6swk+NwNFwTMGUjhvlCGnqdBEK9TfsD5sAl5hR1v1BjYzu3YuZb1etikRKVa3hnPJgfFHTo8i3GrzJZM5cdESIRy7CL0aR8+ncA0NEzibV6s9R78cxoeNcocnxhlDl6wSbSZvRsBm4+qfktbT2oIYPasKA+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aoK8b3roDrg9W9QoKBgALFWYD6irismC/ElxZABojmSnOIJ4nGIJKHKKYbbkvVA99vl1MsYtsyQiOaW6xSjS7OG3sI7M7jzamPhZJCe1GFi6e2PXExqFA==; 5:jnnjJpomz6GcXrd5nOSRjujCJQHLBRddrvhJPDKn5GBnFby0v1w3jH8SlM/CWtsoQC7s3jpzgjXkdBOj5UmC134jDV9Jx6s7BkdxeaPP3xTQdAiRvuRxWXVDCN63K1sfYMmjVFGhn2MXXxPjiRCoTQ==; 24:nmDDsi8nDaEkYmRml7uTbIAK6asAJFP301mVZTnPQcZ9N6MQcqMX/D3I6MrYy7+pZqW3CHUMqsXv+7S/Anx90KhT/BH+5aqU4WluEsG7fBY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR06MB2479; 7:iOKBnbODHKzYTlr4LafSVAqyPRIzeRE70rM+k+D9qjcXAUTV0acKIn7iaNfYhLFvX5BwYFX34mKfNmTNKM0da7yiwcqQwJwk/zNJp205aaERvfK4rnMtUKqxyZec7tY8FkJZqK+Rxvi6AO3eaRyfHADxPmHp7cdfI9WXJJKYCD73o3J06PeFsJ+auihPmTXvur9m81Zls/sqA5NSb9OIUBmU/foI1oJDIOjXCTGDW8P/Gn5g3rl7/lqT2kzRkLuUtDArXqgJaPuftljUp9KQQ1vkP4EABKdAbjKcoPEmC1hfpuNVawcHYYRByqv7WIXdsW1EDDITvArEu9ingRL5Nw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2017 19:52:42.6705 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR06MB2479 X-OriginatorOrg: netapp.com Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test copies single bytes from a source file into various new files just to make sure that we can handle very small copies. Signed-off-by: Anna Schumaker --- tests/generic/417 | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/417.out | 16 ++++++++++ tests/generic/group | 1 + 3 files changed, 100 insertions(+) create mode 100755 tests/generic/417 create mode 100644 tests/generic/417.out diff --git a/tests/generic/417 b/tests/generic/417 new file mode 100755 index 00000000..dde3f4d6 --- /dev/null +++ b/tests/generic/417 @@ -0,0 +1,83 @@ +#!/bin/bash +# FS QA Test No. 417 +# +# Tests vfs_copy_file_range(): +# - Copy a small file +# - Small copies from various points in the original 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" +echo -n "abcde" | cmp $testdir/copy +echo "Original md5sums:" +md5sum $testdir/{file,copy} | _filter_test_dir + +echo "Small copies from various points in the original file" +$XFS_IO_PROG -f -c "copy_range -s 0 -l 1 $testdir/file" "$testdir/a" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 1 -l 1 $testdir/file" "$testdir/b" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 2 -l 1 $testdir/file" "$testdir/c" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 3 -l 1 $testdir/file" "$testdir/d" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 4 -l 1 $testdir/file" "$testdir/e" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 4 -l 1 -d 1 $testdir/file" "$testdir/f" 2>&1 +$XFS_IO_PROG -f -c "copy_range -s 5 -l 1 $testdir/file" "$testdir/g" 2>&1 +echo -n "a" | cmp $testdir/a +echo -n "b" | cmp $testdir/b +echo -n "c" | cmp $testdir/c +echo -n "d" | cmp $testdir/d +echo -n "e" | cmp $testdir/e +echo -en "\0e" | cmp $testdir/f +echo -n "" | cmp $testdir/g +echo "md5sums after small copies" +md5sum $testdir/{file,a,b,c,d,e,f,g} | _filter_test_dir + +#success, all done +status=0 +exit diff --git a/tests/generic/417.out b/tests/generic/417.out new file mode 100644 index 00000000..36c98478 --- /dev/null +++ b/tests/generic/417.out @@ -0,0 +1,16 @@ +QA output created by 417 +Create the original file and then copy +Original md5sums: +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-417/file +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-417/copy +Small copies from various points in the original file +copy_range: Invalid argument +md5sums after small copies +ab56b4d92b40713acc5af89985d4b786 TEST_DIR/test-417/file +0cc175b9c0f1b6a831c399e269772661 TEST_DIR/test-417/a +92eb5ffee6ae2fec3ad71c777531578f TEST_DIR/test-417/b +4a8a08f09d37b73795649038408b5f33 TEST_DIR/test-417/c +8277e0910d750195b448797616e091ad TEST_DIR/test-417/d +e1671797c52e15f763380b45e841ec32 TEST_DIR/test-417/e +2015eb238d706eceefc784742928054f TEST_DIR/test-417/f +d41d8cd98f00b204e9800998ecf8427e TEST_DIR/test-417/g diff --git a/tests/generic/group b/tests/generic/group index 9541fff5..57ef9d22 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -419,3 +419,4 @@ 414 auto quick clone 415 auto clone 416 auto quick copy +417 auto quick copy