Files
flexnbd-c/tests/acceptance/fakes/source/close_after_hello.rb

24 lines
506 B
Ruby
Raw Normal View History

2012-06-22 10:05:41 +01:00
#!/usr/bin/env ruby
# Connect, read the hello, then immediately disconnect. This
# simulates a sender which dislikes something in the hello message - a
# wrong size, for instance.
# After the disconnect, we reconnect to be sure that the destination
# is still alive.
require 'flexnbd/fake_source'
include FlexNBD
2012-06-22 10:05:41 +01:00
addr, port = *ARGV
2018-02-02 21:34:14 +00:00
client = FakeSource.new(addr, port, 'Timed out connecting.')
client.read_hello
client.close
2012-06-22 10:05:41 +01:00
sleep(0.2)
2018-02-02 21:34:14 +00:00
FakeSource.new(addr, port, 'Timed out reconnecting.')
2012-06-22 10:05:41 +01:00
exit(0)