linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE
@ 2011-08-18  2:18 Mi Jinlong
  2011-08-18  2:19 ` [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Mi Jinlong @ 2011-08-18  2:18 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

Some tests for RECLAIM_COMPLETE.

-- 
----
thanks
Mi Jinlong


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-18  2:19 ` Mi Jinlong
  2011-08-23 21:43   ` J. Bruce Fields
  2011-08-18  2:20 ` [PATCH 2/4 v3] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE Mi Jinlong
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Mi Jinlong @ 2011-08-18  2:19 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
 nfs4.1/server41tests/__init__.py            |    1 +
 nfs4.1/server41tests/st_reclaim_complete.py |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 nfs4.1/server41tests/st_reclaim_complete.py

diff --git a/nfs4.1/server41tests/__init__.py b/nfs4.1/server41tests/__init__.py
index 3b4411a..1cc2048 100644
--- a/nfs4.1/server41tests/__init__.py
+++ b/nfs4.1/server41tests/__init__.py
@@ -2,6 +2,7 @@ __all__ = ["st_exchange_id.py", # draft 21
            "st_compound.py",
            "st_create_session.py",
            "st_destroy_session.py",
+           "st_reclaim_complete.py",
            "st_secinfo_no_name.py",
            "st_secinfo.py",
            "st_sequence.py",
diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
new file mode 100644
index 0000000..a591ef5
--- /dev/null
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -0,0 +1,21 @@
+from st_create_session import create_session
+from nfs4_const import *
+from environment import check, fail
+import nfs4_ops as op
+import nfs4lib
+
+def testSupported(t, env):
+    """Do a simple RECLAIM_COMPLETE
+
+    FLAGS: reclaim_complete all
+    CODE: RECC1
+    """
+    c = env.c1.new_client(env.testname(t))
+    sess = c.create_session()
+
+    # RECLAIM_COMPLETE
+    res = sess.compound([op.putrootfh(), op.reclaim_complete(TRUE)])
+    check(res)
+
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res)
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/4 v3] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
  2011-08-18  2:19 ` [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-18  2:20 ` Mi Jinlong
  2011-08-23 21:50   ` J. Bruce Fields
  2011-08-18  2:21 ` [PATCH 3/4 v3] 4.1 CLNT: test open before RECLAIM_COMPLETE Mi Jinlong
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Mi Jinlong @ 2011-08-18  2:20 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

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

diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
index a591ef5..3940b7b 100644
--- a/nfs4.1/server41tests/st_reclaim_complete.py
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -1,6 +1,6 @@
 from st_create_session import create_session
 from nfs4_const import *
-from environment import check, fail
+from environment import check, fail, open_file, create_confirm
 import nfs4_ops as op
 import nfs4lib
 
@@ -19,3 +19,31 @@ def testSupported(t, env):
 
     res = sess.compound([op.reclaim_complete(FALSE)])
     check(res)
