diff mbox

[09/17] CLNT: test Bad Sequenceid At Slot

Message ID 4D6DE484.6010608@cn.fujitsu.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Mi Jinlong March 2, 2011, 6:32 a.m. UTC
None
diff mbox

Patch

diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index ed0cc8c..4ea5cab 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -338,3 +338,28 @@  def testSessionidSequenceidSlotid(t, env):
 
     if not nfs4lib.test_equal(res.resarray[0].sr_slotid, 2, "int"):
         fail("server return bad slotid")
+
+def testBadSequenceidAtSlot(t, env):
+    """ If the difference between sa_sequenceid and the server's cached
+        sequence ID at the slot ID is two (2) or more, or if sa_sequenceid
+        is less than the cached sequence ID , server MUST return
+        NFS4ERR_SEQ_MISORDERED. rfc5661 18.46.3
+
+    FLAGS: sequence all
+    CODE: SEQ13
+    """
+    c = env.c1.new_client(env.testname(t))
+    # CREATE_SESSION
+    sess1 = c.create_session()
+
+    sid = sess1.sessionid 
+    res = c.c.compound([op.sequence(sid, 1, 2, 3, True)])
+    check(res)
+
+    seqid = res.resarray[0].sr_sequenceid
+    # SEQUENCE with bad sr_sequenceid
+    res = c.c.compound([op.sequence(sid, seqid + 2, 2, 3, True)])
+    check(res, NFS4ERR_SEQ_MISORDERED)
+
+    res = c.c.compound([op.sequence(sid, nfs4lib.dec_u32(seqid), 2, 3, True)])
+    check(res, NFS4ERR_SEQ_MISORDERED)