From 7d0c75c91cbe903868efc51ffa6c721fe29447a2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Wed, 1 Jun 2016 15:46:46 +0200 Subject: ssl: Fix use_interface dist_SSL test Doing inet:port will cause an port_control to be sent to the port, and not all ports in the vm can handle having arbitrary data sent to them. --- lib/ssl/test/ssl_dist_SUITE.erl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/ssl/test/ssl_dist_SUITE.erl') diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl index e7cbfa63f4..2cf74ba37f 100644 --- a/lib/ssl/test/ssl_dist_SUITE.erl +++ b/lib/ssl/test/ssl_dist_SUITE.erl @@ -410,7 +410,7 @@ use_interface(Config) when is_list(Config) -> NH1, fun() -> [inet:sockname(P) || - P <- erlang:ports(), + P <- inet_ports(), {ok, Port} =:= (catch inet:port(P))] end), %% And check that it's actually listening on localhost. @@ -453,9 +453,11 @@ try_setting_priority(TestFun, Config) -> get_socket_priorities() -> [Priority || {ok,[{priority,Priority}]} <- - [inet:getopts(Port, [priority]) || - Port <- erlang:ports(), - element(2, erlang:port_info(Port, name)) =:= "tcp_inet"]]. + [inet:getopts(Port, [priority]) || Port <- inet_ports()]]. + +inet_ports() -> + [Port || Port <- erlang:ports(), + element(2, erlang:port_info(Port, name)) =:= "tcp_inet"]. %% %% test_server side api -- cgit v1.2.3