[08/17] CLNT: test the sessionid, slotid and sequenceid for SEQUENCE
diff mbox

Message ID 4D6DE458.4040809@cn.fujitsu.com
State RFC, archived
Headers show

Commit Message

Mi Jinlong March 2, 2011, 6:31 a.m. UTC
None

Patch
diff mbox

diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index c6a5959..ed0cc8c 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -314,3 +314,27 @@  def testOpNotInSession(t, env):
     # putrootfh with out session
     res = c.c.compound([op.putrootfh()])
     check(res, NFS4ERR_OP_NOT_IN_SESSION)
+
+def testSessionidSequenceidSlotid(t, env):
+    """ The sr_sessionid result MUST equal sa_sessionid.
+        The sr_slotid result MUST equal sa_slotid. 
+        The sr_sequenceid result MUST equal sa_sequenceid.
+        rfc5661 18.46.3 
+
+    FLAGS: sequence all
+    CODE: SEQ12
+    """
+    c = env.c1.new_client(env.testname(t))
+    sess1 = c.create_session()
+
+    # SEQUENCE
+    sid = sess1.sessionid 
+    res = c.c.compound([op.sequence(sid, 1, 2, 3, True)])
+    if not nfs4lib.test_equal(res.resarray[0].sr_sessionid, sid, "opaque"):
+        fail("server return bad sessionid")
+
+    if not nfs4lib.test_equal(res.resarray[0].sr_sequenceid, 1, "int"):
+        fail("server return bad sequenceid")
+
+    if not nfs4lib.test_equal(res.resarray[0].sr_slotid, 2, "int"):
+        fail("server return bad slotid")