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

@@ -7,19 +7,16 @@
# user, we have to keep trying.
require 'flexnbd/fake_dest'
include FlexNBD::FakeDest
include FlexNBD
addr, port = *ARGV
server = FakeDest.new( *ARGV )
client = server.accept( "Timed out waiting for a connection" )
client.write_hello
client.close
new_client = server.accept( "Timed out waiting for a reconnection" )
new_client.close
sock = serve( addr, port )
client_sock = accept( sock, "Timed out waiting for a connection" )
write_hello( client_sock )
client_sock.close
new_sock = accept( sock, "Timed out waiting for a reconnection" )
new_sock.close
sock.close
server.close
exit 0