Moved acceptance tests into tests/acceptance
This commit is contained in:
22
tests/acceptance/fakes/dest/close_after_hello.rb
Executable file
22
tests/acceptance/fakes/dest/close_after_hello.rb
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
|
||||
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
|
||||
|
||||
server.close
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user