From patchwork Sun Nov 27 06:26:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 9448699 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 C1B276071C for ; Sun, 27 Nov 2016 06:27:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A938A20855 for ; Sun, 27 Nov 2016 06:27:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E26C22376; Sun, 27 Nov 2016 06:27:38 +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 0E77720855 for ; Sun, 27 Nov 2016 06:27:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752428AbcK0G1h (ORCPT ); Sun, 27 Nov 2016 01:27:37 -0500 Received: from us-smtp-delivery-194.mimecast.com ([63.128.21.194]:55854 "EHLO us-smtp-delivery-194.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046AbcK0G1g (ORCPT ); Sun, 27 Nov 2016 01:27:36 -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=qQ8iyAjT/usmWUcB2SqrNOwoU8eGgaAFe49nvZx9Sq0=; b=BN7Ea0RnMHtzIuYwMqfUIh4/SKAnBm719wCMc2Z7GRK4jmAy3ZBJAmR5EdBjqNeW5gBkOFb0Pnnx9LogfceTg+RSdH399zD77X/r3iRNDjhE8FTLz0DJE+z/X/yoEY2wosnTTCqwY2y7pDNTt8ERTHML2SWadfrBCJLbMLMrhHY= Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02lp0018.outbound.protection.outlook.com [216.32.180.18]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-66-BzE9x8SBOR64zO_EctSLEg-3; Sun, 27 Nov 2016 01:27:24 -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:19 +0000 From: Tom Haynes To: "J. Bruce Fields" CC: Linux NFS Mailing list Subject: [PATCH pynfs 02/12] Close the files opened in the OPEN tests Date: Sat, 26 Nov 2016 22:26:31 -0800 Message-ID: <1480228001-64821-3-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: d7127ad6-4d43-4647-6517-08d4168e7096 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR11MB1364; X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 3:UUrChfcBhyRaRtF2ikzJRbUp88dyhYfu3LrDXTOIIu+Ji0xUGnF8hqxxN/CJBbukT2CD8svF/rqC1ALN3oDozmi02veEp+SPD+OdSyEm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M44coCc/OfokhmZl0Exx56uiqKNDcRTRkYiySIdEEp3nJFV+UmdNz+Xiaf8OJ+lmaZ9bbUi/iEGtTXdLbhdqw/whN+6/PEjZI8NN8kuXlqsy64wBHg9tE/SHJs2PV6DBsN3rZCRaTJrteE9szOeWV/rssw2BN+Wsn3Lfa4vsF5MmtdCEsLyGJEKRUx+0k28kP9Mj4mSxfOKZiQUjl5d2/gCIHJSFkWvr3TetUh1USkFOX1A20aVq6yz4rn+A/dRz1xa+hgt1GU+MRhYmEDsQGE=; 20:XG0N7uc5orh6Yl+tJMN233BSjrxc6zk21JSgKJWnZ6z8iky1si/8xqAVlWvUMZtafSa7jHTel4IJbVXD0io1voqUsWVEb9HhOnkLvYFj7yvvLPuPGe+d+encVAnoFlEzU9SloXmBtepeIOcrbw1lBRD55tofODyWoGGDBrgsrCw= 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:mtJlKBpqEAM+7eDssVXv+bf1UdYCtbVZNMXxrHKOqN9wS/KSTooqGIqpuPN1xMakTCeUKcA5txayFvyjHMlNyUwwb9jQOgHLgnVEGmrql8OZjNCNwzDt3Ucw/ZDqSuCwGrHwaS908YfJhiB5bB0HIak1+v7XwvIR780GqkEkGrQ9oekqorf+Ru0fpjTqAsLLJavKohhJtLDpfJOBKDqbLqVpyEoDW/OKrYRYcGNAPfowQO43rr07SF8uwKRepaJr53gggcG95/GO2JWnEUhL4ku78Z1a2PCTCBaCgp/t2Soe9UGBrGvFXn0ls0QbgfdDaAt53ReSjo+rGGX8MzPkPJDoHZd1pUgfKcWprtI0HTPd+1Bk/Ks86ZN2slbDU8O3wBkrBHXD3dje+GFJyf5531ldwqvyv/ULykNx7T3Txf/WB8PVkcqq6DDPAjoJXyyvhBlCjjDTN8ZbALNB4PVp2GATri6UwQWFn9edSFHUnxo9EKKm4w8RloqWwI6ElotM37szOr68eJPSdANlKNVPFFG78yvnZHsMTrJqxNJJ6kSBgk81Jh+1JTttUJbxLuMQ6eobVsd8b4V89FbfeztnOlEstenZWdixUSsSWV22fvnOXdx5h3toX1S8mtdsMapFdmwcJAzdfcXzGW3IHQOXhTg6f4XgWb0E0i0fY41sWbd91d4Tn/uzCE94eE0S40m210kr1yKPNnXPyuAAFMyk3eto15cCtq1S1TVGjae3FzM= X-Forefront-PRVS: 0139052FDB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(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)(969003)(989001)(999001)(1009001)(1019001); 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:i2vqk+jZxHj1M+RcO/gZ7dAEAz+FlvOq1ifABB0/m?= =?us-ascii?Q?fQ6U23mjs90m6uNXs/EfDN6y+EOMBW85TaEw3JAgpmGTiUSLKeSpqwZUGs3W?= =?us-ascii?Q?0K83wAY7qkuCbpCYfL7oEmWGy8vDGrAw78ITaK2yZd7L0S9ofUR1WWgE+wdH?= =?us-ascii?Q?viYgbKBV7L+pp3B1EQmG7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=?us-ascii?Q?vgmtc79PxPmWFIzconuI1YDaJ7GRzWB7kSrWRnmbwvLblKtgk5J3ehlSpLxS?= =?us-ascii?Q?MvgaU7sZm8=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 6:OAyeoBo6ewPx6MFYNPLRb8Z/gTuYwclzywFNWx0L33gzjLGyFz80/EWmzjg7v+jUoZiR7+V0XJNLMcmLqFH4uicQWD6jOHAWEYiwBlNx4N3XgKQv7QctXT5QYyaU0klpS0FI7nN4UBgVtZkL0OL54gqG0xYvvrTwqo2ekOIiEPtZY62trurFZsolEpypcb5GM08eH1ogrw9hfxY+uMVbkkhSVw8X3gEtE1Bs9ZOGfLlrZNCBkLqzFTA8yPP3WxQUWKcvffUy6MjKiugfwFllA2Qh1iihqG6tsXkti1b0b1h8h3e0mzT8EaeAa9Vu5j65lJUrNiZ1X8PKz2TFklq7JC0nex9WShirRwztQxIKWMS5Me61puszi4cOOnpbtx/C+PfKHhgk0oQuIDpHTxMpAgpBont8HXll9pbjqfSAcKT/cJDWBxe3jYynW1u4/LdLRPThhjXr8emcsmJT0GmKOnk1MOLsB4Y1+hTpd9x1SYk=; 5:7lhasz2Wa81xqeXOmhxjKDMl6bhajuwNT8pN9sFk5uKHJn/MqcCe1S+GeaXxbeiqV2geJRsMlWEkt3HJMSTn63gsgNdU68PRqzKsuTbwps9CjDSIQa5BP2TaV5FViLd6wDMVQ9HBiGOCddO5QRI7DUAKAuppTYf3Z7qVtYxEqco=; 24:cEoQaRnCbYSLoCX2hpQuS0k3D51FxG/Vv9icaSzJFOkhrkiylM7khvFP09cUlw++x7XGBY8BzFXjGmBOaQinRWsCyCjTOImGWv8UhpltiTk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 7:ZIS6fJ6Wze5BLN2Arz+9KXS+M01s7LxgiL32s4VmyKNqeHIEvHlwX7GfhyYgmFNSfiUP0qe9XZ39VwLl0MFQyvGXMW26FbLFEwoGqZw8/YRv00k3GpmlHuLhgnhPCTZIhNu7k3LxUW1982kS1FX3+ZarZyyuNSp/PL7MdqFWPA9Q70x1HjH1djcxD96yYt6YonESL1Rm7qsWaTrjzK4DM2Ywa62DGyPe6XNl0f8WiHe6fB6WtNkygjTdFe8BR26fZ8NNB9phHBqJU6511j8apb9M/l8ppwR7VsNe7aZNj0ZiWH4zghzsWxiTOE2UyV4XFnS+3tOmHjF0b6txs8mW7a+nlHdPSm8HtRVRwdbXjtL7kqVrIbmk8erY8U0bTDuK+3UY101CiCDyRB0zKZ8+o0zBZPTOWp3NTLQuyRUwz780xLQnyIUqD1MYcUVq9CNb43mTdgczDS629qwNtnZqnQ==; 20:4R/bLbFAuLnHcwU37QFOz7VrcPgZGsErKE84ARhWyky1b571oFWXqaCGwXCjfVx786C6uYy1aV6jQqfqAOtw8rLaOi1lNRyU3ANnQa61K0iVVICTLOmajmxp2797mx6y+Xfj/nDUJePPN1pcRna5mDrrN4XdHOjb5zxUJgHADmQ= X-OriginatorOrg: primarydata.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2016 06:27:19.2411 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1364 X-MC-Unique: BzE9x8SBOR64zO_EctSLEg-3 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 Otherwise open files are left behind and as each test gets their own client ID. Also, as OPEN7 can get a delegation from an agressive server and pynfs does not handle CBs, do not get the delegation. Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_open.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/nfs4.1/server41tests/st_open.py b/nfs4.1/server41tests/st_open.py index 235212c..473732d 100644 --- a/nfs4.1/server41tests/st_open.py +++ b/nfs4.1/server41tests/st_open.py @@ -29,12 +29,17 @@ def testSupported(t, env): # See 8.1.3.1 of draft-10: # the server MUST provide an "seqid" value starting at one... expect(res, seqid=1) + fh = res.resarray[-1].object + stateid = res.resarray[-2].stateid # STUB - need to check open_res.delegation.delegation_type # see draft-10 line 19445 # QUESTION - what does "If the server supports the new _WANT_ flags" mean? # will the server return INVAL? NOTSUPP? or just silently ignore? + res = close_file(sess1, fh, stateid=stateid) + check(res) + def testServerStateSeqid(t, env): """Do multiple OPENs of a file, check that server bumps stateid.seqid @@ -51,8 +56,14 @@ def testServerStateSeqid(t, env): res = open_file(sess1, owner, path, access=OPEN4_SHARE_ACCESS_READ) check(res) expect(res, seqid=2) + fh = res.resarray[-1].object + stateid = res.resarray[-2].stateid + # STUB - need to check no delegation return + res = close_file(sess1, fh, stateid=stateid) + check(res) + def testReadWrite(t, env): """Do a simple READ and WRITE @@ -78,6 +89,9 @@ def testReadWrite(t, env): if res.resarray[-1].data != desired: fail("Expected %r, got %r" % (desired, res.resarray[-1].data)) + res = close_file(sess1, fh, stateid=stateid) + check(res) + def testAnonReadWrite(t, env): """Do a simple READ and WRITE using anonymous stateid @@ -93,6 +107,7 @@ def testAnonReadWrite(t, env): data = "write test data" stateid = res.resarray[-2].stateid res = close_file(sess1, fh, stateid=stateid) + check(res) res = sess1.compound([op.putfh(fh), op.write(nfs4lib.state00, 5, FILE_SYNC4, data)]) check(res) res = sess1.compound([op.putfh(fh), op.read(nfs4lib.state00, 0, 1000)]) @@ -115,11 +130,16 @@ def testEXCLUSIVE4AtNameAttribute(t, env): res = create_file(sess1, env.testname(t), mode=EXCLUSIVE4_1) check(res) + fh = res.resarray[-1].object + stateid = res.resarray[-2].stateid res = create_file(sess1, env.testname(t), mode=EXCLUSIVE4_1, verifier = "Justtest") check(res, NFS4ERR_EXIST) + res = close_file(sess1, fh, stateid=stateid) + check(res) + def testOPENClaimFH(t, env): """OPEN file with claim_type is CLAIM_FH @@ -127,7 +147,7 @@ def testOPENClaimFH(t, env): CODE: OPEN7 """ sess1 = env.c1.new_client_session(env.testname(t)) - res = create_file(sess1, env.testname(t)) + res = create_file(sess1, env.testname(t), want_deleg=False) check(res) fh = res.resarray[-1].object @@ -138,7 +158,9 @@ def testOPENClaimFH(t, env): claim = open_claim4(CLAIM_FH) how = openflag4(OPEN4_NOCREATE) oowner = open_owner4(0, "My Open Owner 2") - open_op = op.open(0, OPEN4_SHARE_ACCESS_BOTH, OPEN4_SHARE_DENY_NONE, + access = OPEN4_SHARE_ACCESS_BOTH|OPEN4_SHARE_ACCESS_WANT_NO_DELEG + + open_op = op.open(0, access, OPEN4_SHARE_DENY_NONE, oowner, how, claim) res = sess1.compound([op.putfh(fh), open_op]) check(res) @@ -156,6 +178,9 @@ def testOPENClaimFH(t, env): if res.resarray[-1].data != desired: fail("Expected %r, got %r" % (desired, res.resarray[-1].data)) + res = close_file(sess1, fh, stateid=stateid) + check(res) + def testCloseWithZeroSeqid(t, env): """OPEN followed by CLOSE with stateid.seq = 0