+
+def testReclaimAfterRECC(t, env):
+    """If client does subsequent reclaims of locking state after
+       RECLAIM_COMPLETE is done, server will return NFS4ERR_NO_GRACE.
+       rfc5661 18.51.3
+
+    FLAGS: reclaim_complete all
+    CODE: RECC2
+    """
+    name = env.testname(t)
+    c = env.c1.new_client(name)
+    sess = c.create_session()
+
+    # RECLAIM_COMPLETE
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res)
+
+    owner = "owner_%s" % name
+    path = sess.c.homedir + [name]
+    fh, stateid = create_confirm(sess, owner)
+
+    # Try to reclaims after RECLAIM_COMPLETE
+    res = open_file(sess, owner, path=fh, claim_type=CLAIM_PREVIOUS,
+                    access=OPEN4_SHARE_ACCESS_BOTH,
+                    deny=OPEN4_SHARE_DENY_NONE,
+                    deleg_type=OPEN_DELEGATE_NONE)
+
+    check(res,NFS4ERR_NO_GRACE)
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/4 v3] 4.1 CLNT: test open before RECLAIM_COMPLETE
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
  2011-08-18  2:19 ` [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
  2011-08-18  2:20 ` [PATCH 2/4 v3] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-18  2:21 ` Mi Jinlong
  2011-08-23 21:51   ` J. Bruce Fields
  2011-08-18  2:22 ` [PATCH 4/4 v3] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Mi Jinlong @ 2011-08-18  2:21 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

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

diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
index 3940b7b..921d537 100644
--- a/nfs4.1/server41tests/st_reclaim_complete.py
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -1,6 +1,6 @@
 from st_create_session import create_session
 from nfs4_const import *
-from environment import check, fail, open_file, create_confirm
+from environment import check, fail, open_file, create_file, create_confirm
 import nfs4_ops as op
 import nfs4lib
 
@@ -47,3 +47,22 @@ def testReclaimAfterRECC(t, env):
                     deleg_type=OPEN_DELEGATE_NONE)
 
     check(res,NFS4ERR_NO_GRACE)
+
+def testOpenBeforeRECC(t, env):
+    """After a client establishes a new client ID, if non-reclaim
+       locking operations are done before the RECLAIM_COMPLETE,
+       error NFS4ERR_GRACE will be returned. rfc5661 18.51.3
+
+    FLAGS: reclaim_complete all
+    CODE: RECC3
+    """
+    name = env.testname(t)
+    c = env.c1.new_client(name)
+    sess = c.create_session()
+
+    fname = "owner_%s" % name
+    path = sess.c.homedir + [name]
+
+    # Try to open file before RECLAIM_COMPLETE
+    res = create_file(sess, fname, path, access=OPEN4_SHARE_ACCESS_BOTH)
+    check(res,NFS4ERR_GRACE)
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/4 v3] 4.1 CLNT: test RECLAIM_COMPLETE twice
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
                   ` (2 preceding siblings ...)
  2011-08-18  2:21 ` [PATCH 3/4 v3] 4.1 CLNT: test open before RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-18  2:22 ` Mi Jinlong
  2011-08-23 21:52   ` J. Bruce Fields
  2011-08-24  8:53 ` [PATCH 1/4 v4] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Mi Jinlong @ 2011-08-18  2:22 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

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

diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
index 921d537..7c9f2b8 100644
--- a/nfs4.1/server41tests/st_reclaim_complete.py
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -66,3 +66,22 @@ def testOpenBeforeRECC(t, env):
     # Try to open file before RECLAIM_COMPLETE
     res = create_file(sess, fname, path, access=OPEN4_SHARE_ACCESS_BOTH)
     check(res,NFS4ERR_GRACE)
