public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] pynfs: add courteous server tests
@ 2021-02-16 22:04 Calum Mackay
  2021-02-16 22:47 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Calum Mackay @ 2021-02-16 22:04 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Calum Mackay, linux-nfs


[-- Attachment #1.1: Type: text/plain, Size: 2013 bytes --]

hi Bruce,

At Chuck's suggestion, I've added an initial PyNFS test to aid work on a 
courteous server. A simple test, along the lines you indicated, that 
locks a file, waits twice the lease period, and tries to unlock:

OK -> PASS (courteous server)
BADSESSION -> WARNING (discourteous server)


Before sending my patch, Chuck asked me to add the second test you 
suggested:

	- A second test creates a new client, acquires a file lock, and
	  waits two lease periods.  Then creates a second client, which
	  attempts to acquire the lock.  The second client should
	  succeed.



This doesn't seem to differentiate between these three cases:

1. a discourteous server, which invalidates the client 1 state, and 
frees all client 1's locks, upon lease expiry, then allows client 2 to 
lock the file. The above test spec would result in a PASS for a 
discourteous server, which doesn't seem right.

2. a broad-grained courteous server, which invalidates the client 1 
state, and frees all client 1's locks, because of conflicting access 
from client 2 (after client 1's lease expiry), who is then granted the 
lock. A PASS here would be correct.

3. a fine-grained courteous server, which persists the session, but 
revokes that particular client 1 lock, because of conflicting access 
from client 2 (after client 1's lease expiry), who is granted the lock. 
A PASS here would be correct.

Or am I misreading your suggestion?


If I've read it right, the test could differentiate between cases 2) and 
3), by having client 1 try to unlock, after client 2 successfully locks, 
where client 1 will see either BADSESSION (case 2) or SOME_STATE_REVOKED 
/ EXPIRED (case 3). But we don't need to differentiate cases 2) and 3), 
since a PASS would be correct in either case.

However that won't differentiate between cases 1) and 2), where client 1 
will see BADSESSION in each case. Yet case 1) ought to result in a 
WARNING, and case 2) in a PASS?


cheers,
calum.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-16 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-16 22:04 [RFC] pynfs: add courteous server tests Calum Mackay
2021-02-16 22:47 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox