linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <benny@tonian.com>
To: bfields@redhat.com
Cc: linux-nfs@vger.kernel.org, Benny Halevy <bhalevy@tonian.com>
Subject: [PATCH 5/5] 4.1 server tests: test NFS4_SHARE_WANT_NO_DELEG
Date: Thu, 16 Feb 2012 20:17:39 +0200	[thread overview]
Message-ID: <1329416259-21263-1-git-send-email-bhalevy@tonian.com> (raw)
In-Reply-To: <4F3D47B3.1090708@tonian.com>

Signed-off-by: Benny Halevy <bhalevy@tonian.com>
---
 nfs4.1/server41tests/st_delegation.py |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/nfs4.1/server41tests/st_delegation.py b/nfs4.1/server41tests/st_delegation.py
index 3b32c74..ac425dc 100644
--- a/nfs4.1/server41tests/st_delegation.py
+++ b/nfs4.1/server41tests/st_delegation.py
@@ -142,3 +142,25 @@ def testAnyDeleg(t, env):
     # Now get OPEN reply
     res = sess2.listen(slot)
     checklist(res, [NFS4_OK, NFS4ERR_DELAY])
+
+def testNoDeleg(t, env):
+    """Test no delgation handout
+
+    FLAGS: open deleg all
+    CODE: DELEG4
+    """
+    c1 = env.c1.new_client("%s_1" % env.testname(t))
+    sess1 = c1.create_session()
+    sess1.compound([op.reclaim_complete(FALSE)])
+    res = create_file(sess1, env.testname(t),
+                      access=OPEN4_SHARE_ACCESS_READ |
+                      OPEN4_SHARE_ACCESS_WANT_NO_DELEG)
+    check(res)
+    fh = res.resarray[-1].object
+    deleg = res.resarray[-2].delegation
+    if deleg.delegation_type == OPEN_DELEGATE_NONE:
+        fail("Got no delegation, expected OPEN_DELEGATE_NONE_EXT")
+    if deleg.delegation_type != OPEN_DELEGATE_NONE_EXT:
+        fail("Got a delegation (type "+str(deleg.delegation_type)+") despite asking for none")
+    if deleg.ond_why != WND4_NOT_WANTED:
+        fail("Wrong reason ("+str(deleg.ond_why)+") for giving no delegation")
-- 
1.7.6.5


  parent reply	other threads:[~2012-02-16 18:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 18:15 [PATCH 0/5] 4.1 server tests: add delegation_want tests Benny Halevy
2012-02-16 18:17 ` [PATCH 1/5] 4.1 server tests: testReadDeleg recognize also OPEN_DELEGATE_NONE_EXT Benny Halevy
2012-02-16 18:17 ` [PATCH 2/5] 4.1 server tests: move testReadDeleg from st_open to st_delegation Benny Halevy
2012-02-16 18:17 ` [PATCH 3/5] 4.1 server tests: testWriteDeleg Benny Halevy
2012-02-16 18:17 ` [PATCH 4/5] 4.1 server tests: testAnyDeleg Benny Halevy
2012-02-16 18:17 ` Benny Halevy [this message]
2012-02-17 21:38 ` [PATCH 0/5] 4.1 server tests: add delegation_want tests J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329416259-21263-1-git-send-email-bhalevy@tonian.com \
    --to=benny@tonian.com \
    --cc=bfields@redhat.com \
    --cc=bhalevy@tonian.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).