diff mbox

[10/17] CLNT: test resues slot ID

Message ID 4D886F71.8050001@cn.fujitsu.com (mailing list archive)
State RFC, archived
Delegated to: Trond Myklebust
Headers show

Commit Message

Mi Jinlong March 22, 2011, 9:44 a.m. UTC
None
diff mbox

Patch

diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index c11fdc9..7277290 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -363,3 +363,32 @@  def testBadSequenceidAtSlot(t, env):
 
     res = c.c.compound([op.sequence(sid, nfs4lib.dec_u32(seqid), 2, 3, True)])
     check(res, NFS4ERR_SEQ_MISORDERED)
+
+def testReuseSlotID(t, env):
+    """ If client reuses a slot ID and sequence ID for a completely
+        different request, server MAY treat the request as if it is
+        a retry of what it has already executed. rfc5661 18.46.3
+
+    FLAGS: sequence all
+    CODE: SEQ14
+    """
+    c = env.c1.new_client(env.testname(t))
+    # CREATE_SESSION
+    sess1 = c.create_session()
+
+    name = "%s_1" % env.testname(t)
+    res = create_file(sess1, name)
+    check(res)
+
+    sid = sess1.sessionid
+    seqid = nfs4lib.inc_u32(sess1.seqid)
+    dir = sess1.c.homedir
+
+    res = c.c.compound([op.sequence(sid, seqid, 0, 0, TRUE)] +
+                        nfs4lib.use_obj(dir) + [op.remove(name)])
+    check(res)
+
+    # Reuses slot ID and sequence ID for different request
+    res = c.c.compound([op.sequence(sid, seqid, 0, 0, TRUE)] +
+                        nfs4lib.use_obj(dir) + [op.rename(name, "test")])
+    check(res)