diff options
author | Micael Karlberg <[email protected]> | 2018-10-04 15:33:23 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-10-04 15:33:23 +0200 |
commit | 4e3f42da1dae7166faeb9f9e07adc40bc3b22d75 (patch) | |
tree | ad10b8bdb3fa4ac76a6d6e485bfb7873083eae15 /lib/kernel/test | |
parent | 8daa980d92a17e7bb948971b2048c7758e5dd2e6 (diff) | |
parent | e698436942c7aaf4f2872c19df2555275be169d1 (diff) | |
download | otp-4e3f42da1dae7166faeb9f9e07adc40bc3b22d75.tar.gz otp-4e3f42da1dae7166faeb9f9e07adc40bc3b22d75.tar.bz2 otp-4e3f42da1dae7166faeb9f9e07adc40bc3b22d75.zip |
Merge branch 'bmk/20181004/nififying_inet_freebsd_fixes/OTP-14831' into bmk/20180918/nififying_inet/OTP-14831
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/socket_SUITE.erl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/kernel/test/socket_SUITE.erl b/lib/kernel/test/socket_SUITE.erl index 95b58892c1..1fff17cf8c 100644 --- a/lib/kernel/test/socket_SUITE.erl +++ b/lib/kernel/test/socket_SUITE.erl @@ -205,7 +205,15 @@ api_b_open_and_close(Domain, Type, Proto) -> {error, Reason} -> ?FAIL({open, Reason}) end, - {ok, Domain} = socket:getopt(Socket, socket, domain), + %% Domain is not available on all platforms: + case socket:getopt(Socket, socket, domain) of + {ok, Domain} -> + ok; + {error, einval} -> + ok; + Else -> + ?FAIL({getopt, domain, Else}) + end, {ok, Type} = socket:getopt(Socket, socket, type), {ok, Proto} = socket:getopt(Socket, socket, protocol), Self = self(), @@ -691,6 +699,11 @@ api_to_connect_tcp6(_Config) when is_list(_Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% We use the backlog (listen) argument to test this. +%% Note that the behaviour of the TCP "server side" can vary when +%% a client connect to a "busy" server (full backlog). +%% For instance, on FreeBSD (11.2) the reponse when the backlog is full +%% is a econreset. api_to_connect_tcp(Domain) -> process_flag(trap_exit, true), @@ -754,6 +767,9 @@ api_to_connect_tcp_await_timeout([Sock|Socks], ServerSA, ID) -> {error, timeout} -> p("expected timeout (~w)", [ID]), ok; + {error, econnreset = Reason} -> + p("failed connecting: ~p - giving up", [Reason]), + ok; {error, Reason} -> p("failed connecting: ~p", [Reason]), ?FAIL({recv, Reason}); |