This commit is contained in:
Patrick J Cherry
2018-02-02 21:34:14 +00:00
parent 1b7b688f7a
commit 9c48da82cc
40 changed files with 666 additions and 858 deletions

View File

@@ -1,6 +1,4 @@
#!/usr/bin/env ruby
# encoding: utf-8
# Accept a connection, write hello, wait for a write request, read the
# data, then write back a reply with a bad magic field. We then
# expect a reconnect.
@@ -9,13 +7,13 @@ require 'flexnbd/fake_dest'
include FlexNBD
addr, port = *ARGV
server = FakeDest.new( addr, port )
server = FakeDest.new(addr, port)
client = server.accept
client.write_hello
req = client.read_request
client.read_data( req[:len] )
client.write_reply( req[:handle], 0, :magic => :wrong )
client.read_data(req[:len])
client.write_reply(req[:handle], 0, magic: :wrong)
client2 = server.accept
client.close