From: Tom Haynes <loghyr@primarydata.com>
To: "J. Bruce Fields" <bfields@redhat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH pynfs 03/12] Some more file closes to cleanup state on the server
Date: Sat, 26 Nov 2016 22:26:32 -0800 [thread overview]
Message-ID: <1480228001-64821-4-git-send-email-loghyr@primarydata.com> (raw)
In-Reply-To: <1480228001-64821-1-git-send-email-loghyr@primarydata.com>
Signed-off-by: Tom Haynes <loghyr@primarydata.com>
---
nfs4.1/server41tests/st_current_stateid.py | 12 +++++++++++-
nfs4.1/server41tests/st_debug.py | 18 ++++++++++++++++--
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/nfs4.1/server41tests/st_current_stateid.py b/nfs4.1/server41te=
sts/st_current_stateid.py
index a0d6757..01d78c0 100644
--- a/nfs4.1/server41tests/st_current_stateid.py
+++ b/nfs4.1/server41tests/st_current_stateid.py
@@ -46,6 +46,8 @@ def testLockLockU(t, env):
=09op.locku(WRITE_LT, 0, current_stateid, 0, NFS4_UINT64_MAX) ]
res =3D sess1.compound([op.putfh(fh)] + lock_ops)
check(res, NFS4_OK)
+ res =3D close_file(sess1, fh, stateid=3Dstateid)
+ check(res)
=20
def testOpenWriteClose(t, env):
"""test current state id processing by having OPEN, WRITE and CLOSE
@@ -132,6 +134,10 @@ def testOpenLayoutGet(t, env):
[op.layoutget(False, LAYOUT4_NFSV4_1_FILES, LAYOUTIOMODE4_RW,
0, 8192, 8192, current_stateid, 0xffff)])
check(res, NFS4_OK)
+ fh =3D res.resarray[-1].object
+ stateid =3D res.resarray[-2].stateid
+ res =3D close_file(sess, fh, stateid=3Dstateid)
+ check(res)
=20
def testOpenSetattr(t, env):
"""test current state id processing by having OPEN and SETATTR
@@ -145,8 +151,12 @@ def testOpenSetattr(t, env):
=20
open_op =3D open_create_file_op(sess, env.testname(t), open_create=3DO=
PEN4_CREATE)
res =3D sess.compound( open_op +
- [ op.setattr(current_stateid, {FATTR4_SIZE: size})])
+ [op.getfh(), op.setattr(current_stateid, {FATTR4_SIZE: size})])
check(res, NFS4_OK)
+ fh =3D res.resarray[-3].object
+ stateid =3D res.resarray[-4].stateid
+ res =3D close_file(sess, fh, stateid=3Dstateid)
+ check(res)
=20
def testOpenFreestateidClose(t, env):
"""test current state id processing by having OPEN, FREE_STATEID and C=
LOSE
diff --git a/nfs4.1/server41tests/st_debug.py b/nfs4.1/server41tests/st_deb=
ug.py
index 2b9890e..532ee7a 100644
--- a/nfs4.1/server41tests/st_debug.py
+++ b/nfs4.1/server41tests/st_debug.py
@@ -1,6 +1,6 @@
from st_create_session import create_session
from xdrdef.nfs4_const import *
-from environment import check, fail, create_file
+from environment import check, fail, create_file, close_file
from xdrdef.nfs4_type import open_owner4, openflag4, createhow4, open_clai=
m4
import nfs_ops
op =3D nfs_ops.NFS4ops()
@@ -19,6 +19,8 @@ def testSupported2(t, env):
access=3DOPEN4_SHARE_ACCESS_READ |
OPEN4_SHARE_ACCESS_WANT_READ_DELEG)
check(res) # STUB Should check delegation was granted
+ fh1 =3D res.resarray[-1].object
+ stateid1 =3D res.resarray[-2].stateid
# c2 - OPEN - WRITE
c2 =3D env.c1.new_client("%s_2" % env.testname(t))
sess2 =3D c2.create_session()
@@ -31,6 +33,12 @@ def testSupported2(t, env):
# STUB - since we are not handling callback, deleg_return never gets d=
one
print res
check(res)
+ fh2 =3D res.resarray[-1].object
+ stateid2 =3D res.resarray[-2].stateid
+ res =3D close_file(sess1, fh1, stateid=3Dstateid1)
+ check(res)
+ res =3D close_file(sess2, fh2, stateid=3Dstateid2)
+ check(res)
=20
def testReadWrite(t, env):
"""Do a simple READ and WRITE
@@ -58,7 +66,8 @@ def testReadWrite(t, env):
res =3D sess1.compound([op.putfh(fh), op.read(stateid, 0, 1000)])
print res
check(res)
-
+ res =3D close_file(sess1, fh, stateid=3Dstateid)
+ check(res)
=20
def testDeadlock(t, env):
"""Trigger deadlock bug
@@ -87,6 +96,8 @@ def testDeadlock(t, env):
res =3D sess1.listen(xid)
check(res)
print res
+ res =3D close_file(sess1, fh, stateid=3Dstateid)
+ check(res)
=20
def testLayout(t, env):
"""Verify layout handling
@@ -103,11 +114,14 @@ def testLayout(t, env):
check(openres)
# Get a layout
fh =3D openres.resarray[-1].object
+ stateid =3D res.resarray[-2].stateid
ops =3D [op.putfh(fh),
op.layoutget(False, LAYOUT4_BLOCK_VOLUME, LAYOUTIOMODE4_READ,
0, 0xffffffff, 4*blocksize, 0xffff)]
res =3D sess.compound(ops)
check(res)
+ res =3D close_file(sess1, fh, stateid=3Dstateid)
+ check(res)
=20
def testGetDevList(t, env):
"""Check devlist
--=20
2.3.6
next prev parent reply other threads:[~2016-11-27 6:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-27 6:26 [PATCH pynfs 00/12] Flex File support Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 01/12] According to RFC7863, this is not an array Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 02/12] Close the files opened in the OPEN tests Tom Haynes
2016-11-27 6:26 ` Tom Haynes [this message]
2016-11-27 6:26 ` [PATCH pynfs 04/12] Get rid of the client records as well as the session records Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 05/12] Really, really close those open temp files to remove state on the server Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 06/12] Add xdr for Flex Files Layout Type Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 07/12] Simple tests of the flex file layout type Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 08/12] Add a check to see if NFS4ERR_OLD_STATEID is issued on concurrent layoutgets Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 09/12] Check that the flex file access uid/gid are correct for the different iomodes Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 10/12] FFLS1: Simulate LAYOUTSTATS for 20 small file creations Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 11/12] Factor out checking seqid for flex file layouts Tom Haynes
2016-11-27 6:26 ` [PATCH pynfs 12/12] Add layoutstats tests for flex files Tom Haynes
2016-11-28 17:22 ` J. Bruce Fields
2016-11-28 17:52 ` Tom Haynes
2016-11-28 16:33 ` [PATCH pynfs 00/12] Flex File support J. Bruce Fields
2016-11-28 16:53 ` Tom Haynes
2016-11-28 21:47 ` J. Bruce Fields
2016-11-28 23:38 ` Tom Haynes
2016-11-29 1:55 ` J. Bruce Fields
2016-11-29 23:44 ` Frank Filz
2016-11-30 14:24 ` J. Bruce Fields
2016-11-30 16:56 ` Frank Filz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480228001-64821-4-git-send-email-loghyr@primarydata.com \
--to=loghyr@primarydata.com \
--cc=bfields@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).