2012-06-27 16:32:01 +01:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
# Connect to the destination, then hang. Connect a second time to the
|
2012-07-03 14:39:05 +01:00
|
|
|
# destination. This will trigger the destination's thread clearer. We
|
|
|
|
# can't really see any error state from here, we just try to trigger
|
|
|
|
# something the test runner can detect.
|
2012-06-27 16:32:01 +01:00
|
|
|
|
2012-06-27 17:28:24 +01:00
|
|
|
require 'flexnbd/fake_source'
|
2012-07-03 14:39:05 +01:00
|
|
|
include FlexNBD
|
2012-06-27 16:32:01 +01:00
|
|
|
|
|
|
|
addr, port = *ARGV
|
|
|
|
|
2012-07-03 14:39:05 +01:00
|
|
|
client1 = FakeSource.new( addr, port, "Timed out connecting" )
|
2012-06-27 17:28:24 +01:00
|
|
|
sleep(0.25)
|
2012-07-03 14:39:05 +01:00
|
|
|
client2 = FakeSource.new( addr, port, "Timed out connecting a second time" )
|
2012-06-27 16:32:01 +01:00
|
|
|
|
|
|
|
# This is the expected source crashing after connect
|
2012-07-03 14:39:05 +01:00
|
|
|
client1.close
|
2012-06-27 16:32:01 +01:00
|
|
|
# And this is just a tidy-up.
|
2012-07-03 14:39:05 +01:00
|
|
|
client2.close
|
|
|
|
|
|
|
|
exit(0)
|