aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/test
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-09-30 16:16:59 +0200
committerFredrik Gustafsson <[email protected]>2013-09-30 16:16:59 +0200
commitffc5b4a516aa517bc4ccbb387c612a6bbea52ad4 (patch)
tree78d8a62c07b9cd49129b8ca40f3188ea288d06a8 /lib/inets/test
parent935874338ca9946997410a4276bf6c85847e10da (diff)
downloadotp-ffc5b4a516aa517bc4ccbb387c612a6bbea52ad4.tar.gz
otp-ffc5b4a516aa517bc4ccbb387c612a6bbea52ad4.tar.bz2
otp-ffc5b4a516aa517bc4ccbb387c612a6bbea52ad4.zip
inets: added testcase for keep_alive_timeout
Diffstat (limited to 'lib/inets/test')
-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 f164a2eda7..2d06f3e70c 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) ->