aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-09-30 16:16:59 +0200
committerIngela Anderton Andin <[email protected]>2014-02-05 10:32:24 +0100
commitdfb5449c3a3ac2dee8b71434cba0afdba29a6567 (patch)
tree84774dabf8937e54ceceec2c1fc7333382bdd2d3 /lib
parent34a95a40294b9fd62c1bb0de6cd5286dba8f15f7 (diff)
downloadotp-dfb5449c3a3ac2dee8b71434cba0afdba29a6567.tar.gz
otp-dfb5449c3a3ac2dee8b71434cba0afdba29a6567.tar.bz2
otp-dfb5449c3a3ac2dee8b71434cba0afdba29a6567.zip
inets: added testcase for keep_alive_timeout
Diffstat (limited to 'lib')
-rw-r--r--lib/inets/test/httpd_basic_SUITE.erl23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl
index ddb79297b8..fa5c58c509 100644
--- a/lib/inets/test/httpd_basic_SUITE.erl
+++ b/lib/inets/test/httpd_basic_SUITE.erl
@@ -39,7 +39,8 @@ all() ->
script_nocache,
escaped_url_in_error_body,
script_timeout,
- slowdose
+ slowdose,
+ keep_alive_timeout
].
groups() ->
@@ -373,6 +374,26 @@ escaped_url_in_error_body(Config) when is_list(Config) ->
%%-------------------------------------------------------------------------
%%-------------------------------------------------------------------------
+keep_alive_timeout(doc) ->
+ ["Test the keep_alive_timeout option"];
+keep_alive_timeout(suite) ->
+ [];
+keep_alive_timeout(Config) when is_list(Config) ->
+ HttpdConf = ?config(httpd_conf, Config),
+ {ok, Pid} = inets:start(httpd, [{port, 0}, {keep_alive, true}, {keep_alive_timeout, 2} | HttpdConf]),
+ Info = httpd:info(Pid),
+ Port = proplists:get_value(port, Info),
+ _Address = proplists:get_value(bind_address, Info),
+ {ok, S} = gen_tcp:connect("localhost", Port, []),
+ receive
+ after 3000 ->
+ {error, closed} = gen_tcp:send(S, "hey")
+ end,
+ inets:stop(httpd, Pid).
+
+%%-------------------------------------------------------------------------
+%%-------------------------------------------------------------------------
+
script_timeout(doc) ->
["Test the httpd script_timeout option"];
script_timeout(suite) ->