Skip to contentSkip to conversation

CLNT: add some tests for DESTROY_CLIENTID

PATCH Superseded Mi Jinlong 2 participants 6 messages Oct 20, 2011 – Nov 4, 2011

Subsystems (2)
lore
Share & tools
lore

Mi Jinlong

author
#0 lore raw

PATCH 1/1 CLNT: add some tests for DESTROY_CLIENTID

Some tests for DESTROY_CLIENTID at pynfs41.

---
 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
nfs4.1/server41tests/__init__.py +1 -0
index 1cc2048..eb92538 100644
@@ -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",
nfs4.1/server41tests/st_destroy_clientid.py new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
1.7.6
#1 lore raw
Quoted 37 lines · Mi Jinlong

Some tests for DESTROY_CLIENTID at pynfs41.

---
 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
nfs4.1/server41tests/__init__.py +1 -0
index 1cc2048..eb92538 100644
@@ -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",
nfs4.1/server41tests/st_destroy_clientid.py new file +10 -0
new file mode 100644
index 0000000..c2ea0c7
@@ -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
+

nfs4.1/server41tests/st_destroy_clientid.py line 20

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

s/an clientid which non exist/a nonexistant clientid/

nfs4.1/server41tests/st_destroy_clientid.py line 29

Quoted 9 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +9 -0
+
+    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

Ditto.

nfs4.1/server41tests/st_destroy_clientid.py line 41

Quoted 12 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +12 -0
+
+    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

I'd say "destroy clientid using a session belong to that client".

These look OK otherwise, thanks!

There's just one other test I'd suggest: it would be useful to check that the clientid has actually been destroyed. So, destroy the clientid, then try using it somehow (maybe by sending a create session? Or just trying to use a session that belonged to that client?).

--b.

Quoted 48 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +44 -0
+
+    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)
Signature · 1 line
1.7.6
author
#2 lore raw

J. Bruce Fields:

Quoted 42 lines · Mi Jinlong
Quoted 41 lines

Some tests for DESTROY_CLIENTID at pynfs41.

---
 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
nfs4.1/server41tests/__init__.py +1 -0
index 1cc2048..eb92538 100644
@@ -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",
nfs4.1/server41tests/st_destroy_clientid.py new file +14 -0
new file mode 100644
index 0000000..c2ea0c7
@@ -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))
Quoted 8 lines

nfs4.1/server41tests/st_destroy_clientid.py line 20

Quoted 6 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +6 -0
+
+    res = env.c1.compound([op.destroy_clientid(c.clientid)])
+    check(res)
+
+def testDestroyBadCIDWS(t, env):
+    """ destroy an clientid which not exist without session

s/an clientid which non exist/a nonexistant clientid/

Got it.

Quoted 13 lines

nfs4.1/server41tests/st_destroy_clientid.py line 29

Quoted 10 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +9 -0
+
+    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

Ditto.

Quoted 14 lines

nfs4.1/server41tests/st_destroy_clientid.py line 41

Quoted 12 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +12 -0
+
+    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

I'd say "destroy clientid using a session belong to that client".

Got it, thanks.

Quoted 7 lines

These look OK otherwise, thanks!

There's just one other test I'd suggest: it would be useful to check that the clientid has actually been destroyed. So, destroy the clientid, then try using it somehow (maybe by sending a create session? Or just trying to use a session that belonged to that client?).

I think Case DESCID7 is what you said.

thanks,
Mi Jinlong

Quoted 57 lines

--b.

Quoted 48 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +44 -0
+
+    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)
Signature · 1 line
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
----
thanks
Mi Jinlong
#3 lore raw
Quoted 9 lines · Mi Jinlong

J. Bruce Fields:

Quoted 4 lines

There's just one other test I'd suggest: it would be useful to check that the clientid has actually been destroyed. So, destroy the clientid, then try using it somehow (maybe by sending a create session? Or just trying to use a session that belonged to that client?).

I think Case DESCID7 is what you said.

Whoops, you're right, I missed it.

--b.

Quoted 67 lines

thanks,
Mi Jinlong

Quoted 57 lines

--b.

Quoted 48 lines
nfs4.1/server41tests/st_destroy_clientid.py new file +44 -0
+
+    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)
Signature · 1 line
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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

PATCH v2 1/1 CLNT: add some tests for DESTROY_CLIENTID

Some tests for DESTROY_CLIENTID at pynfs41.

---
 nfs4.1/server41tests/__init__.py            |    1 +
 nfs4.1/server41tests/st_destroy_clientid.py |   98 +++++++++++++++++++++++++++
 2 files changed, 99 insertions(+), 0 deletions(-)
 create mode 100644 nfs4.1/server41tests/st_destroy_clientid.py
nfs4.1/server41tests/__init__.py +1 -0
index 1cc2048..eb92538 100644
@@ -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",
nfs4.1/server41tests/st_destroy_clientid.py new file +98 -0

98 lines not on this page · raw message

Signature · 1 line
1.7.6
#5 lore raw
Quoted 1 line · Mi Jinlong

Some tests for DESTROY_CLIENTID at pynfs41.

Thanks, applied.

(Nit: you use the same description ("add some tests for DESTROY_CLIENTID") on both the subject line and in the body of the email. It would be better to use the body for additional detail, or just leave it blank if you don't have any.)

--b.

Quoted 128 lines
---
 nfs4.1/server41tests/__init__.py            |    1 +
 nfs4.1/server41tests/st_destroy_clientid.py |   98 +++++++++++++++++++++++++++
 2 files changed, 99 insertions(+), 0 deletions(-)
 create mode 100644 nfs4.1/server41tests/st_destroy_clientid.py
nfs4.1/server41tests/__init__.py +1 -0
index 1cc2048..eb92538 100644
@@ -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",
nfs4.1/server41tests/st_destroy_clientid.py new file +98 -0
new file mode 100644
index 0000000..1b193cf
@@ -0,0 +1,98 @@
+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 testDestroyCIDWS(t, env):
+    """ destroy an unconfirmed clientid with session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID2
+    """
+    c1 = env.c1.new_client("%s_1" % env.testname(t))
+    c2 = env.c1.new_client("%s_2" % env.testname(t))
+    sess = c1.create_session()
+
+    res = sess.compound([op.destroy_clientid(c2.clientid)])
+    check(res)
+
+def testDestroyBadCIDWS(t, env):
+    """ destroy a nonexistant clientid without session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID3
+    """
+    res = env.c1.compound([op.destroy_clientid(0)])
+    check(res, NFS4ERR_STALE_CLIENTID)
+
+def testDestroyBadCIDIS(t, env):
+    """ destroy a nonexistant clientid 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(0)])
+    check(res, NFS4ERR_STALE_CLIENTID)
+
+def testDestroyCIDSessionB(t, env):
+    """ destroy clientid using a session belong to that client
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID5
+    """
+    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 testDestroyCIDCSession(t, env):
+    """ destroy a clientid which contains session without session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID6
+    """
+    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: DESCID7
+    """
+    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 twice without session
+
+    FLAGS: destroy_clientid all
+    CODE: DESCID8
+    """
+    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)
Signature · 1 line
1.7.6