2012-06-28 13:29:22 +01:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
# We connect from a local address which should be blocked, sleep for a
|
|
|
|
# bit, then try to read from the socket. We should get an instant EOF
|
|
|
|
# as we've been cut off by the destination.
|
|
|
|
|
|
|
|
require 'timeout'
|
|
|
|
require 'flexnbd/fake_source'
|
2012-07-03 14:39:05 +01:00
|
|
|
include FlexNBD
|
2012-06-28 13:29:22 +01:00
|
|
|
|
|
|
|
addr, port = *ARGV
|
2012-07-03 14:39:05 +01:00
|
|
|
|
|
|
|
client = FakeSource.new( addr, port, "Timed out connecting", "127.0.0.6" )
|
2012-06-28 13:29:22 +01:00
|
|
|
sleep( 0.25 )
|
2012-07-03 14:39:05 +01:00
|
|
|
client.ensure_disconnected
|
2012-06-28 13:29:22 +01:00
|
|
|
|
2012-07-03 14:39:05 +01:00
|
|
|
client.close
|
2012-06-28 13:29:22 +01:00
|
|
|
exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
|