Test that closing the socket immediately after sending write data causes an error

This commit is contained in:
Alex Young
2012-07-03 15:33:00 +01:00
parent d16aebf36e
commit 5c66d35677
3 changed files with 46 additions and 1 deletions

View File

@@ -50,10 +50,18 @@ class TestDestErrorHandling < Test::Unit::TestCase
end
def test_disconnect_before_write_reply_causes_error
def test_disconnect_before_write_data_causes_error
run_fake( "source/close_after_write" )
end
def test_disconnect_before_write_reply_causes_error
# Note that this is an odd case: writing the reply doesn't fail.
# The test passes because the next attempt by flexnbd to read a
# request returns EOF.
run_fake( "source/close_after_write_data" )
end
private
def run_fake( name )
@env.run_fake( name, @env.ip, @env.port1 )