diff options
author | Raimo Niskanen <[email protected]> | 2016-09-15 15:20:32 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2016-09-15 15:20:32 +0200 |
commit | 996a0630f2d20557c2f981106a4c316ac6a360ff (patch) | |
tree | a0f88ab9716ee08cb2417151668381406c1d3c64 /lib/kernel/test | |
parent | fde238fb52133a6c7a2a3f2a2e16f1c1bef62394 (diff) | |
parent | 8d5a41b9eeae54d1135c570878fecc2ad3ad1d8e (diff) | |
download | otp-996a0630f2d20557c2f981106a4c316ac6a360ff.tar.gz otp-996a0630f2d20557c2f981106a4c316ac6a360ff.tar.bz2 otp-996a0630f2d20557c2f981106a4c316ac6a360ff.zip |
Merge branch 'raimo/diffserv-socket-option/OTP-13582' into maint
* raimo/diffserv-socket-option/OTP-13582:
Tune 'tclass' semantics
Implement IPV6_TCLASS
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/gen_tcp_api_SUITE.erl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 77ec89b4f4..92a74465b7 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -38,7 +38,7 @@ t_local_basic/1, t_local_unbound/1, t_local_fdopen/1, t_local_fdopen_listen/1, t_local_fdopen_listen_unbound/1, t_local_fdopen_connect/1, t_local_fdopen_connect_unbound/1, - t_local_abstract/1]). + t_local_abstract/1, t_accept_inet6_tclass/1]). -export([getsockfd/0,closesockfd/1]). @@ -50,6 +50,7 @@ all() -> [{group, t_accept}, {group, t_connect}, {group, t_recv}, t_shutdown_write, t_shutdown_both, t_shutdown_error, t_shutdown_async, t_fdopen, t_fdconnect, t_implicit_inet6, + t_accept_inet6_tclass, {group, t_local}]. groups() -> @@ -521,6 +522,24 @@ local_handshake(S, SAddr, C, CAddr) -> SData = ok(gen_tcp:recv(C, length(SData))), ok. +t_accept_inet6_tclass(Config) when is_list(Config) -> + TClassOpt = {tclass,8#56 bsl 2}, % Expedited forwarding + case gen_tcp:listen(0, [inet6,TClassOpt]) of + {ok,L} -> + LPort = ok(inet:port(L)), + Loopback = {0,0,0,0,0,0,0,1}, + Sa = ok(gen_tcp:connect(Loopback, LPort, [])), + Sb = ok(gen_tcp:accept(L)), + [TClassOpt] = ok(inet:getopts(Sb, [tclass])), + ok = gen_tcp:close(Sb), + ok = gen_tcp:close(Sa), + ok = gen_tcp:close(L), + ok; + {error,_} -> + {skip,"IPv6 TCLASS not supported"} + end. + + %%% Utilities %% Calls M:F/length(A), which should return a timeout error, and complete |