+
+def testDoubleRECC(t, env):
+    """If RECLAIM_COMPLETE is done a second time, error
+       NFS4ERR_COMPLETE_ALREADY will be returned. rfc5661 18.51.4
+
+    FLAGS: reclaim_complete all
+    CODE: RECC4
+    """
+    name = env.testname(t)
+    c = env.c1.new_client(name)
+    sess = c.create_session()
+
+    # RECLAIM_COMPLETE
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res)
+
+    # RECLAIM_COMPLETE again
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res, NFS4ERR_COMPLETE_ALREADY)
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE
  2011-08-18  2:19 ` [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-23 21:43   ` J. Bruce Fields
  2011-08-24  8:26     ` Mi Jinlong
  0 siblings, 1 reply; 15+ messages in thread
From: J. Bruce Fields @ 2011-08-23 21:43 UTC (permalink / raw)
  To: Mi Jinlong; +Cc: NFS

On Thu, Aug 18, 2011 at 10:19:50AM +0800, Mi Jinlong wrote:
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>

Is it even possible to run this test without an earlier RECLAIM_COMPLETE
failing?  I guess so, if you just run this one test without --maketree.

OK.

--b.

> ---
>  nfs4.1/server41tests/__init__.py            |    1 +
>  nfs4.1/server41tests/st_reclaim_complete.py |   21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+), 0 deletions(-)
>  create mode 100644 nfs4.1/server41tests/st_reclaim_complete.py
> 
> diff --git a/nfs4.1/server41tests/__init__.py b/nfs4.1/server41tests/__init__.py
> index 3b4411a..1cc2048 100644
> --- a/nfs4.1/server41tests/__init__.py
> +++ b/nfs4.1/server41tests/__init__.py
> @@ -2,6 +2,7 @@ __all__ = ["st_exchange_id.py", # draft 21
>             "st_compound.py",
>             "st_create_session.py",
>             "st_destroy_session.py",
> +           "st_reclaim_complete.py",
>             "st_secinfo_no_name.py",
>             "st_secinfo.py",
>             "st_sequence.py",
> diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
> new file mode 100644
> index 0000000..a591ef5
> --- /dev/null
> +++ b/nfs4.1/server41tests/st_reclaim_complete.py
> @@ -0,0 +1,21 @@
> +from st_create_session import create_session
> +from nfs4_const import *
> +from environment import check, fail
> +import nfs4_ops as op
> +import nfs4lib
> +
> +def testSupported(t, env):
> +    """Do a simple RECLAIM_COMPLETE
> +
> +    FLAGS: reclaim_complete all
> +    CODE: RECC1
> +    """
> +    c = env.c1.new_client(env.testname(t))
> +    sess = c.create_session()
> +
> +    # RECLAIM_COMPLETE
> +    res = sess.compound([op.putrootfh(), op.reclaim_complete(TRUE)])
> +    check(res)
> +
> +    res = sess.compound([op.reclaim_complete(FALSE)])
> +    check(res)
> -- 
> 1.7.6
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/4 v3] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE
  2011-08-18  2:20 ` [PATCH 2/4 v3] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-23 21:50   ` J. Bruce Fields
  0 siblings, 0 replies; 15+ messages in thread
From: J. Bruce Fields @ 2011-08-23 21:50 UTC (permalink / raw)
  To: Mi Jinlong; +Cc: NFS

On Thu, Aug 18, 2011 at 10:20:40AM +0800, Mi Jinlong wrote:
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> ---
>  nfs4.1/server41tests/st_reclaim_complete.py |   30 ++++++++++++++++++++++++++-
>  1 files changed, 29 insertions(+), 1 deletions(-)

Just nits:

> 
> diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
> index a591ef5..3940b7b 100644
> --- a/nfs4.1/server41tests/st_reclaim_complete.py
> +++ b/nfs4.1/server41tests/st_reclaim_complete.py
> @@ -1,6 +1,6 @@
>  from st_create_session import create_session
>  from nfs4_const import *
> -from environment import check, fail
> +from environment import check, fail, open_file, create_confirm
>  import nfs4_ops as op
>  import nfs4lib
>  
> @@ -19,3 +19,31 @@ def testSupported(t, env):
>  
>      res = sess.compound([op.reclaim_complete(FALSE)])
>      check(res)
> +
> +def testReclaimAfterRECC(t, env):
> +    """If client does subsequent reclaims of locking state after
> +       RECLAIM_COMPLETE is done, server will return NFS4ERR_NO_GRACE.
> +       rfc5661 18.51.3
> +
> +    FLAGS: reclaim_complete all
> +    CODE: RECC2
> +    """
> +    name = env.testname(t)
> +    c = env.c1.new_client(name)
> +    sess = c.create_session()
> +
> +    # RECLAIM_COMPLETE

This comment doesn't explain anything not already obvious from the code.

> +    res = sess.compound([op.reclaim_complete(FALSE)])
> +    check(res)
> +
> +    owner = "owner_%s" % name
> +    path = sess.c.homedir + [name]
> +    fh, stateid = create_confirm(sess, owner)
> +
> +    # Try to reclaims after RECLAIM_COMPLETE

Ditto.

> +    res = open_file(sess, owner, path=fh, claim_type=CLAIM_PREVIOUS,
> +                    access=OPEN4_SHARE_ACCESS_BOTH,
> +                    deny=OPEN4_SHARE_DENY_NONE,
> +                    deleg_type=OPEN_DELEGATE_NONE)
> +
> +    check(res,NFS4ERR_NO_GRACE)

Make the "," a ", ".

Also: in this case:

	- the file we're trying to open doesn't exist
	- the client we just created probably isn't allowed to reclaim

So NFS4ERR_EXIST and NFS4ERR_RECLAIM_BAD are probably both legal error
returns as well.  I don't think the spec mandates that these be checked
in any particular order.

--b.

> -- 
> 1.7.6
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4 v3] 4.1 CLNT: test open before RECLAIM_COMPLETE
  2011-08-18  2:21 ` [PATCH 3/4 v3] 4.1 CLNT: test open before RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-23 21:51   ` J. Bruce Fields
  0 siblings, 0 replies; 15+ messages in thread
From: J. Bruce Fields @ 2011-08-23 21:51 UTC (permalink / raw)
  To: Mi Jinlong; +Cc: NFS

On Thu, Aug 18, 2011 at 10:21:15AM +0800, Mi Jinlong wrote:
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>

Same nits as previous ones (comments mostly repeat what the code says,
space needed after comma between function arguments).

Looks reasonable otherwise.

--b.

> ---
>  nfs4.1/server41tests/st_reclaim_complete.py |   21 ++++++++++++++++++++-
>  1 files changed, 20 insertions(+), 1 deletions(-)
> 
> diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
> index 3940b7b..921d537 100644
> --- a/nfs4.1/server41tests/st_reclaim_complete.py
> +++ b/nfs4.1/server41tests/st_reclaim_complete.py
> @@ -1,6 +1,6 @@
>  from st_create_session import create_session
>  from nfs4_const import *
> -from environment import check, fail, open_file, create_confirm
> +from environment import check, fail, open_file, create_file, create_confirm
>  import nfs4_ops as op
>  import nfs4lib
>  
> @@ -47,3 +47,22 @@ def testReclaimAfterRECC(t, env):
>                      deleg_type=OPEN_DELEGATE_NONE)
>  
>      check(res,NFS4ERR_NO_GRACE)
> +
> +def testOpenBeforeRECC(t, env):
> +    """After a client establishes a new client ID, if non-reclaim
> +       locking operations are done before the RECLAIM_COMPLETE,
> +       error NFS4ERR_GRACE will be returned. rfc5661 18.51.3
> +
> +    FLAGS: reclaim_complete all
> +    CODE: RECC3
> +    """
> +    name = env.testname(t)
> +    c = env.c1.new_client(name)
> +    sess = c.create_session()
> +
> +    fname = "owner_%s" % name
> +    path = sess.c.homedir + [name]
> +
> +    # Try to open file before RECLAIM_COMPLETE
> +    res = create_file(sess, fname, path, access=OPEN4_SHARE_ACCESS_BOTH)
> +    check(res,NFS4ERR_GRACE)
> -- 
> 1.7.6
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4 v3] 4.1 CLNT: test RECLAIM_COMPLETE twice
  2011-08-18  2:22 ` [PATCH 4/4 v3] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
