On 10/18/2016 06:07 AM, Wouter Verhelst wrote: > On Mon, Oct 17, 2016 at 03:23:39PM -0500, Eric Blake wrote: >> Add a test of intentionally provoking a server error during option >> negotiation to prove that a client can still fall back to known >> options; thus covering two recent bug fixes for a server sending >> the wrong length in an error reply, and for a server not reading >> enough data when replying to an unknown command. > > While this is a good idea, it might be better to do this conditionally, > and add another test to TESTS which triggers it. That way, if we break > it again in the future, the reason why will be more obvious. Trickier said than done. There is no 'testflags' parameter passed all the way into setup_connection_common(), so it would require quite a bit of additional framework to decide whether to do normal connection (return a socket ready for further reads) or a short connection (return a socket still in the middle of negotiation so we can test further options). But I'll play with the idea. > > (we can then, after successfully negotiating, send NBD_OPT_ABORT and not > do anything...) That part makes sense - sticking the handshake negotiation testing in a dedicated test, where there is no subsequent I/O, is indeed a nice separation of tasks when trying to debug any test failures. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature