Added test for FUA acceptance.

Although I think this might be a bit useless as servers normally just
ingore flags.
This commit is contained in:
Patrick J Cherry
2018-02-03 20:29:15 +00:00
parent 4d9db4d6e9
commit 2b58468800
4 changed files with 25 additions and 4 deletions

View File

@@ -1,7 +1,6 @@
require 'test/unit'
require 'environment'
require 'flexnbd/fake_source'
require 'pp'
class TestServeMode < Test::Unit::TestCase
def setup
@@ -118,4 +117,14 @@ class TestServeMode < Test::Unit::TestCase
assert_equal 0, rsp[:error]
end
end
def test_write_with_fua_is_accepted
connect_to_server do |client|
# Start with a file of all-zeroes.
client.write_with_fua(0, "\x00" * @env.file1.size)
rsp = client.read_response
assert_equal FlexNBD::REPLY_MAGIC, rsp[:magic]
assert_equal 0, rsp[:error]
end
end
end