Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: Fred Isaman <iisaman@netapp.com>
Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 2/2] check another odd linux server case
Date: Mon,  8 Aug 2011 18:40:01 -0400	[thread overview]
Message-ID: <1312843201-6653-3-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1312843201-6653-1-git-send-email-bfields@redhat.com>

---
 nfs4.0/lib/nfs4/servertests/st_lock.py |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/nfs4.0/lib/nfs4/servertests/st_lock.py b/nfs4.0/lib/nfs4/servertests/st_lock.py
index 90b93ee..8be25cd 100644
--- a/nfs4.0/lib/nfs4/servertests/st_lock.py
+++ b/nfs4.0/lib/nfs4/servertests/st_lock.py
@@ -846,3 +846,20 @@ def xxtestLockowner2(t, env):
         self.ncl.lock_test(self.fh)
         self.ncl.lock_file(self.fh, self.stateid, error=[NFS4ERR_BAD_STATEID])
 
+def testOpenDowngradeLock(t, env):
+    """OPEN a file RW, then lock R, then downgrade to R, then unlock.
+
+    FLAGS: lock all
+    DEPEND: MKFILE
+    CODE: LOCK23
+    """
+    c = env.c1
+    c.init_connection()
+    fh, oldstateid = c.create_confirm(t.code, access=OPEN4_SHARE_ACCESS_READ,
+                                      deny=OPEN4_SHARE_DENY_NONE)
+    fh, stateid = c.open_confirm(t.code, access=OPEN4_SHARE_ACCESS_BOTH,
+                                   deny=OPEN4_SHARE_DENY_NONE)
+    res = c.lock_file(t.code, fh, stateid);
+    res = c.downgrade_file(t.code, fh, res.lockid,
+                           access=OPEN4_SHARE_ACCESS_READ,
+                           deny=OPEN4_SHARE_DENY_NONE)
-- 
1.7.4.1


      parent reply	other threads:[~2011-08-08 22:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 22:39 more server pynfs tests J. Bruce Fields
2011-08-08 22:40 ` [PATCH 1/2] read+write+readwrite open test J. Bruce Fields
2011-08-08 22:40 ` J. Bruce Fields [this message]

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=1312843201-6653-3-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.com \
    --cc=iisaman@netapp.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