Files
flexnbd-c/tests/acceptance/fakes/dest/reject_acl.rb
Alex Young f5850e5aaf Switch from expecting a reconnection to *not* doing do
If we're aborting mirror operations early, a couple of specs need to
change sense.
2012-07-15 22:07:00 +01:00

25 lines
381 B
Ruby
Executable File

#!/usr/bin/env ruby
# Accept a connection, then immediately close it. This simulates an ACL rejection.
# We do not expect a reconnection.
require 'flexnbd/fake_dest'
include FlexNBD
addr, port = *ARGV
server = FakeDest.new( addr, port )
server.accept.close
begin
server.accept
fail "Unexpected reconnection"
rescue Timeout::Error
# expected
end
server.close
exit(0)