Skip to contentSkip to conversation

pynfs41: Add some tests for RECLAIM_COMPLETE

PATCH Superseded Mi Jinlong 2 participants 15 messages Aug 18, 2011 – Aug 26, 2011

Subsystems (2)
lore
Share & tools
lore

Mi Jinlong

author
#0 lore raw

v3 cover pynfs41: Add some tests for RECLAIM_COMPLETE

Some tests for RECLAIM_COMPLETE.

Signature · 3 lines
----
thanks
Mi Jinlong
author
#1 lore raw

PATCH v3 1/4 4.1 CLNT: add a simple test about RECLAIM_COMPLETE

---
 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
nfs4.1/server41tests/__init__.py +1 -0
index 3b4411a..1cc2048 100644
@@ -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",
nfs4.1/server41tests/st_reclaim_complete.py new file +21 -0
new file mode 100644
index 0000000..a591ef5
@@ -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)
Signature · 1 line
1.7.6
#2 lore raw

Re: [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE

Quoted 1 line · Mi Jinlong

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.

Quoted 49 lines
---
 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
nfs4.1/server41tests/__init__.py +1 -0
index 3b4411a..1cc2048 100644
@@ -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",
nfs4.1/server41tests/st_reclaim_complete.py new file +21 -0
new file mode 100644
index 0000000..a591ef5
@@ -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)
Signature · 1 line
1.7.6
author
#3 lore raw

Re: [PATCH 1/4 v3] 4.1 CLNT: add a simple test about RECLAIM_COMPLETE

J. Bruce Fields :

Quoted 5 lines · Mi Jinlong
Quoted 1 line

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

Quoted 52 lines
Quoted 50 lines
---
 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
nfs4.1/server41tests/__init__.py +1 -0
index 3b4411a..1cc2048 100644
@@ -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",
nfs4.1/server41tests/st_reclaim_complete.py new file +21 -0
new file mode 100644
index 0000000..a591ef5
@@ -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)
Signature · 1 line
1.7.6
author
#4 lore raw

PATCH v3 2/4 4.1 CLNT: test reclaims after RECLAIM_COMPLETE

In reply to Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   30 ++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +29 -1
index a591ef5..3940b7b 100644
@@ -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)
Signature · 1 line
1.7.6
#5 lore raw

Re: [PATCH 2/4 v3] 4.1 CLNT: test reclaims after RECLAIM_COMPLETE

Quoted 4 lines · Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   30 ++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

Just nits:

Quoted 21 lines
nfs4.1/server41tests/st_reclaim_complete.py +5 -1
index a591ef5..3940b7b 100644
@@ -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.

nfs4.1/server41tests/st_reclaim_complete.py def testSupported(t, env): · line 35

Quoted 10 lines
nfs4.1/server41tests/st_reclaim_complete.py +10 -0
+       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.

nfs4.1/server41tests/st_reclaim_complete.py def testSupported(t, env): · line 43

Quoted 8 lines
nfs4.1/server41tests/st_reclaim_complete.py +8 -0
+    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.

nfs4.1/server41tests/st_reclaim_complete.py def testSupported(t, env): · line 49

Quoted 6 lines
nfs4.1/server41tests/st_reclaim_complete.py +6 -0
+    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.

Quoted 4 lines
Signature · 1 line
1.7.6
author
#6 lore raw

PATCH v3 3/4 4.1 CLNT: test open before RECLAIM_COMPLETE

In reply to Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +20 -1
index 3940b7b..921d537 100644
@@ -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)
Signature · 1 line
1.7.6
#7 lore raw

Re: [PATCH 3/4 v3] 4.1 CLNT: test open before RECLAIM_COMPLETE

Quoted 1 line · Mi Jinlong

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

Looks reasonable otherwise.

--b.

Quoted 43 lines
---
 nfs4.1/server41tests/st_reclaim_complete.py |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +20 -1
index 3940b7b..921d537 100644
@@ -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)
Signature · 1 line
1.7.6
author
#8 lore raw

PATCH v3 4/4 4.1 CLNT: test RECLAIM_COMPLETE twice

In reply to Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +19 -0
index 921d537..7c9f2b8 100644
@@ -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)
Signature · 1 line
1.7.6
#9 lore raw

Re: [PATCH 4/4 v3] 4.1 CLNT: test RECLAIM_COMPLETE twice

Quoted 4 lines · Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

Looks OK.

--b.

Quoted 32 lines
nfs4.1/server41tests/st_reclaim_complete.py +19 -0
index 921d537..7c9f2b8 100644
@@ -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)
Signature · 1 line
1.7.6
author
#10 lore raw

PATCH v4 1/4 4.1 CLNT: add a simple test about RECLAIM_COMPLETE

In reply to Mi Jinlong
---
 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
nfs4.1/server41tests/__init__.py +1 -0
index 3b4411a..1cc2048 100644
@@ -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",
nfs4.1/server41tests/st_reclaim_complete.py new file +20 -0
new file mode 100644
index 0000000..bc63ed8
@@ -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)
Signature · 1 line
1.7.6
author
#11 lore raw

PATCH v4 2/4 4.1 CLNT: test reclaims after RECLAIM_COMPLETE

In reply to Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   29 ++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +28 -1
index bc63ed8..108e7b6 100644
@@ -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])
Signature · 1 line
1.7.6
author
#12 lore raw

PATCH v4 3/4 4.1 CLNT: test open before RECLAIM_COMPLETE

In reply to Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +19 -1
index 108e7b6..adb368d 100644
@@ -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)
Signature · 1 line
1.7.6
author
#13 lore raw

PATCH v4 4/4 4.1 CLNT: test RECLAIM_COMPLETE twice

In reply to Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +18 -0
index adb368d..f6baf09 100644
@@ -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)
Signature · 1 line
1.7.6
#14 lore raw

Re: [PATCH 4/4 v4] 4.1 CLNT: test RECLAIM_COMPLETE twice

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

--b.

Quoted 35 lines · Mi Jinlong
---
 nfs4.1/server41tests/st_reclaim_complete.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
nfs4.1/server41tests/st_reclaim_complete.py +18 -0
index adb368d..f6baf09 100644
@@ -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)
Signature · 1 line
1.7.6