Check that a mirror write returning an error will cause a reconnect and retry

This commit is contained in:
Alex Young
2012-07-02 15:04:45 +01:00
parent 99f8c24b01
commit ea4642a878
10 changed files with 192 additions and 88 deletions

View File

@@ -8,16 +8,14 @@
# right error message after the timeout time.
require 'flexnbd/fake_dest'
include FlexNBD::FakeDest
include FlexNBD
addr, port = *ARGV
serve_sock = serve( addr, port )
client_sock = accept( serve_sock, "Client didn't make a connection" )
server = FakeDest.new( *ARGV )
client = server.accept( "Client didn't make a connection" )
# Sleep for one second past the timeout (a bit of slop in case ruby
# doesn't launch things quickly)
sleep(FlexNBD::MS_HELLO_TIME_SECS + 1)
client_sock.close if client_sock
serve_sock.close
client.close
server.close