@ 2011-08-23 21:52   ` J. Bruce Fields
  0 siblings, 0 replies; 15+ messages in thread
From: J. Bruce Fields @ 2011-08-23 21:52 UTC (permalink / raw)
  To: Mi Jinlong; +Cc: NFS

On Thu, Aug 18, 2011 at 10:22:05AM +0800, Mi Jinlong wrote:
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> ---
>  nfs4.1/server41tests/st_reclaim_complete.py |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)

Looks OK.

--b.

> 
> diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
> index 921d537..7c9f2b8 100644
> --- a/nfs4.1/server41tests/st_reclaim_complete.py
> +++ b/nfs4.1/server41tests/st_reclaim_complete.py
> @@ -66,3 +66,22 @@ def testOpenBeforeRECC(t, env):
>      # Try to open file before RECLAIM_COMPLETE
>      res = create_file(sess, fname, path, access=OPEN4_SHARE_ACCESS_BOTH)
>      check(res,NFS4ERR_GRACE)
> +
> +def testDoubleRECC(t, env):
> +    """If RECLAIM_COMPLETE is done a second time, error
> +       NFS4ERR_COMPLETE_ALREADY will be returned. rfc5661 18.51.4
> +
> +    FLAGS: reclaim_complete all
> +    CODE: RECC4
> +    """
> +    name = env.testname(t)
> +    c = env.c1.new_client(name)
> +    sess = c.create_session()
> +
> +    # RECLAIM_COMPLETE
> +    res = sess.compound([op.reclaim_complete(FALSE)])
> +    check(res)
> +
> +    # RECLAIM_COMPLETE again
> +    res = sess.compound([op.reclaim_complete(FALSE)])
> +    check(res, NFS4ERR_COMPLETE_ALREADY)
> -- 
> 1.7.6
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE
  2011-08-23 21:43   ` J. Bruce Fields
