James Carlson wrote: > Neither taking an interface (or route) down nor adding an ipfilter entry > are really equivalent to FIN. FIN starts an orderly shutdown, which > gives you a zero-length read. Timeouts (due to missing routes or > dropped packets) end up causing a reset connection -- as though you > received RST -- and can result in SIGPIPE, depending on how things play out.
I don't really care what error the recv loop gets. The typical real-life cases are: (1) server shutdown, we get a FIN, and (2) server crash, and we get an RST when it comes back up. It would be good enough for this test if smbiod gets just about any error from the recv call, i.e. ECONNRESET, EHOSTUNREACH > If you just don't care, you could use the undocumented > TCP_IOC_ABORT_CONN ioctl to abort the connection. Would I need to send this ioctl down the particular socket that I want to force closed? Or how would I identify the victim? > A more flexible (and accurate) solution would be to set up a proxy that > you can control. Have your program under test connect to the proxy, and > have the proxy relay the data to the actual peer. > > [...] > > Such a proxy might allow you to do other useful things, such as writing > a journal for debug purposes or simulating hard-to-create test > configurations. A good suggestion, but I'm hoping for an easier solution. Someone suggested ipf(1M), which seems like an interesting idea. Maybe that would let me cause a RST for connections to some IP? (I'm not too familiar with the capabilities of ipf.) > Isn't smbiod already integrated? Shouldn't there already be a test > suite with error simulations ... ? Yes, but this was allowed in with an open test CR: 6856802 Need tests for CIFS client auto-reconnect We have test personnel checking this by hand for now, by manually stopping and restarting the CIFS server. I'm trying to come up with a design (at least) to automate this auto-reconnect testing. Thanks, Gordon _______________________________________________ networking-discuss mailing list networking-discuss@opensolaris.org