From: Mi Jinlong <mijinlong@cn.fujitsu.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: NFS <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 10/17] CLNT: test resues slot ID
Date: Tue, 22 Mar 2011 17:44:17 +0800 [thread overview]
Message-ID: <4D886F71.8050001@cn.fujitsu.com> (raw)
In-Reply-To: <20110317225245.GE31845@fieldses.org>
J. Bruce Fields:
> On Tue, Mar 15, 2011 at 10:47:00AM +0800, Mi Jinlong wrote:
>>
>> J. Bruce Fields:
>>> On Mon, Mar 14, 2011 at 02:41:44PM -0400, J. Bruce Fields wrote:
>>>> On Fri, Mar 04, 2011 at 05:06:31PM +0800, Mi Jinlong wrote:
>>>>> Maybe the following one is better than before.
>>>> Looks good to me, thanks!
>>> But on testing I get a failure:
>>>
>>> SEQ14 st_sequence.testReuseSlotID : FAILURE
>>> AttributeError: LOOKUP4res instance has no attribute
>>> 'object'
>> See below.
>>
>>> I haven't tried to figure out what's going on there.
>>>
>>> --b.
>>>
>>>> Very minor nit:
>>>>
>>>>> +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)
>>>> Could you check your patches for trailing whitespace? (There's an extra
>>>> space at the end of that line.)
>> I will pay attention to that in the future.
>>
>>>> (No need to resend anything.)
>>>>
>>>> --b.
>>>>
>>>>> + check(res)
>>>>> +
>>>>> + sid = sess1.sessionid
>>>>> + seqid = nfs4lib.inc_u32(sess1.seqid)
>>>>> + fh = res.resarray[3].object
>> The error only appears here.
>>
>> At my machine, the res.resarray[3] is GETFHres.
>> As the above error message shown res.resarray[3] is LOOKUP4res.
>> Is it the nfs4lib's problem?
>
> Oh, are you assuming that the GETFH op is always at the same position in
> the compound?
>
> You can't do that--the number of LOOKUPS required to get to the file
> depends on how deep in the server's pseudofs the file is.
>
> Note the following "homedir = " line also assumes that the pynfs tests
> are being run on /, but that's not necessarily true.
I have made a mistake about this case, we don't need the filehandle from GETFHres,
that is just unnecessary.
Thanks for your point about the homedir,
I found a function named use_obj at nfs4lib which can solve our problem.
After fixed, maybe the following patch is OK now.
---
thanks,
Mi Jinlong
>From e9faf0c2e86421012296f95ce5cd9cd3338f98a2 Mon Sep 17 00:00:00 2001
From: Mi Jinlong <mijinlong@cn.fujitsu.com>
Date: Mon, 22 Mar 2011 19:25:23 +0800
Subject: [PATCH] CLNT: test resues slot ID
Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
nfs4.1/server41tests/st_sequence.py | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index c11fdc9..7277290 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -363,3 +363,32 @@ 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)
+ dir = sess1.c.homedir
+
+ res = c.c.compound([op.sequence(sid, seqid, 0, 0, TRUE)] +
+ nfs4lib.use_obj(dir) + [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)] +
+ nfs4lib.use_obj(dir) + [op.rename(name, "test")])
+ check(res)
--
1.7.4.1
next prev parent reply other threads:[~2011-03-22 9:43 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 6:23 [PATCH 00/17] add some test case for pynfs41 Mi Jinlong
2011-03-02 6:26 ` [PATCH 01/17] CLNT: check NFS4ERR_NOT_ONLY_OP for CREATE_SESSION Mi Jinlong
2011-03-03 5:57 ` J. Bruce Fields
2011-03-02 6:27 ` [PATCH 02/17] CLNT: test lease period of unconfirmed record Mi Jinlong
2011-03-02 6:28 ` [PATCH 03/17] CLNT: check the csr_sequence at CREATE_SESSION Mi Jinlong
2011-03-03 6:02 ` [PATCH 02/17] CLNT: test lease period of unconfirmed record J. Bruce Fields
2011-03-03 9:07 ` Mi Jinlong
2011-03-09 1:29 ` J. Bruce Fields
2011-03-09 1:43 ` Mi Jinlong
2011-03-02 6:29 ` [PATCH 04/17] CLNT: test with ca_maxresponsesize is too small Mi Jinlong
2011-03-02 6:29 ` [PATCH 05/17] CLNT: test reply too big Mi Jinlong
2011-03-02 6:30 ` [PATCH 06/17] CLNT: test reply too big to cache Mi Jinlong
2011-03-02 6:31 ` [PATCH 07/17] CLNT: test operation not in session Mi Jinlong
2011-03-02 6:31 ` [PATCH 08/17] CLNT: test the sessionid, slotid and sequenceid for SEQUENCE Mi Jinlong
2011-03-02 6:32 ` [PATCH 09/17] CLNT: test Bad Sequenceid At Slot Mi Jinlong
2011-03-02 6:33 ` [PATCH 10/17] CLNT: test resues slot ID Mi Jinlong
2011-03-03 6:14 ` J. Bruce Fields
2011-03-03 9:11 ` Mi Jinlong
2011-03-03 14:51 ` J. Bruce Fields
2011-03-04 9:06 ` Mi Jinlong
2011-03-14 18:41 ` J. Bruce Fields
2011-03-14 19:24 ` J. Bruce Fields
2011-03-15 2:47 ` Mi Jinlong
2011-03-17 22:52 ` J. Bruce Fields
2011-03-22 9:44 ` Mi Jinlong [this message]
2011-03-22 21:48 ` J. Bruce Fields
2011-03-23 9:41 ` Mi Jinlong
2011-03-02 6:33 ` [PATCH 11/17] CLNT: DESTROY_SESSION not the fianl operation Mi Jinlong
2011-03-02 6:34 ` [PATCH 12/17] CLNT: test DESTROY_SESSION not the sole operation Mi Jinlong
2011-03-02 6:34 ` [PATCH 13/17] CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
2011-03-02 6:35 ` [PATCH 14/17] CLNT: test reclaim after RECLAIM_COMPLETE Mi Jinlong
2011-03-02 6:36 ` [PATCH 15/17] CLNT: test lock before RECLAIM_COMPLETE Mi Jinlong
2011-03-14 19:27 ` J. Bruce Fields
2011-03-15 3:06 ` Mi Jinlong
2011-03-17 22:54 ` J. Bruce Fields
2011-03-02 6:36 ` [PATCH 16/17] CLNT: test double RECLAIM_COMPLETE after create session Mi Jinlong
2011-03-02 6:37 ` [PATCH 17/17] CLNT: test EXCLUSIVE4_1 for different verifier Mi Jinlong
2011-03-03 5:56 ` [PATCH 00/17] add some test case for pynfs41 J. Bruce Fields
2011-03-28 8:50 ` [PATCH 0/5] a pynfs41 problem and some tests about RECLAIM_COMPLETE Mi Jinlong
2011-03-28 8:57 ` [PATCH 1/5] CLNT: try to destroy session after test complete Mi Jinlong
2011-04-19 15:20 ` J. Bruce Fields
2011-04-20 9:33 ` Mi Jinlong
2011-03-28 8:59 ` [PATCH v2 2/5] CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
2011-03-28 8:59 ` [PATCH v2 3/5] CLNT: test reclaim after RECLAIM_COMPLETE Mi Jinlong
2011-04-19 22:49 ` J. Bruce Fields
2011-03-28 9:00 ` [PATCH v2 4/5] CLNT: test lock before RECLAIM_COMPLETE Mi Jinlong
2011-03-28 9:00 ` [PATCH v2 5/5] CLNT: test double RECLAIM_COMPLETE after create session Mi Jinlong
2011-04-19 22:51 ` [PATCH 0/5] a pynfs41 problem and some tests about RECLAIM_COMPLETE J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D886F71.8050001@cn.fujitsu.com \
--to=mijinlong@cn.fujitsu.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.