@ 2011-08-24  8:26     ` Mi Jinlong
  0 siblings, 0 replies; 15+ messages in thread
From: Mi Jinlong @ 2011-08-24  8:26 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: NFS



J. Bruce Fields :
> On Thu, Aug 18, 2011 at 10:19:50AM +0800, Mi Jinlong wrote:
>> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> 
> Is it even possible to run this test without an earlier RECLAIM_COMPLETE
> failing?  I guess so, if you just run this one test without --maketree.

  NO, it's OK. As:

   ]# ./testserver.py --outfile=first.log 127.0.0.1:/ RECC1
     INFO   :rpc.poll:got connection from ('127.0.0.1', 52268), assigned to fd=5
     INFO   :rpc.thread:Called connect(('127.0.0.1', 2049))
     INFO   :rpc.poll:Adding 6 generated by another thread
     INFO   :test.env:Created client to 127.0.0.1, 2049
     INFO   :nfs.client.cb:********************
     INFO   :nfs.client.cb:Handling CB_NULL
     INFO   :test.env:Called do_readdir()
     INFO   :test.env:do_readdir() = []
     INFO   :nfs.client.cb:********************
     INFO   :nfs.client.cb:Handling CB_NULL
     **************************************************
     RECC1    st_reclaim_complete.testSupported                        : PASS
     **************************************************
     Command line asked for 1 of 165 tests
     Of those: 0 Skipped, 0 Failed, 0 Warned, 1 Passed

thanks,
Mi Jinlong

> 
>> ---
>>  nfs4.1/server41tests/__init__.py            |    1 +
>>  nfs4.1/server41tests/st_reclaim_complete.py |   21 +++++++++++++++++++++
>>  2 files changed, 22 insertions(+), 0 deletions(-)
>>  create mode 100644 nfs4.1/server41tests/st_reclaim_complete.py
>>
>> diff --git a/nfs4.1/server41tests/__init__.py b/nfs4.1/server41tests/__init__.py
>> index 3b4411a..1cc2048 100644
>> --- a/nfs4.1/server41tests/__init__.py
>> +++ b/nfs4.1/server41tests/__init__.py
>> @@ -2,6 +2,7 @@ __all__ = ["st_exchange_id.py", # draft 21
>>             "st_compound.py",
>>             "st_create_session.py",
>>             "st_destroy_session.py",
>> +           "st_reclaim_complete.py",
>>             "st_secinfo_no_name.py",
>>             "st_secinfo.py",
>>             "st_sequence.py",
>> diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
>> new file mode 100644
>> index 0000000..a591ef5
>> --- /dev/null
>> +++ b/nfs4.1/server41tests/st_reclaim_complete.py
>> @@ -0,0 +1,21 @@
>> +from st_create_session import create_session
>> +from nfs4_const import *
>> +from environment import check, fail
>> +import nfs4_ops as op
>> +import nfs4lib
>> +
>> +def testSupported(t, env):
>> +    """Do a simple RECLAIM_COMPLETE
>> +
>> +    FLAGS: reclaim_complete all
>> +    CODE: RECC1
>> +    """
>> +    c = env.c1.new_client(env.testname(t))
>> +    sess = c.create_session()
>> +
>> +    # RECLAIM_COMPLETE
>> +    res = sess.compound([op.putrootfh(), op.reclaim_complete(TRUE)])
>> +    check(res)
>> +
>> +    res = sess.compound([op.reclaim_complete(FALSE)])
>> +    check(res)
>> -- 
>> 1.7.6
>>
>>
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/4 v4] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
                   ` (3 preceding siblings ...)
  2011-08-18  2:22 ` [PATCH 4/4 v3] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
@ 2011-08-24  8:53 ` Mi Jinlong
  2011-08-24  8:53 ` [PATCH 2/4 v4] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE Mi Jinlong
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Mi Jinlong @ 2011-08-24  8:53 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
 nfs4.1/server41tests/__init__.py            |    1 +
 nfs4.1/server41tests/st_reclaim_complete.py |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 nfs4.1/server41tests/st_reclaim_complete.py

diff --git a/nfs4.1/server41tests/__init__.py b/nfs4.1/server41tests/__init__.py
index 3b4411a..1cc2048 100644
--- a/nfs4.1/server41tests/__init__.py
+++ b/nfs4.1/server41tests/__init__.py
@@ -2,6 +2,7 @@ __all__ = ["st_exchange_id.py", # draft 21
            "st_compound.py",
            "st_create_session.py",
            "st_destroy_session.py",
+           "st_reclaim_complete.py",
            "st_secinfo_no_name.py",
            "st_secinfo.py",
            "st_sequence.py",
diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
new file mode 100644
index 0000000..bc63ed8
--- /dev/null
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -0,0 +1,20 @@
+from st_create_session import create_session
+from nfs4_const import *
+from environment import check, fail
+import nfs4_ops as op
+import nfs4lib
+
+def testSupported(t, env):
+    """Do a simple RECLAIM_COMPLETE
+
+    FLAGS: reclaim_complete all
+    CODE: RECC1
+    """
+    c = env.c1.new_client(env.testname(t))
+    sess = c.create_session()
+
+    res = sess.compound([op.putrootfh(), op.reclaim_complete(TRUE)])
+    check(res)
+
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res)
-- 
1.7.6




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/4 v4] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
                   ` (4 preceding siblings ...)
  2011-08-24  8:53 ` [PATCH 1/4 v4] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-24  8:53 ` Mi Jinlong
  2011-08-24  8:54 ` [PATCH 3/4 v4] 4.1 CLNT: test open before RECLAIM_COMPLETE Mi Jinlong
  2011-08-24  8:54 ` [PATCH 4/4 v4] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
  7 siblings, 0 replies; 15+ messages in thread
