From patchwork Sun Nov 27 06:26:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 9448701 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 2D7DF6071C for ; Sun, 27 Nov 2016 06:27:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16B9F20855 for ; Sun, 27 Nov 2016 06:27:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B7DB22376; Sun, 27 Nov 2016 06:27:43 +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 743E820855 for ; Sun, 27 Nov 2016 06:27:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752964AbcK0G1l (ORCPT ); Sun, 27 Nov 2016 01:27:41 -0500 Received: from us-smtp-delivery-194.mimecast.com ([63.128.21.194]:34717 "EHLO us-smtp-delivery-194.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752650AbcK0G1k (ORCPT ); Sun, 27 Nov 2016 01:27:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=PrimaryData.onmicrosoft.com; s=selector1-primarydata-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LJHxSKOTnUMyyw14MJ0Xwatwa6yIaWXzXb8kk47tyx0=; b=eZGNSMXfvwRoLDWgN7x2Gq8OenEg0dlwfumShjSMIq/OvN/O7u4PsR+l13os37kmHe93ivRLN5xcIBNLkW0NuDQdiuDeXQTtV98ZHztthAtbioOll2bhUFzzKdLK3hjBH7isVJrPYi28RMQeGTYBXK51F08yYIEgl1rmjM4yEXI= Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02lp0024.outbound.protection.outlook.com [216.32.180.24]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-92-4ZWOc3QDMC-UHi5vjbSVZw-4; Sun, 27 Nov 2016 01:27:32 -0500 Received: from jhereg.localdomain (73.202.55.195) by BN6PR11MB1364.namprd11.prod.outlook.com (10.173.33.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.10; Sun, 27 Nov 2016 06:27:24 +0000 From: Tom Haynes To: "J. Bruce Fields" CC: Linux NFS Mailing list Subject: [PATCH pynfs 07/12] Simple tests of the flex file layout type Date: Sat, 26 Nov 2016 22:26:36 -0800 Message-ID: <1480228001-64821-8-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 2.3.6 In-Reply-To: <1480228001-64821-1-git-send-email-loghyr@primarydata.com> References: <1480228001-64821-1-git-send-email-loghyr@primarydata.com> MIME-Version: 1.0 X-Originating-IP: [73.202.55.195] X-ClientProxiedBy: DM2PR07CA0047.namprd07.prod.outlook.com (10.141.52.175) To BN6PR11MB1364.namprd11.prod.outlook.com (10.173.33.8) X-MS-Office365-Filtering-Correlation-Id: a9c62ca9-8bcd-433f-7bf9-08d4168e7376 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR11MB1364; X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 3:VQ1Sv9k2KXIAl9AODvk/gN6j+ZJQvia/4s+X9S6lIrms/loAnd5TS5GeJk/prmrptXpHCkyThD6M98S9BV5LIFpHe2XcGyaY2uejfG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xMAORmj9v3tV0Ndyyl8bcP9ABGQWuGgmbQzRpPfsdT3W6mwZsCm1vyV9H31AEGCMrRcYz2rqdqCwYb4oNp9CGIHEF54BDAGfDWSSb9nEK2I4Q/SW6fK8Is7J2V+7yXkc+M5D90YwMPF50upE7j86tp2EgUpuILpR53W65S6Ke8mSEaIlsEV3syjZo/yg2tRIbLWC8tem0wWeayLzNSXNw39wPvKxyf4AVfaBzXgZg==; 20:ekgy8FcGugCwo+haPcdHndd2UzPrljubNSD8AUX0DNHeQFzOHMwpX0fsiw1b6rcvKc9jw8LejxGCGtXH6xzplkBTh0eqjhpE/rgiq6uj9Felaoyna8wsAKQftu3zdYhlCp5VujFgWiQp3+4XaxJjLtout+7HMBhCQEI8ncAuHp0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(6045199)(6040361)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(6061324)(20161123560025)(2016111802025)(20161123555025)(20161123564025)(20161123562025)(6043046)(6042181); SRVR:BN6PR11MB1364; BCL:0; PCL:0; RULEID:; SRVR:BN6PR11MB1364; X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 4:4PPws4RjqSfqpN/DdUB8SqMh5yiXKxrY0g5kP8gi5uoJauORytMAsgGRuNy2wR8ERClgY7EnmFtKMKl/yEA1N9u14w7EkTZQ6uUCn5mZNMp95WpJWWpvzFsfjABr+X5aqusmGKIjEfk5w0MU0KBANK8i90thuBdkR3HxBTiSpBQd8Pkrurh+MOFLZ4Acu6IqvM4icJ8IxAy6Xis6njyEB971PRyROgPPlYoiJjcGgkYqOL7R8aDKe0q0BIQXBTkEIz/itHQQSZx2Ok9JEo2+X3nyt6Iq8e1yJ8SAXRggKeoDrTsjP4g5KN+Mz1Z0kXL/RCmLBERacV+sgXTEIOuiY/NjvdF5PKH8Ns1bDJAdq8xkz6EwoJbVIq9/d/CYpjyJYeiJGsv5THGC1XP7tCjWG03zMLuXdvp3K8LCd3MzYB9260DTuBfnFt7hKzxz+AWCTFPbNCp2gue+pHyK6BtEMgWXEAJzI4ZCLpuLCZSOR8/ynqOqTa8SBLxjFOaAP/6QfPPjgE2+96t3g/KnnWnLx1o8IdCZfVU8IHVeTJINPcnl3jcyZtP2N60eaWNmYMKoWDAOlGPMNjoFE4L2ls154SwtHJxUjjGfRv+m2S1EjPwAvpUmxa7GPT2riM9u/424lCm4oOjXTqifhuzhjqPiyxc71LMRJT3gSxfD0JUmu5Y2q72BKP+KlzLcsuJ0d/+yihPoZShbzIL6NZMt0SyWkiWf8H02zvTLA4F0hJIaxTY= X-Forefront-PRVS: 0139052FDB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(50986999)(86362001)(5003940100001)(68736007)(305945005)(7736002)(7846002)(105586002)(101416001)(97736004)(42186005)(92566002)(76176999)(36756003)(66066001)(38730400001)(47776003)(110136003)(33646002)(106356001)(733004)(2950100002)(50466002)(8676002)(6916009)(6666003)(81166006)(81156014)(4326007)(50226002)(5660300001)(48376002)(2906002)(6116002)(3846002)(6486002)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR11MB1364; H:jhereg.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR11MB1364; 23:RTDrWtvF1aEcoLCtWy1/rFLDPCa1cPB9lUKWGWn0S?= =?us-ascii?Q?dKf0MefMB7crzISY7078TviWxtO6Tg0OBWdkA2dgf3V/SqgABpBuzZ/mTFJA?= =?us-ascii?Q?sX6AxHjXZbcXxXjKsNGgLZK2UIg4C+U9fDKugGFZtfOA/xFPv0q9n8F85SiO?= =?us-ascii?Q?T2HuOMd0ZSdhS/JP5o2/sBIA2OuIdPwgRN8XWFPlBbIwtcmsx2jqi9wk2jgp?= =?us-ascii?Q?XQY+/XP419rg59Ia682OJhLGyviMg2LdPiHJLeZ72HFIqWrd4cGybJH4W36P?= =?us-ascii?Q?IJKr7+a+YM0ZAz3A8IYix/w+xAuPLcFKExjZ3G45+XBPQ/vIsfjOCpGcQVTr?= =?us-ascii?Q?DPDwxNinmxkAWLFvljz9YlldVq8ZsB/gCNnxeOjoLBbxufy4iMFhT6oav00U?= =?us-ascii?Q?YvOr9zUU52aYmZfVP9nmueCCIplNC5VRzsxWUcFWuRZjN+od2tahDUXizyWU?= =?us-ascii?Q?znaZ83aOg1WdcDeflfeHZvu/x5x9QeQuNp3GlLfA5W7pTPd1u/kAxG/LMV41?= =?us-ascii?Q?hHP26tsv7UhNZlLx2bxBIgm6wH6isZ7pHOvTiKUXpdcO5QYRGZ/y3+oowwCm?= =?us-ascii?Q?WwLg6er8+Y2mj+4yLGHBL/l9BDKAdcsMy72vlk32VxxFocVN9wmtBA5b/K8T?= =?us-ascii?Q?LG9BYfjR47+ZcefubhmvOCEXOMZVwLlFZXXOercueeEnhIxPlna3SynXZBvN?= =?us-ascii?Q?JMBJ2XtVTpDc3Fod3xJB8Lv66pb52ANzEoXZipTWO29G9vMv80t8G98m4aca?= =?us-ascii?Q?aKP/RnLZRnI3yVmyrV0zfiRGwsy5AANXY/ULw0mqDbTACufEI/y1viDrs5q6?= =?us-ascii?Q?wH2cC84gKcYfMFxjFIORMg9baxPVoRqRTAuyymejZzq03jNbU/BwoB+qSlhC?= =?us-ascii?Q?tpr8YA9/19vZ0fX9VKA4y2cAhO0ftYfSU9UoWce439eFrK+aUVELqlfASAOn?= =?us-ascii?Q?SpFTdvejEoAjd0hzscL3g00KdKxXN2WfUy2IAbLOYgh+/yTKS+iTmqdb17Mb?= =?us-ascii?Q?po7BQmDQVAvvWUq9Dnu0jDE4qOU87Er4dciP84cOHKkxA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 6:Q8evqUPKo7mca/ni18RNyBZJ7c2E9yftZ574TRMmS1nOHW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kK3r/8EcwW89jEn1MyBef6e50XpFSQBku4a1plKHpypWXoFV9SC2BxEj+CX6OT5/HBLFJYU6UXTRzMdaM0yHh1rtmIIBX+PgwZw8ypHK1myAQ5d5j1weURuK6vq+C5S2tSGGEeDbmtVETUhgyfH5P3Hca9QHlUR1Hok2b+KPfuZVb0OKBv6wvGo0Do0klQoSA==; 20:V+Uhr0FLJ134DGYNAoSeKzgia3UE+XV4rVQwuU6Q2FmNyEjKKhvEOg9UI4//0nJcOH1VVTs0zZBa3JCOH/fz9M8YjXzOIktU7ugOSa2RglwoSgMQsj025keyxrOU3Bh1sn3lcelfJ5BADkVKhG3d1dktPPN41e//XuUjIRKk53A= X-OriginatorOrg: primarydata.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2016 06:27:24.0541 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1364 X-MC-Unique: 4ZWOc3QDMC-UHi5vjbSVZw-4 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 Signed-off-by: Tom Haynes --- nfs4.1/server41tests/__init__.py | 1 + nfs4.1/server41tests/st_flex.py | 144 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 nfs4.1/server41tests/st_flex.py diff --git a/nfs4.1/server41tests/__init__.py b/nfs4.1/server41tests/__init__.py index 8a423e1..a38c314 100644 --- a/nfs4.1/server41tests/__init__.py +++ b/nfs4.1/server41tests/__init__.py @@ -23,4 +23,5 @@ __all__ = ["st_exchange_id.py", # draft 21 ## "st_loop", "st_current_stateid.py", "st_sparse.py", + "st_flex.py", ] diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py new file mode 100644 index 0000000..bb4405c --- /dev/null +++ b/nfs4.1/server41tests/st_flex.py @@ -0,0 +1,144 @@ +from xdrdef.nfs4_const import * +from xdrdef.nfs4_type import * +from xdrdef.nfs4_pack import * +import nfs_ops +op = nfs_ops.NFS4ops() +from environment import check, fail, create_file, close_file +from xdrdef.nfs4_pack import NFS4Packer as FlexPacker, \ + NFS4Unpacker as FlexUnpacker +from nfs4lib import FancyNFS4Packer, get_nfstime + +def testStateid1(t, env): + """Check for proper sequence handling in layout stateids. + + FLAGS: flex + CODE: FFST1 + """ + sess = env.c1.new_pnfs_client_session(env.testname(t)) + # Create the file + res = create_file(sess, env.testname(t)) + check(res) + # Get layout 1 + fh = res.resarray[-1].object + open_stateid = res.resarray[-2].stateid + ops = [op.putfh(fh), + op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, + 0, 8192, 8192, open_stateid, 0xffff)] + res = sess.compound(ops) + check(res) + lo_stateid = res.resarray[-1].logr_stateid + if lo_stateid.seqid != 1: + # From draft23 12.5.2 "The first successful LAYOUTGET processed by + # the server using a non-layout stateid as an argument MUST have the + # "seqid" field of the layout stateid in the response set to one." + fail("Expected stateid.seqid==1, got %i" % lo_stateid.seqid) + for i in range(6): + # Get subsequent layouts + ops = [op.putfh(fh), + op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, + (i+1)*8192, 8192, 8192, lo_stateid, 0xffff)] + res = sess.compound(ops) + check(res) + lo_stateid = res.resarray[-1].logr_stateid + if lo_stateid.seqid != i + 2: + # From draft23 12.5.3 "After the layout stateid is established, + # the server increments by one the value of the "seqid" in each + # subsequent LAYOUTGET and LAYOUTRETURN response, + fail("Expected stateid.seqid==%i, got %i" % (i+2, lo_stateid.seqid)) + res = close_file(sess, fh, stateid=open_stateid) + check(res) + +def testFlexGetLayout(t, env): + """Verify layout handling + + FLAGS: flex + CODE: FFGLO1 + """ + sess = env.c1.new_pnfs_client_session(env.testname(t)) + # Create the file + res = create_file(sess, env.testname(t)) + check(res) + # Get layout + fh = res.resarray[-1].object + open_stateid = res.resarray[-2].stateid + ops = [op.putfh(fh), + op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_READ, + 0, 0xffffffffffffffff, 4196, open_stateid, 0xffff)] + res = sess.compound(ops) + check(res) + # Parse opaque + for layout in res.resarray[-1].logr_layout: + if layout.loc_type == LAYOUT4_FLEX_FILES: + p = FlexUnpacker(layout.loc_body) + opaque = p.unpack_ff_layout4() + p.done() + res = close_file(sess, fh, stateid=open_stateid) + check(res) + +def testFlexLayoutReturnFile(t, env): + """ + Return a file's layout + + FLAGS: flex + DEPEND: FFGLO1 + CODE: FFLOR1 + """ + sess = env.c1.new_pnfs_client_session(env.testname(t)) + # Create the file + res = create_file(sess, env.testname(t)) + check(res) + # Get layout + fh = res.resarray[-1].object + open_stateid = res.resarray[-2].stateid + ops = [op.putfh(fh), + op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_READ, + 0, 0xffffffffffffffff, 4196, open_stateid, 0xffff)] + res = sess.compound(ops) + check(res) + # Return layout + layout_stateid = res.resarray[-1].logr_stateid + ops = [op.putfh(fh), + op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, + layoutreturn4(LAYOUTRETURN4_FILE, + layoutreturn_file4(0, 0xffffffffffffffff, layout_stateid, "")))] + res = sess.compound(ops) + check(res) + res = close_file(sess, fh, stateid=open_stateid) + check(res) + +def testFlexLayoutStress(t, env): + """Alternate LAYOUTIOMODE4_RW/LAYOUTIOMODE4_READ layout segments in the file + + FLAGS: flex + CODE: FFLG2 + """ + seqid_next = 1 + sess = env.c1.new_pnfs_client_session(env.testname(t)) + # Create the file + res = create_file(sess, env.testname(t)) + check(res) + # Get layout 1 + fh = res.resarray[-1].object + open_stateid = res.resarray[-2].stateid + lo_stateid = open_stateid + + for i in range(1000): + ops = [op.putfh(fh), + op.layoutget(False, LAYOUT4_FLEX_FILES, + LAYOUTIOMODE4_READ if i%2 else LAYOUTIOMODE4_RW, + i * 8192, 8192, 8192, lo_stateid, 0xffff)] + res = sess.compound(ops) + check(res) + lo_stateid = res.resarray[-1].logr_stateid + if lo_stateid.seqid != seqid_next: + fail("Expected stateid.seqid==%i, got %i" % (seqid_next, lo_stateid.seqid)) + seqid_next += 1 + + ops = [op.putfh(fh), + op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, + layoutreturn4(LAYOUTRETURN4_FILE, + layoutreturn_file4(0, 0xffffffffffffffff, lo_stateid, "")))] + res = sess.compound(ops) + check(res) + res = close_file(sess, fh, stateid=open_stateid) + check(res)