diff mbox series

[pynfs,3/3] nfs4.1: close the file created in SEQ10b

Message ID 20190311154951.6144-4-smayhew@redhat.com (mailing list archive)
State New, archived
Headers show
Series a few fixes | expand

Commit Message

Scott Mayhew March 11, 2019, 3:49 p.m. UTC
Otherwise, the DESTROY_CLIENTID sent during cleanup returns
NFS4ERR_CLIENTID_BUSY.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 nfs4.1/server41tests/st_sequence.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index 391b226..c21d8f7 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -1,6 +1,6 @@ 
 from st_create_session import create_session
 from xdrdef.nfs4_const import *
-from .environment import check, fail, bad_sessionid, create_file
+from .environment import check, fail, bad_sessionid, create_file, close_file
 from xdrdef.nfs4_type import channel_attrs4
 import nfs_ops
 op = nfs_ops.NFS4ops()
@@ -223,12 +223,15 @@  def testReplayCache007(t, env):
     sess1 = env.c1.new_client_session(env.testname(t))
     res = create_file(sess1, "%s_1" % env.testname(t))
     check(res)
+    fh = res.resarray[-1].object
+    stateid = res.resarray[-2].stateid
     ops = env.home + [op.savefh(),\
           op.rename("%s_1" % env.testname(t), "%s_2" % env.testname(t))]
     res1 = sess1.compound(ops, cache_this=False)
     check(res1, NFS4_OK)
     res2 = sess1.compound(ops, seq_delta=0, cache_this=False)
     check(res2, [NFS4_OK, NFS4ERR_RETRY_UNCACHED_REP])
+    close_file(sess1, fh, stateid=stateid)
 
 def testOpNotInSession(t, env):
     """Operations other than SEQUENCE, BIND_CONN_TO_SESSION, EXCHANGE_ID,