Files
flexnbd-c/tests/fakes/dest/hello_wrong_size.rb

24 lines
493 B
Ruby
Executable File

#!/usr/bin/env ruby
# Simulate a server which has a disc of the wrong size attached: send
# a valid NBD hello with a random size, then check that we have see an
# EOF on read.
require 'flexnbd/fake_dest'
include FlexNBD
server = FakeDest.new( *ARGV )
client = server.accept
t = Thread.new do
client2 = server.accept( "Timed out waiting for a reconnection",
FlexNBD::MS_RETRY_DELAY_SECS + 1 )
client2.close
end
client.write_hello( :size => :wrong )
t.join
exit 0