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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Dai Ngo <dai.ngo@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux