diff mbox

[4/4,v3] 4.1 CLNT: test RECLAIM_COMPLETE twice

Message ID 4E4C774D.1040302@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

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

Comments

J. Bruce Fields Aug. 23, 2011, 9:52 p.m. UTC | #1
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
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)