Files
flexnbd-c/tests/acceptance/fakes/dest/hello_wrong_magic.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

29 lines
567 B
Ruby
Executable File

#!/usr/bin/env ruby
# Simulate a destination which sends the wrong magic.
require 'flexnbd/fake_dest'
include FlexNBD
Thread.abort_on_exception
addr, port = *ARGV
server = FakeDest.new( addr, port )
client1 = server.accept
# We don't expect a reconnection attempt.
t = Thread.new do
begin
client2 = server.accept( "Timed out waiting for a reconnection",
FlexNBD::MS_RETRY_DELAY_SECS + 1 )
fail "Unexpected reconnection"
rescue Timeout::Error
#expected
end
end
client1.write_hello( :magic => :wrong )
t.join
exit 0