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

@@ -5,19 +5,18 @@
# EOF on read.
require 'flexnbd/fake_dest'
include FlexNBD::FakeDest
sock = serve( *ARGV )
client_sock = accept( sock, "Timed out waiting for a connection" )
include FlexNBD
server = FakeDest.new( *ARGV )
client = server.accept
t = Thread.new do
client_sock2 = accept( sock, "Timed out waiting for a reconnection",
FlexNBD::MS_RETRY_DELAY_SECS + 1 )
client_sock2.close
client2 = server.accept( "Timed out waiting for a reconnection",
FlexNBD::MS_RETRY_DELAY_SECS + 1 )
client2.close
end
write_hello( client_sock, :size => :wrong )
client.write_hello( :size => :wrong )
t.join