Re: [PATCH 10/17] CLNT: test resues slot ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Mi Jinlong :
> 
> J. Bruce Fields:
>> On Wed, Mar 02, 2011 at 02:33:09PM +0800, Mi Jinlong wrote:
>>> Signed-off-by: Mi Jinlong <mijinlong@xxxxxxxxxxxxxx>
>>> ---
>>>  nfs4.1/server41tests/st_sequence.py |   18 ++++++++++++++++++
>>>  1 files changed, 18 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
>>> index 4ea5cab..391fc45 100644
>>> --- a/nfs4.1/server41tests/st_sequence.py
>>> +++ b/nfs4.1/server41tests/st_sequence.py
>>> @@ -363,3 +363,21 @@ 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):
>>> +    """
>>> +
>>> +    FLAGS: sequence all
>>> +    CODE: SEQ14
>>> +    """
>> Missing description?
> 
>   Sorry! I will add it at next version.
> 
>>> +    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), op.putrootfh()])
>>> +    check(res)
>>> +
>>> +    res = c.c.compound([op.sequence(sid, 1, 2, 3, True)])
>>> +    # should we also check the ERROR of NFS4ERR_SEQ_FALSE_RETRY ??
>> As I understand it, the server isn't required to recognize false
>> retries, so I don't think we can check for that.
>>
>> The only useful thing to check for, I think, is just to send the same
>> request twice and make sure the requests match.
>>
>> Actually, best would be to do this with a non-idempotent operation.  For
>> example, send SEQ+RENAME twice and make sure that both renames succeed.
>> (Whereas if the server reply cache is broken and the server attempts to
>> rename the file again, the second rename will fail with NOENT.)
> 
>   Yes, thanks for you advice.
>   I will send a new patch tomorrow.

   Maybe the following one is better than before.

-- 
thanks,
Mi Jinlong 

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

Signed-off-by: Mi Jinlong <mijinlong@xxxxxxxxxxxxxx>
---
 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)
-- 
1.7.4.1


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux