Files
flexnbd-c/tests/acceptance/fakes/dest/close_after_hello.rb

23 lines
610 B
Ruby
Raw Normal View History

2012-06-22 10:05:41 +01:00
#!/usr/bin/env ruby
# Wait for a sender connection, send a correct hello, then disconnect.
# Simulate a server which crashes after sending the hello. We then
# reopen the server socket to check that the sender retries: since the
# command-line has gone away, and can't feed an error back to the
# user, we have to keep trying.
require 'flexnbd/fake_dest'
include FlexNBD
2012-06-22 10:05:41 +01:00
server = FakeDest.new( *ARGV )
client = server.accept( "Timed out waiting for a connection" )
client.write_hello
client.close
2012-06-22 10:05:41 +01:00
new_client = server.accept( "Timed out waiting for a reconnection" )
new_client.close
2012-06-22 10:05:41 +01:00
server.close
2012-06-22 10:05:41 +01:00
exit 0