diff mbox

[2/2] check another odd linux server case

Message ID 1312843201-6653-3-git-send-email-bfields@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bruce Fields Aug. 8, 2011, 10:40 p.m. UTC
---
 nfs4.0/lib/nfs4/servertests/st_lock.py |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
diff mbox

Patch

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)