diff mbox series

[pynfs,v2] DELEG8: adding delay to allow delegation to be revoked

Message ID 1680381222-23409-1-git-send-email-dai.ngo@oracle.com (mailing list archive)
State New, archived
Headers show
Series [pynfs,v2] DELEG8: adding delay to allow delegation to be revoked | expand

Commit Message

Dai Ngo April 1, 2023, 8:33 p.m. UTC
**************************************************
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 mbox series

Patch

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: