diff options
author | Ingela Anderton Andin <[email protected]> | 2019-03-26 18:38:49 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2019-03-26 18:38:49 +0100 |
commit | f1bf22b22e2e148984c183d418c27b2f856d4c60 (patch) | |
tree | b3f6061895eeba72e577a826895afae5cab648d7 /lib | |
parent | 07f8099865b5a5d38e56684186e52345f955af48 (diff) | |
download | otp-f1bf22b22e2e148984c183d418c27b2f856d4c60.tar.gz otp-f1bf22b22e2e148984c183d418c27b2f856d4c60.tar.bz2 otp-f1bf22b22e2e148984c183d418c27b2f856d4c60.zip |
inets: Check ipv6 support with ct:require
Diffstat (limited to 'lib')
-rw-r--r-- | lib/inets/test/httpc_SUITE.erl | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl index 8357e02014..d4b33ae2c6 100644 --- a/lib/inets/test/httpc_SUITE.erl +++ b/lib/inets/test/httpc_SUITE.erl @@ -339,14 +339,6 @@ end_per_testcase(Case, Config) end_per_testcase(_Case, _Config) -> ok. -is_ipv6_supported() -> - case gen_udp:open(0, [inet6]) of - {ok, Socket} -> - gen_udp:close(Socket), - true; - _ -> - false - end. %%-------------------------------------------------------------------- @@ -1612,7 +1604,8 @@ post_with_content_type(Config) when is_list(Config) -> %%-------------------------------------------------------------------- request_options() -> - [{doc, "Test http get request with socket options against local server (IPv6)"}]. + [{require, ipv6_hosts}, + {doc, "Test http get request with socket options against local server (IPv6)"}]. request_options(Config) when is_list(Config) -> Request = {url(group_name(Config), "/dummy.html", Config), []}, {ok, {{_,200,_}, [_ | _], _ = [_ | _]}} = httpc:request(get, Request, [], @@ -2945,3 +2938,12 @@ receive_stream_n(Ref, N) -> ct:pal("Data: ~p", [Data]), receive_stream_n(Ref, N-1) end. + +is_ipv6_supported() -> + {ok, Hostname0} = inet:gethostname(), + try + lists:member(list_to_atom(Hostname0), ct:get_config(ipv6_hosts)) + catch + _: _ -> + false + end. |