Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 1/2] nfs41: add some READ/WRITE tests for special stateids
@ 2015-10-20 16:01 Jeff Layton
  2015-10-20 16:01 ` [PATCH 2/2] create_session: ensure that we send an auth flavor in CREATE_SESSION call Jeff Layton
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2015-10-20 16:01 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
---
 nfs4.1/server41tests/st_open.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/nfs4.1/server41tests/st_open.py b/nfs4.1/server41tests/st_open.py
index 24f051e75e8f..235212cccaed 100644
--- a/nfs4.1/server41tests/st_open.py
+++ b/nfs4.1/server41tests/st_open.py
@@ -9,6 +9,7 @@ from xdrdef.nfs4_type import open_to_lock_owner4
 import nfs_ops
 op = nfs_ops.NFS4ops()
 import threading
+import nfs4lib
 
 def expect(res, seqid):
     """Verify that open result has expected stateid.seqid"""
@@ -77,6 +78,31 @@ def testReadWrite(t, env):
     if res.resarray[-1].data != desired:
         fail("Expected %r, got %r" % (desired, res.resarray[-1].data))
 
+def testAnonReadWrite(t, env):
+    """Do a simple READ and WRITE using anonymous stateid
+
+    FLAGS: open all
+    CODE: OPEN31
+    """
+    sess1 = env.c1.new_client_session(env.testname(t))
+    owner = open_owner4(0, "My Open Owner")
+    res = create_file(sess1, env.testname(t))
+    check(res)
+    expect(res, seqid=1)
+    fh = res.resarray[-1].object
+    data = "write test data"
+    stateid = res.resarray[-2].stateid
+    res = close_file(sess1, fh, stateid=stateid)
+    res = sess1.compound([op.putfh(fh), op.write(nfs4lib.state00, 5, FILE_SYNC4, data)])
+    check(res)
+    res = sess1.compound([op.putfh(fh), op.read(nfs4lib.state00, 0, 1000)])
+    check(res)
+    if not res.resarray[-1].eof:
+        fail("EOF not set on read")
+    desired = "\0"*5 + data
+    if res.resarray[-1].data != desired:
+        fail("Expected %r, got %r" % (desired, res.resarray[-1].data))
+
 def testEXCLUSIVE4AtNameAttribute(t, env):
     """If the file does exist,but the stored verifier does not match,
        then an error of NFS4ERR_EXIST is returned from server.
-- 
2.4.3


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

* [PATCH 2/2] create_session: ensure that we send an auth flavor in CREATE_SESSION call
  2015-10-20 16:01 [PATCH 1/2] nfs41: add some READ/WRITE tests for special stateids Jeff Layton
@ 2015-10-20 16:01 ` Jeff Layton
  2015-10-21 15:59   ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2015-10-20 16:01 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

...it is required.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
---
 nfs4.1/server41tests/st_create_session.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nfs4.1/server41tests/st_create_session.py b/nfs4.1/server41tests/st_create_session.py
index 4c56bb45cc8e..d3b7635545ba 100644
--- a/nfs4.1/server41tests/st_create_session.py
+++ b/nfs4.1/server41tests/st_create_session.py
@@ -13,7 +13,7 @@ def create_session(c, clientid, sequenceid, cred=None, flags=0):
     chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[])
     res = c.compound([op.create_session(clientid, sequenceid, flags,
                                         chan_attrs, chan_attrs,
-                                        123, [])], cred)
+                                        123, [callback_sec_parms4(0)])], cred)
     return res
 
 ###############################################
@@ -305,7 +305,7 @@ def testRdmaArray2(t, env):
     chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[13, 57])
     ops = [op.create_session(c.clientid, c.seqid, 0,
                              chan_attrs, chan_attrs,
-                             c.c.prog, [])]
+                             c.c.prog, [callback_sec_parms4(0)])]
     c = c.c
     xid = c.compound_async(ops, checks=False)
     try:
-- 
2.4.3


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

* Re: [PATCH 2/2] create_session: ensure that we send an auth flavor in CREATE_SESSION call
  2015-10-20 16:01 ` [PATCH 2/2] create_session: ensure that we send an auth flavor in CREATE_SESSION call Jeff Layton
@ 2015-10-21 15:59   ` J. Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2015-10-21 15:59 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs

Thanks, both pynfs patches applied.--b.

On Tue, Oct 20, 2015 at 12:01:01PM -0400, Jeff Layton wrote:
> ...it is required.
> 
> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
> ---
>  nfs4.1/server41tests/st_create_session.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/nfs4.1/server41tests/st_create_session.py b/nfs4.1/server41tests/st_create_session.py
> index 4c56bb45cc8e..d3b7635545ba 100644
> --- a/nfs4.1/server41tests/st_create_session.py
> +++ b/nfs4.1/server41tests/st_create_session.py
> @@ -13,7 +13,7 @@ def create_session(c, clientid, sequenceid, cred=None, flags=0):
>      chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[])
>      res = c.compound([op.create_session(clientid, sequenceid, flags,
>                                          chan_attrs, chan_attrs,
> -                                        123, [])], cred)
> +                                        123, [callback_sec_parms4(0)])], cred)
>      return res
>  
>  ###############################################
> @@ -305,7 +305,7 @@ def testRdmaArray2(t, env):
>      chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[13, 57])
>      ops = [op.create_session(c.clientid, c.seqid, 0,
>                               chan_attrs, chan_attrs,
> -                             c.c.prog, [])]
> +                             c.c.prog, [callback_sec_parms4(0)])]
>      c = c.c
>      xid = c.compound_async(ops, checks=False)
>      try:
> -- 
> 2.4.3

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

end of thread, other threads:[~2015-10-21 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-20 16:01 [PATCH 1/2] nfs41: add some READ/WRITE tests for special stateids Jeff Layton
2015-10-20 16:01 ` [PATCH 2/2] create_session: ensure that we send an auth flavor in CREATE_SESSION call Jeff Layton
2015-10-21 15:59   ` 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