All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] create open requests without executing
@ 2011-12-09 12:58 Tigran Mkrtchyan
  2011-12-09 12:58 ` [PATCH v2 2/2] client: add open+close test with current stateid Tigran Mkrtchyan
  0 siblings, 1 reply; 3+ messages in thread
From: Tigran Mkrtchyan @ 2011-12-09 12:58 UTC (permalink / raw)
  To: linux-nfs; +Cc: Tigran Mkrtchyan


Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
 nfs4.1/server41tests/environment.py |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index 6e68e83..45ceef1 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -453,6 +453,21 @@ def open_create_file(sess, owner, path=None, attrs={FATTR4_MODE: 0644},
 		     deleg_type=None,
 		     open_create=OPEN4_NOCREATE,
 		     seqid=0, clientid=0):
+    open_op = open_create_file_op (sess, owner, path, attrs, access, deny, mode,
+                            verifier, claim_type, want_deleg, deleg_type,
+                            open_create, seqid, clientid)
+
+    return sess.compound(open_op)
+
+def open_create_file_op(sess, owner, path=None, attrs={FATTR4_MODE: 0644},
+                     access=OPEN4_SHARE_ACCESS_BOTH,
+                     deny=OPEN4_SHARE_DENY_NONE,
+		     mode=GUARDED4, verifier=None,
+		     claim_type=CLAIM_NULL,
+		     want_deleg=False,
+		     deleg_type=None,
+		     open_create=OPEN4_NOCREATE,
+		     seqid=0, clientid=0):
     # Set defaults
     if path is None:
         dir = sess.c.homedir
@@ -485,7 +500,7 @@ def open_create_file(sess, owner, path=None, attrs={FATTR4_MODE: 0644},
     open_op = op.open(seqid, access, deny, open_owner4(clientid, owner),
                       openflag, openclaim)
 
-    return sess.compound(fh_op + [open_op, op.getfh()])
+    return fh_op + [open_op, op.getfh()]
 
 def create_file(sess, owner, path=None, attrs={FATTR4_MODE: 0644},
                 access=OPEN4_SHARE_ACCESS_BOTH,
-- 
1.7.7


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

* [PATCH v2 2/2] client: add open+close test with current stateid
  2011-12-09 12:58 [PATCH v2 1/2] create open requests without executing Tigran Mkrtchyan
@ 2011-12-09 12:58 ` Tigran Mkrtchyan
  2011-12-12 19:52   ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Tigran Mkrtchyan @ 2011-12-09 12:58 UTC (permalink / raw)
  To: linux-nfs; +Cc: Tigran Mkrtchyan


Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
 nfs4.1/server41tests/st_open.py |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/nfs4.1/server41tests/st_open.py b/nfs4.1/server41tests/st_open.py
index 87b58b3..89f3e2d 100644
--- a/nfs4.1/server41tests/st_open.py
+++ b/nfs4.1/server41tests/st_open.py
@@ -1,8 +1,10 @@
 from st_create_session import create_session
 from nfs4_const import *
+
 from environment import check, checklist, fail, create_file, open_file, close_file
+from environment import open_create_file_op
 from nfs4_type import open_owner4, openflag4, createhow4, open_claim4
-from nfs4_type import creatverfattr, fattr4
+from nfs4_type import creatverfattr, fattr4, stateid4
 import nfs4_ops as op
 import threading
 
@@ -236,3 +238,18 @@ def testOPENClaimFH(t, env):
     desired = "\0"*5 + data
     if res.resarray[-1].data != desired:
         fail("Expected %r, got %r" % (desired, res.resarray[-1].data))
+
+def testOpenAndClose(t, env):
+    """test current state id processing by having OPEN and CLOSE
+       in a single compound
+
+    FLAGS: open all
+    CODE: OPEN31
+    """
+    current_stateid = stateid4(1, '\0' * 12)
+    sess1 = env.c1.new_client_session(env.testname(t))
+
+    open_op = open_create_file_op(sess1, env.testname(t), open_create=OPEN4_CREATE)
+    res = sess1.compound(open_op + [op.close(0, current_stateid)])
+    check(res, NFS4_OK)
+
-- 
1.7.7


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

* Re: [PATCH v2 2/2] client: add open+close test with current stateid
  2011-12-09 12:58 ` [PATCH v2 2/2] client: add open+close test with current stateid Tigran Mkrtchyan
@ 2011-12-12 19:52   ` J. Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2011-12-12 19:52 UTC (permalink / raw)
  To: Tigran Mkrtchyan; +Cc: linux-nfs

On Fri, Dec 09, 2011 at 01:58:53PM +0100, Tigran Mkrtchyan wrote:
> 
> Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>

Both applied, thanks.

--b.

> ---
>  nfs4.1/server41tests/st_open.py |   19 ++++++++++++++++++-
>  1 files changed, 18 insertions(+), 1 deletions(-)
> 
> diff --git a/nfs4.1/server41tests/st_open.py b/nfs4.1/server41tests/st_open.py
> index 87b58b3..89f3e2d 100644
> --- a/nfs4.1/server41tests/st_open.py
> +++ b/nfs4.1/server41tests/st_open.py
> @@ -1,8 +1,10 @@
>  from st_create_session import create_session
>  from nfs4_const import *
> +
>  from environment import check, checklist, fail, create_file, open_file, close_file
> +from environment import open_create_file_op
>  from nfs4_type import open_owner4, openflag4, createhow4, open_claim4
> -from nfs4_type import creatverfattr, fattr4
> +from nfs4_type import creatverfattr, fattr4, stateid4
>  import nfs4_ops as op
>  import threading
>  
> @@ -236,3 +238,18 @@ def testOPENClaimFH(t, env):
>      desired = "\0"*5 + data
>      if res.resarray[-1].data != desired:
>          fail("Expected %r, got %r" % (desired, res.resarray[-1].data))
> +
> +def testOpenAndClose(t, env):
> +    """test current state id processing by having OPEN and CLOSE
> +       in a single compound
> +
> +    FLAGS: open all
> +    CODE: OPEN31
> +    """
> +    current_stateid = stateid4(1, '\0' * 12)
> +    sess1 = env.c1.new_client_session(env.testname(t))
> +
> +    open_op = open_create_file_op(sess1, env.testname(t), open_create=OPEN4_CREATE)
> +    res = sess1.compound(open_op + [op.close(0, current_stateid)])
> +    check(res, NFS4_OK)
> +
> -- 
> 1.7.7
> 
> --
> 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

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

end of thread, other threads:[~2011-12-12 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-09 12:58 [PATCH v2 1/2] create open requests without executing Tigran Mkrtchyan
2011-12-09 12:58 ` [PATCH v2 2/2] client: add open+close test with current stateid Tigran Mkrtchyan
2011-12-12 19:52   ` J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.