From: Mi Jinlong @ 2011-08-24  8:53 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

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

diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
index bc63ed8..108e7b6 100644
--- a/nfs4.1/server41tests/st_reclaim_complete.py
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -1,6 +1,6 @@
 from st_create_session import create_session
 from nfs4_const import *
-from environment import check, fail
+from environment import check, fail, open_file, create_confirm
 import nfs4_ops as op
 import nfs4lib
 
@@ -18,3 +18,30 @@ def testSupported(t, env):
 
     res = sess.compound([op.reclaim_complete(FALSE)])
     check(res)
+
+def testReclaimAfterRECC(t, env):
+    """If client does subsequent reclaims of locking state after
+       RECLAIM_COMPLETE is done, server will return NFS4ERR_NO_GRACE.
+       rfc5661 18.51.3
+
+    FLAGS: reclaim_complete all
+    CODE: RECC2
+    """
+    name = env.testname(t)
+    c = env.c1.new_client(name)
+    sess = c.create_session()
+
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res)
+
+    owner = "owner_%s" % name
+    path = sess.c.homedir + [name]
+    fh, stateid = create_confirm(sess, owner)
+
+    # Try to reclaims a file which is noexist after RECLAIM_COMPLETE
+    res = open_file(sess, owner, path=fh, claim_type=CLAIM_PREVIOUS,
+                    access=OPEN4_SHARE_ACCESS_BOTH,
+                    deny=OPEN4_SHARE_DENY_NONE,
+                    deleg_type=OPEN_DELEGATE_NONE)
+
+    check(res, NFS4ERR_NO_GRACE, warnlist = [NFS4ERR_EXIST | NFS4ERR_RECLAIM_BAD])
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/4 v4] 4.1 CLNT: test open before RECLAIM_COMPLETE
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
                   ` (5 preceding siblings ...)
  2011-08-24  8:53 ` [PATCH 2/4 v4] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-24  8:54 ` Mi Jinlong
  2011-08-24  8:54 ` [PATCH 4/4 v4] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
  7 siblings, 0 replies; 15+ messages in thread
