From 6cd69c84f6c44434b4a09ad4050320fce9ea077f Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Fri, 9 Nov 2012 15:14:36 +0100 Subject: =?UTF-8?q?Added=20testcases=20f=C3=B6r=20minimum=5Fbytes=5Fper=5F?= =?UTF-8?q?second=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/inets/test/httpd_basic_SUITE.erl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/inets/test') diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index 7a476ea14a..110293b307 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -34,7 +34,8 @@ all() -> [ uri_too_long_414, header_too_long_413, - escaped_url_in_error_body + escaped_url_in_error_body, + slowdose ]. groups() -> @@ -278,7 +279,15 @@ escaped_url_in_error_body(Config) when is_list(Config) -> inets:stop(httpd, Pid), tsp("escaped_url_in_error_body -> done"), ok. - +slowdose(Config) when is_list(Config) -> + {ok, Pid} = inets:start(httpd, [{port, 0}, {server_name, "test"}, {server_root, "/tmp"}, {document_root, "/tmp"}, {minimum_bytes_per_second, 200}]), + Info = httpd:info(Pid), + Port = proplists:get_value(port, Info), + {ok, Socket} = gen_tcp:connect("localhost", Port, []), + receive + after 2000 -> + {error, closed} = gen_tcp:send(Socket, "Hey") + end. find_URL_path([]) -> ""; find_URL_path(["URL", URL | _]) -> -- cgit v1.2.3 From 7f9bc436433f8feefeb44d05ef92868fa6d3e1c9 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Fri, 9 Nov 2012 15:46:18 +0100 Subject: Doc for test case slowdose --- lib/inets/test/httpd_basic_SUITE.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/inets/test') diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index 110293b307..326a485e31 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -279,6 +279,8 @@ escaped_url_in_error_body(Config) when is_list(Config) -> inets:stop(httpd, Pid), tsp("escaped_url_in_error_body -> done"), ok. +slowdose(doc) -> + ["Testing minimum bytes per second option"]; slowdose(Config) when is_list(Config) -> {ok, Pid} = inets:start(httpd, [{port, 0}, {server_name, "test"}, {server_root, "/tmp"}, {document_root, "/tmp"}, {minimum_bytes_per_second, 200}]), Info = httpd:info(Pid), -- cgit v1.2.3 From c593b38ccf24ccf09b9371518da6e48d31dbc55f Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Mon, 12 Nov 2012 10:08:52 +0100 Subject: Changes to slowdos testcase --- lib/inets/test/httpd_basic_SUITE.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/inets/test') diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index 326a485e31..8f29745f31 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -282,7 +282,8 @@ escaped_url_in_error_body(Config) when is_list(Config) -> slowdose(doc) -> ["Testing minimum bytes per second option"]; slowdose(Config) when is_list(Config) -> - {ok, Pid} = inets:start(httpd, [{port, 0}, {server_name, "test"}, {server_root, "/tmp"}, {document_root, "/tmp"}, {minimum_bytes_per_second, 200}]), + HttpdConf = ?config(httpd_conf, Config), + {ok, Pid} = inets:start(httpd, [{port, 0}, {minimum_bytes_per_second, 200}|HttpdConf]), Info = httpd:info(Pid), Port = proplists:get_value(port, Info), {ok, Socket} = gen_tcp:connect("localhost", Port, []), -- cgit v1.2.3 From fec356cb10757fbeb32abcfdb07f5152ca18c0de Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Wed, 14 Nov 2012 16:08:00 +0100 Subject: Fine adjustments of slowdos alg --- lib/inets/test/httpd_basic_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/inets/test') diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index 8f29745f31..f1c1c41dcb 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -288,7 +288,7 @@ slowdose(Config) when is_list(Config) -> Port = proplists:get_value(port, Info), {ok, Socket} = gen_tcp:connect("localhost", Port, []), receive - after 2000 -> + after 4000 -> {error, closed} = gen_tcp:send(Socket, "Hey") end. find_URL_path([]) -> -- cgit v1.2.3 From 5431f00a394e4ebfd2b1691afcffdc617bb06fd1 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Thu, 15 Nov 2012 15:20:10 +0100 Subject: Increased waiting time to check if socket is down --- lib/inets/test/httpd_basic_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/inets/test') diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index f1c1c41dcb..523cf9d38c 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -288,7 +288,7 @@ slowdose(Config) when is_list(Config) -> Port = proplists:get_value(port, Info), {ok, Socket} = gen_tcp:connect("localhost", Port, []), receive - after 4000 -> + after 6000 -> {error, closed} = gen_tcp:send(Socket, "Hey") end. find_URL_path([]) -> -- cgit v1.2.3