linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CLNT: add some tests for DESTROY_CLIENTID
@ 2011-10-20  8:57 Mi Jinlong
  2011-10-20  9:43 ` J. Bruce Fields
  0 siblings, 1 reply; 6+ messages in thread
From: Mi Jinlong @ 2011-10-20  8:57 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: NFS

Some tests for DESTROY_CLIENTID at pynfs41.

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

diff --git a/nfs4.1/server41tests/__init__.py b/nfs4.1/server41tests/__init__.py
index 1cc2048..eb92538 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_destroy_clientid.py",
            "st_reclaim_complete.py",
            "st_secinfo_no_name.py",
            "st_secinfo.py",
diff --git a/nfs4.1/server41tests/st_destroy_clientid.py b/nfs4.1/server41tests/st_destroy_clientid.py
new file mode 100644
index 0000000..c2ea0c7
--- /dev/null
+++ b/nfs4.1/server41tests/st_destroy_clientid.py
@@ -0,0 +1,85 @@
+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 DESTROY_CLIENTID
+       destroy an unconfirmed clientid without session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID1
+    """
+    c = env.c1.new_client(env.testname(t))
+
+    res = env.c1.compound([op.destroy_clientid(c.clientid)])
+    check(res)
+
+def testDestroyBadCIDWS(t, env):
+    """ destroy an clientid which not exist without session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID2
+    """
+    res = env.c1.compound([op.destroy_clientid(0)])
+    check(res, NFS4ERR_STALE_CLIENTID)
+
+def testDestroyBadCIDIS(t, env):
+    """ destroy an clientid which not exist in session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID3
+    """
+    c = env.c1.new_client(env.testname(t))
+    sess = c.create_session()
+
+    res = sess.compound([op.destroy_clientid(0)])
+    check(res, NFS4ERR_STALE_CLIENTID)
+
+def testDestroyCIDThisSession(t, env):
+    """ destroy clientid of itself in session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID4
+    """
+    c = env.c1.new_client(env.testname(t))
+    sess = c.create_session()
+
+    res = sess.compound([op.destroy_clientid(c.clientid)])
+    check(res, NFS4ERR_CLIENTID_BUSY)
+
+def testDestroyCIDInSession(t, env):
+    """ destroy a clientid of other session without session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID5
+    """
+    c = env.c1.new_client(env.testname(t))
+    sess = c.create_session()
+
+    res = env.c1.compound([op.destroy_clientid(c.clientid)])
+    check(res, NFS4ERR_CLIENTID_BUSY)
+
+def testDestroyCIDNotOnly(t, env):
+    """ destroy a clientid without session with other compound
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID6
+    """
+    res = env.c1.compound([op.destroy_clientid(0), op.reclaim_complete(TRUE)])
+    check(res, NFS4ERR_NOT_ONLY_OP)
+
+def testDestroyCIDTwice(t, env):
+    """ destroy a clientid without session twice
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID7
+    """
+    c = env.c1.new_client(env.testname(t))
+
+    res = env.c1.compound([op.destroy_clientid(c.clientid)])
+    check(res)
+
+    res = env.c1.compound([op.destroy_clientid(c.clientid)])
+    check(res, NFS4ERR_STALE_CLIENTID)
-- 
1.7.6



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

end of thread, other threads:[~2011-11-04 22:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20  8:57 [PATCH] CLNT: add some tests for DESTROY_CLIENTID Mi Jinlong
2011-10-20  9:43 ` J. Bruce Fields
2011-10-20 10:00   ` Mi Jinlong
2011-10-20 10:02     ` J. Bruce Fields
2011-10-20 10:14       ` [PATCH v2] " Mi Jinlong
2011-11-04 22:35         ` 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).