From: Mi Jinlong @ 2011-08-24  8:54 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

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

diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
index 108e7b6..adb368d 100644
--- a/nfs4.1/server41tests/st_reclaim_complete.py
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -1,6 +1,6 @@
 from st_create_session import create_session
 from nfs4_const import *
-from environment import check, fail, open_file, create_confirm
+from environment import check, fail, open_file, create_file, create_confirm
 import nfs4_ops as op
 import nfs4lib
 
@@ -45,3 +45,21 @@ def testReclaimAfterRECC(t, env):
                     deleg_type=OPEN_DELEGATE_NONE)
 
     check(res, NFS4ERR_NO_GRACE, warnlist = [NFS4ERR_EXIST | NFS4ERR_RECLAIM_BAD])
+
+def testOpenBeforeRECC(t, env):
+    """After a client establishes a new client ID, if non-reclaim
+       locking operations are done before the RECLAIM_COMPLETE,
+       error NFS4ERR_GRACE will be returned. rfc5661 18.51.3
+
+    FLAGS: reclaim_complete all
+    CODE: RECC3
+    """
+    name = env.testname(t)
+    c = env.c1.new_client(name)
+    sess = c.create_session()
+
+    fname = "owner_%s" % name
+    path = sess.c.homedir + [name]
+
+    res = create_file(sess, fname, path, access=OPEN4_SHARE_ACCESS_BOTH)
+    check(res, NFS4ERR_GRACE)
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/4 v4] 4.1 CLNT: test RECLAIM_COMPLETE twice
  2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
                   ` (6 preceding siblings ...)
  2011-08-24  8:54 ` [PATCH 3/4 v4] 4.1 CLNT: test open before RECLAIM_COMPLETE Mi Jinlong
@ 2011-08-24  8:54 ` Mi Jinlong
  2011-08-26 22:41   ` J. Bruce Fields
  7 siblings, 1 reply; 15+ messages in thread
From: Mi Jinlong @ 2011-08-24  8:54 UTC (permalink / raw)
  To: J. Bruce Fields, NFS

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

diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
index adb368d..f6baf09 100644
--- a/nfs4.1/server41tests/st_reclaim_complete.py
+++ b/nfs4.1/server41tests/st_reclaim_complete.py
@@ -63,3 +63,21 @@ def testOpenBeforeRECC(t, env):
 
     res = create_file(sess, fname, path, access=OPEN4_SHARE_ACCESS_BOTH)
     check(res, NFS4ERR_GRACE)
