Added tests for NBD_MAX_SIZE

This constant is only used in the proxy, so the tests only cover proxy
mode.
This commit is contained in:
Patrick J Cherry
2018-02-13 17:04:51 +00:00
parent bb1f6ecdf5
commit 2e17e8955f

View File

@@ -207,4 +207,17 @@ module ProxyTests
end
end
end
def test_maximum_write_request_size
# Defined in src/common/nbdtypes.h
nbd_max_block_size = 32 * 1024 * 1024
@env.writefile1('0' * 40 * 1024)
with_proxied_client do |client|
# This will crash with EPIPE if the proxy dies.
client.write(0, b * nbd_max_block_size)
rsp = client.read_response
assert_equal FlexNBD::REPLY_MAGIC, rsp[:magic]
assert_equal 0, rsp[:error]
end
end
end