Linux-NFS Archive mirror
 help / color / mirror / Atom feed
* [pynfs PATCH] DELEG8: adding delay to allow delegation to be revoked
@ 2023-04-01 20:24 Dai Ngo
  0 siblings, 0 replies; only message in thread
From: Dai Ngo @ 2023-04-01 20:24 UTC (permalink / raw
  To: calum.mackay; +Cc: linux-nfs

From: root <root@nfsvmd07.us.oracle.com>

**************************************************
DELEG8   st_delegation.testDelegRevocation                        : FAILURE
           RuntimeError: Out of slots
**************************************************

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
 nfs4.1/server41tests/st_delegation.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/nfs4.1/server41tests/st_delegation.py b/nfs4.1/server41tests/st_delegation.py
index a25a042..b0fcb0e 100644
--- a/nfs4.1/server41tests/st_delegation.py
+++ b/nfs4.1/server41tests/st_delegation.py
@@ -9,6 +9,10 @@ op = nfs_ops.NFS4ops()
 import nfs4lib
 import threading
 
+def _getleasetime(sess):
+    res = sess.compound([op.putrootfh(), op.getattr(1 << FATTR4_LEASE_TIME)])
+    return res.resarray[-1].obj_attributes[FATTR4_LEASE_TIME]
+
 def _got_deleg(deleg):
     return (deleg.delegation_type != OPEN_DELEGATE_NONE and
             deleg.delegation_type != OPEN_DELEGATE_NONE_EXT)
@@ -179,11 +183,16 @@ def testDelegRevocation(t, env):
     how = openflag4(OPEN4_NOCREATE)
     open_op = op.open(0, OPEN4_SHARE_ACCESS_WRITE, OPEN4_SHARE_DENY_NONE,
                         owner, how, claim)
+    secs = _getleasetime(sess1) / 2
     while 1:
         res = sess2.compound(env.home + [open_op])
         if res.status == NFS4_OK:
             break;
         check(res, [NFS4_OK, NFS4ERR_DELAY])
+
+	# allow time for the delegation to be revoked
+        env.sleep(secs)
+
         # just to keep sess1 renewed.  This is a bit fragile, as we
         # depend on the above compound waiting no longer than the
         # server's lease period:
-- 
2.27.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-01 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-01 20:24 [pynfs PATCH] DELEG8: adding delay to allow delegation to be revoked Dai Ngo

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 read-only IMAP folder(s) and NNTP newsgroup(s).