+
+def testDoubleRECC(t, env):
+    """If RECLAIM_COMPLETE is done a second time, error
+       NFS4ERR_COMPLETE_ALREADY will be returned. rfc5661 18.51.4
+
+    FLAGS: reclaim_complete all
+    CODE: RECC4
+    """
+    name = env.testname(t)
+    c = env.c1.new_client(name)
+    sess = c.create_session()
+
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res)
+
+    # RECLAIM_COMPLETE again
+    res = sess.compound([op.reclaim_complete(FALSE)])
+    check(res, NFS4ERR_COMPLETE_ALREADY)
-- 
1.7.6



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/4 v4] 4.1 CLNT: test RECLAIM_COMPLETE twice
  2011-08-24  8:54 ` [PATCH 4/4 v4] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
@ 2011-08-26 22:41   ` J. Bruce Fields
  0 siblings, 0 replies; 15+ messages in thread
From: J. Bruce Fields @ 2011-08-26 22:41 UTC (permalink / raw)
  To: Mi Jinlong; +Cc: NFS

Thanks, these four look OK; I'll run a quick test and then push them out
to my repository.

--b.

On Wed, Aug 24, 2011 at 04:54:13PM +0800, Mi Jinlong wrote:
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> ---
>  nfs4.1/server41tests/st_reclaim_complete.py |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/nfs4.1/server41tests/st_reclaim_complete.py b/nfs4.1/server41tests/st_reclaim_complete.py
> index adb368d..f6baf09 100644
> --- a/nfs4.1/server41tests/st_reclaim_complete.py
> +++ b/nfs4.1/server41tests/st_reclaim_complete.py
> @@ -63,3 +63,21 @@ def testOpenBeforeRECC(t, env):
>  
>      res = create_file(sess, fname, path, access=OPEN4_SHARE_ACCESS_BOTH)
>      check(res, NFS4ERR_GRACE)
> +
> +def testDoubleRECC(t, env):
> +    """If RECLAIM_COMPLETE is done a second time, error
> +       NFS4ERR_COMPLETE_ALREADY will be returned. rfc5661 18.51.4
> +
> +    FLAGS: reclaim_complete all
> +    CODE: RECC4
> +    """
> +    name = env.testname(t)
> +    c = env.c1.new_client(name)
> +    sess = c.create_session()
> +
> +    res = sess.compound([op.reclaim_complete(FALSE)])
> +    check(res)
> +
> +    # RECLAIM_COMPLETE again
> +    res = sess.compound([op.reclaim_complete(FALSE)])
> +    check(res, NFS4ERR_COMPLETE_ALREADY)
> -- 
> 1.7.6
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-08-26 22:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-18  2:18 [PATCH 0/4 v3] pynfs41: Add some tests for RECLAIM_COMPLETE Mi Jinlong
2011-08-18  2:19 ` [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
2011-08-23 21:43   ` J. Bruce Fields
2011-08-24  8:26     ` Mi Jinlong
2011-08-18  2:20 ` [PATCH 2/4 v3] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE Mi Jinlong
2011-08-23 21:50   ` J. Bruce Fields
2011-08-18  2:21 ` [PATCH 3/4 v3] 4.1 CLNT: test open before RECLAIM_COMPLETE Mi Jinlong
2011-08-23 21:51   ` J. Bruce Fields
2011-08-18  2:22 ` [PATCH 4/4 v3] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
2011-08-23 21:52   ` J. Bruce Fields
2011-08-24  8:53 ` [PATCH 1/4 v4] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE Mi Jinlong
2011-08-24  8:53 ` [PATCH 2/4 v4] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE Mi Jinlong
2011-08-24  8:54 ` [PATCH 3/4 v4] 4.1 CLNT: test open before RECLAIM_COMPLETE Mi Jinlong
2011-08-24  8:54 ` [PATCH 4/4 v4] 4.1 CLNT: test RECLAIM_COMPLETE twice Mi Jinlong
2011-08-26 22:41   ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).