diff mbox

[06/17] CLNT: test reply too big to cache

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

Commit Message

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

Patch

diff --git a/nfs4.1/server41tests/st_create_session.py b/nfs4.1/server41tests/st_create_session.py
index c474ce3..ff55d10 100644
--- a/nfs4.1/server41tests/st_create_session.py
+++ b/nfs4.1/server41tests/st_create_session.py
@@ -455,3 +455,24 @@  def testRepTooBig(t, env):
     # read data rather than ca_maxresponsesize
     res = sess1.compound([op.putfh(fh), op.read(stateid, 0, 500)])
     check(res, NFS4ERR_REP_TOO_BIG)
+
+def testRepTooBigToCache(t, env):
+    """If requester sends a request for which the size of the reply
+       would exceed ca_maxresponsesize_cached, the replier will return
+       NFS4ERR_REP_TOO_BIG_TO_CACHE
+
+    FLAGS: create_session all
+    CODE: CSESS27
+    """
+    c = env.c1.new_client(env.testname(t))
+    # CREATE_SESSION with a small ca_maxresponsesize_cached
+    chan_attrs = channel_attrs4(0,8192,8192,10,128,8,[])
+    res = c.c.compound([op.create_session(c.clientid, c.seqid, 0,
+                                        chan_attrs, chan_attrs,
+                                        123, [])], None)
+    check(res)
+
+    # SEQUENCE with cache this
+    sid = res.resarray[0].csr_sessionid
+    res = c.c.compound([op.sequence(sid, 1, 0, 0, True)])
+    check(res, NFS4ERR_REP_TOO_BIG_TO_CACHE)