diff options
author | Micael Karlberg <[email protected]> | 2012-03-14 12:25:52 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-03-14 12:25:52 +0100 |
commit | 1017c9b5629148f3d584434f1c351cf1e8dded24 (patch) | |
tree | c86653559030aae5404ee7c54af7092b87dfe434 /lib | |
parent | 39b1ef1844cbf275a3380e123bcefee0e771430f (diff) | |
download | otp-1017c9b5629148f3d584434f1c351cf1e8dded24.tar.gz otp-1017c9b5629148f3d584434f1c351cf1e8dded24.tar.bz2 otp-1017c9b5629148f3d584434f1c351cf1e8dded24.zip |
[inets/httpd] Fixed alias test cases
Fixed the alias test cases where an invalid option was used.
Also, hopefully improved error reporting in case connect
fails.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/inets/test/httpd_mod.erl | 9 | ||||
-rw-r--r-- | lib/inets/test/httpd_test_lib.erl | 18 |
2 files changed, 16 insertions, 11 deletions
diff --git a/lib/inets/test/httpd_mod.erl b/lib/inets/test/httpd_mod.erl index 23551ab125..cb1214b7fb 100644 --- a/lib/inets/test/httpd_mod.erl +++ b/lib/inets/test/httpd_mod.erl @@ -41,14 +41,7 @@ alias(Type, Port, Host, Node) -> %% This is very crude, but... tsp("alias -> Has IPv6 support: ~p", [inets_test_lib:has_ipv6_support()]), - Opts = case os:type() of - {win32, _} -> - [inet6fb4]; - _ -> - [] - end, - tsp("alias -> Opts: ~p", [Opts]), - + Opts = [], ok = httpd_test_lib:verify_request(Type, Host, Port, Opts, Node, "GET /pics/icon.sheet.gif " "HTTP/1.0\r\n\r\n", diff --git a/lib/inets/test/httpd_test_lib.erl b/lib/inets/test/httpd_test_lib.erl index ed6ee315b3..3e1213376d 100644 --- a/lib/inets/test/httpd_test_lib.erl +++ b/lib/inets/test/httpd_test_lib.erl @@ -101,7 +101,7 @@ verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr, Options, Ti "~n Options: ~p" "~n TimeOut: ~p", [SocketType, Host, Port, TranspOpts, Node, Options, TimeOut]), - case (catch inets_test_lib:connect_bin(SocketType, Host, Port, TranspOpts)) of + try inets_test_lib:connect_bin(SocketType, Host, Port, TranspOpts) of {ok, Socket} -> tsp("verify_request -> connected - now send message"), SendRes = inets_test_lib:send(SocketType, Socket, RequestStr), @@ -132,10 +132,22 @@ verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr, Options, Ti end; ConnectError -> - tsp("verify_request -> connect failed: " + tsp("verify_request -> connect error: " "~n ~p" "~n", [ConnectError]), - tsf({connect_failure, ConnectError}) + tsf({connect_error, ConnectError, + [SocketType, Host, Port, TranspOpts]}) + catch + T:E -> + tsp("verify_request -> connect failed: " + "~n E: ~p" + "~n T: ~p" + "~n", [E, T]), + tsf({connect_failure, + [{type, T}, + {error, E}, + {stacktrace, erlang:get_stacktrace()}, + {args, [SocketType, Host, Port, TranspOpts]}]}) end. request(#state{mfa = {Module, Function, Args}, |