diff mbox

[10/17] CLNT: test resues slot ID

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

Commit Message

Mi Jinlong March 4, 2011, 9:06 a.m. UTC
None
diff mbox

Patch

=========================================================
From 3a195260494cccbaa2231b1247c98c21d13d34b3 Mon Sep 17 00:00:00 2001
From: Mi Jinlong <mijinlong@cn.fujitsu.com>
Date: Fri, 4 Mar 2011 19:53:35 +0800
Subject: [PATCH] CLNT: test client reuses slot ID

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
 nfs4.1/server41tests/st_sequence.py |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index c11fdc9..31289ee 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -363,3 +363,33 @@  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)
+    fh = res.resarray[3].object
+    homedir = sess1.c.homedir[0]
+
+    res = c.c.compound([op.sequence(sid, seqid, 0, 0, TRUE), op.putrootfh(),
+                        op.lookup(homedir), 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), op.putrootfh(),
+                        op.lookup(homedir), op.rename(name, "test")])
+    check(res)