diff options
author | Lukas Larsson <[email protected]> | 2012-01-03 10:52:26 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2012-03-20 10:34:05 +0100 |
commit | c5dde79924dc4d46842ab4d2a2465dbe64230599 (patch) | |
tree | c12907b0d664c1c5231f10b2b8eb1ca70fd5d591 /lib/kernel | |
parent | d883622cc3b41ad9a7879270b5b7a58248f8dbbb (diff) | |
download | otp-c5dde79924dc4d46842ab4d2a2465dbe64230599.tar.gz otp-c5dde79924dc4d46842ab4d2a2465dbe64230599.tar.bz2 otp-c5dde79924dc4d46842ab4d2a2465dbe64230599.zip |
Add test case for sending multiple small files on same connection
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/test/sendfile_SUITE.erl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl index 6cf695adfd..5d77305e37 100644 --- a/lib/kernel/test/sendfile_SUITE.erl +++ b/lib/kernel/test/sendfile_SUITE.erl @@ -27,6 +27,7 @@ all() -> [t_sendfile_small ,t_sendfile_big + ,t_sendfile_many_small ,t_sendfile_partial ,t_sendfile_offset ,t_sendfile_sendafter @@ -96,6 +97,23 @@ t_sendfile_small(Config) when is_list(Config) -> ok = sendfile_send(Send). +t_sendfile_many_small(Config) when is_list(Config) -> + Filename = proplists:get_value(small_file, Config), + FileOpts = proplists:get_value(file_opts, Config, []), + + Send = fun(Sock) -> + {Size,_} = sendfile_file_info(Filename), + N = 10000, + {ok,D} = file:open(Filename,[read|FileOpts]), + [begin + {ok,Size} = file:sendfile(D,Sock,0,0,[]) + end || _I <- lists:seq(1,N)], + file:close(D), + Size*N + end, + + ok = sendfile_send({127,0,0,1}, Send, 0). + t_sendfile_big(Config) when is_list(Config) -> Filename = proplists:get_value(big_file, Config), |