diff options
Diffstat (limited to 'lib/inets/test')
-rw-r--r-- | lib/inets/test/Makefile | 24 | ||||
-rw-r--r-- | lib/inets/test/httpc_SUITE.erl | 45 | ||||
-rw-r--r-- | lib/inets/test/httpd_basic_SUITE.erl | 36 | ||||
-rw-r--r-- | lib/inets/test/inets_appup_test.erl | 5 |
4 files changed, 74 insertions, 36 deletions
diff --git a/lib/inets/test/Makefile b/lib/inets/test/Makefile index bb7f2186af..0492d33eab 100644 --- a/lib/inets/test/Makefile +++ b/lib/inets/test/Makefile @@ -288,16 +288,20 @@ release_spec: opt $(INSTALL_DATA) $(INETS_FILES) $(RELSYSDIR)/test @for d in $(DATADIRS); do \ echo "installing data dir $$d"; \ - echo $$d/TAR.exclude2 > $$d/TAR.exclude2; \ - cat $$d/TAR.exclude >> $$d/TAR.exclude2; \ - find $$d -name '*.contrib*' >> $$d/TAR.exclude2; \ - find $$d -name '*.keep*' >> $$d/TAR.exclude2; \ - find $$d -name '*.mkelem*' >> $$d/TAR.exclude2; \ - find $$d -name '*~' >> $$d/TAR.exclude2; \ - find $$d -name 'erl_crash.dump' >> $$d/TAR.exclude2; \ - find $$d -name 'core' >> $$d/TAR.exclude2; \ - find $$d -name '.cmake.state' >> $$d/TAR.exclude2; \ - tar cfX - $$d/TAR.exclude2 $$d | (cd $(RELSYSDIR)/test; tar xf -); \ + if test -f $$d/TAR.exclude; then \ + echo $$d/TAR.exclude2 > $$d/TAR.exclude2; \ + cat $$d/TAR.exclude >> $$d/TAR.exclude2; \ + find $$d -name '*.contrib*' >> $$d/TAR.exclude2; \ + find $$d -name '*.keep*' >> $$d/TAR.exclude2; \ + find $$d -name '*.mkelem*' >> $$d/TAR.exclude2; \ + find $$d -name '*~' >> $$d/TAR.exclude2; \ + find $$d -name 'erl_crash.dump' >> $$d/TAR.exclude2; \ + find $$d -name 'core' >> $$d/TAR.exclude2; \ + find $$d -name '.cmake.state' >> $$d/TAR.exclude2; \ + tar cfX - $$d/TAR.exclude2 $$d | (cd $(RELSYSDIR)/test; tar xf -); \ + else \ + tar cf - $$d | (cd $(RELSYSDIR)/test; tar xf -); \ + fi; \ done release_tests_spec: opt diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index 902e440c80..94d5a48ef6 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -254,9 +254,14 @@ init_per_testcase(Case, Timeout, Config) -> [{watchdog, Dog}, {local_server, Server} | TmpConfig2] end, + %% httpc:set_options([{proxy, {{?PROXY, ?PROXY_PORT}, + %% ["localhost", ?IPV6_LOCAL_HOST]}}]), + httpc:set_options([{proxy, {{?PROXY, ?PROXY_PORT}, - ["localhost", ?IPV6_LOCAL_HOST]}}]), - %% snmp:set_trace([gen_tcp, inet_tcp, prim_inet]), + ["localhost", ?IPV6_LOCAL_HOST]}}, + {ipfamily, inet6fb4}]), + + %% snmp:set_trace([gen_tcp]), NewConfig. @@ -471,7 +476,7 @@ http_relaxed(Config) when is_list(Config) -> DummyServerPid ! stop, ok = httpc:set_options([{ipv6, enabled}]), - %% ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + %% ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -489,7 +494,7 @@ http_dummy_pipe(Config) when is_list(Config) -> test_pipeline(URL), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. http_inets_pipe(doc) -> @@ -851,7 +856,7 @@ http_headers_dummy(Config) when is_list(Config) -> ], "text/plain", FooBar}, [], []), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -875,7 +880,7 @@ http_bad_response(Config) when is_list(Config) -> test_server:format("Wrong Statusline: ~p~n", [Reason]), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1157,7 +1162,7 @@ http_redirect(Config) when is_list(Config) -> tsp("http_redirect -> stop dummy server"), DummyServerPid ! stop, tsp("http_redirect -> reset ipfamily option (to inet6fb4)"), - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), tsp("http_redirect -> done"), ok; @@ -1181,7 +1186,7 @@ http_redirect_loop(Config) when is_list(Config) -> {ok, {{_,300,_}, [_ | _], _}} = httpc:request(get, {URL, []}, [], []), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. %%------------------------------------------------------------------------- @@ -1215,7 +1220,7 @@ http_internal_server_error(Config) when is_list(Config) -> ets:delete(unavailable), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1242,7 +1247,7 @@ http_userinfo(Config) when is_list(Config) -> httpc:request(get, {URLUnAuth, []}, [], []), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1271,9 +1276,9 @@ http_cookie(Config) when is_list(Config) -> ets:delete(cookie), - ok = httpc:set_options([{cookies, disabled}, {ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{cookies, disabled}]), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6************ + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. %%------------------------------------------------------------------------- @@ -1643,7 +1648,7 @@ http_stream_once(Config) when is_list(Config) -> p("http_stream_once -> stop dummy server", []), DummyServerPid ! stop, p("http_stream_once -> set ipfamily to inet6fb4", []), - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), p("http_stream_once -> done", []), ok. @@ -1847,7 +1852,7 @@ http_invalid_http(Config) when is_list(Config) -> test_server:format("Parse error: ~p ~n", [Reason]), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1901,7 +1906,7 @@ transfer_encoding_otp_6807(Config) when is_list(Config) -> "/capital_transfer_encoding.html", {ok, {{_,200,_}, [_|_], [_ | _]}} = httpc:request(URL), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1933,7 +1938,7 @@ empty_response_header_otp_6830(Config) when is_list(Config) -> URL = ?URL_START ++ integer_to_list(Port) ++ "/no_headers.html", {ok, {{_,200,_}, [], [_ | _]}} = httpc:request(URL), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1950,7 +1955,7 @@ no_content_204_otp_6982(Config) when is_list(Config) -> URL = ?URL_START ++ integer_to_list(Port) ++ "/no_content.html", {ok, {{_,204,_}, [], []}} = httpc:request(URL), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1968,7 +1973,7 @@ missing_CR_otp_7304(Config) when is_list(Config) -> URL = ?URL_START ++ integer_to_list(Port) ++ "/missing_CR.html", {ok, {{_,200,_}, _, [_ | _]}} = httpc:request(URL), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. @@ -1990,7 +1995,7 @@ otp_7883_1(Config) when is_list(Config) -> {error, socket_closed_remotely} = httpc:request(URL), DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. otp_7883_2(doc) -> @@ -2017,7 +2022,7 @@ otp_7883_2(Config) when is_list(Config) -> end, DummyServerPid ! stop, - ok = httpc:set_options([{ipfamily, inet6fb4}]), % ********** ipfamily = inet6 ************* + ok = httpc:set_options([{ipfamily, inet6fb4}]), ok. diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl index f86c1fcb49..9ba2e73942 100644 --- a/lib/inets/test/httpd_basic_SUITE.erl +++ b/lib/inets/test/httpd_basic_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -25,13 +25,16 @@ %% Note: This directive should only be used in test suites. -compile(export_all). +-define(URL_START, "http://localhost:"). + all(doc) -> ["Basic test of httpd."]; all(suite) -> [ uri_too_long_414, - header_too_long_413 + header_too_long_413, + escaped_url_in_error_body ]. %%-------------------------------------------------------------------- @@ -131,6 +134,31 @@ header_too_long_413(Config) when is_list(Config) -> {version, "HTTP/1.1"}]), inets:stop(httpd, Pid). +escaped_url_in_error_body(doc) -> + ["Test Url-encoding see OTP-8940"]; +escaped_url_in_error_body(suite) -> + []; +escaped_url_in_error_body(Config) when is_list(Config) -> + HttpdConf = ?config(httpd_conf, Config), + {ok, Pid} = inets:start(httpd, [{port, 0} | HttpdConf]), + Info = httpd:info(Pid), + Port = proplists:get_value(port, Info), + Address = proplists:get_value(bind_address, Info), + Path = "/<b>this_is_bold<b>", + URL = ?URL_START ++ integer_to_list(Port) ++ Path, + EscapedPath = http_uri:encode(Path), + {ok, {404, Body}} = httpc:request(get, {URL, []}, + [{url_encode, true}], + [{version, "HTTP/1.0"}, {full_result, false}]), + EscapedPath = find_URL_path(string:tokens(Body, " ")), + {ok, {404, Body1}} = httpc:request(get, {URL, []}, [], + [{version, "HTTP/1.0"}, {full_result, false}]), + EscapedPath = find_URL_path(string:tokens(Body1, " ")), + inets:stop(httpd, Pid). - - +find_URL_path([]) -> + ""; +find_URL_path(["URL", URL | _]) -> + URL; +find_URL_path([_ | Rest]) -> + find_URL_path(Rest). diff --git a/lib/inets/test/inets_appup_test.erl b/lib/inets/test/inets_appup_test.erl index d580c6c4c5..2c9c687c91 100644 --- a/lib/inets/test/inets_appup_test.erl +++ b/lib/inets/test/inets_appup_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2009. All Rights Reserved. +%% Copyright Ericsson AB 2002-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -18,11 +18,12 @@ %% %% %%---------------------------------------------------------------------- -%% Purpose: Verify the application specifics of the Megaco application +%% Purpose: Verify the application specifics of the Inets application %%---------------------------------------------------------------------- -module(inets_appup_test). -compile(export_all). +-compile({no_auto_import,[error/1]}). -include("inets_test_lib.hrl"). |