aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_transport_SUITE.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-06-12 23:49:43 +0200
committerAnders Svensson <[email protected]>2017-06-13 00:03:47 +0200
commit69c5a74179e13e145da3da70e02dd43881a82008 (patch)
treec6b385719c581a469128c180a4a0a9b9fb6593d1 /lib/diameter/test/diameter_transport_SUITE.erl
parent2994dfc0357c5c1b6f3a9c28bdfdafb482183536 (diff)
downloadotp-69c5a74179e13e145da3da70e02dd43881a82008.tar.gz
otp-69c5a74179e13e145da3da70e02dd43881a82008.tar.bz2
otp-69c5a74179e13e145da3da70e02dd43881a82008.zip
Capitulate on SCTP vs sparc-sun-solaris2.10
Despite the efforts of commits 1df74351 and 111261d1 to salvage it, SCTP is just flakey on sparc-sun-solaris2.10. In addition to the woes of the loopback address, even connect on other addresses sporadically returns {error, eafnosupport}, so the initial check for a working SCTP (aka resistance) is futile. Revert both commits.
Diffstat (limited to 'lib/diameter/test/diameter_transport_SUITE.erl')
-rw-r--r--lib/diameter/test/diameter_transport_SUITE.erl44
1 files changed, 20 insertions, 24 deletions
diff --git a/lib/diameter/test/diameter_transport_SUITE.erl b/lib/diameter/test/diameter_transport_SUITE.erl
index 14c748ad20..9d981d0a2b 100644
--- a/lib/diameter/test/diameter_transport_SUITE.erl
+++ b/lib/diameter/test/diameter_transport_SUITE.erl
@@ -56,10 +56,8 @@
-define(RECV(Pat, Ret), receive Pat -> Ret end).
-define(RECV(Pat), ?RECV(Pat, diameter_lib:now())).
-%% Address to open sockets on.
--define(ADDR(Prot), if sctp == Prot -> diameter_util:ip4();
- true -> {127,0,0,1}
- end).
+%% Sockets are opened on the loopback address.
+-define(ADDR, {127,0,0,1}).
%% diameter_tcp doesn't use anything but host_ip_address, and that
%% only is a local address isn't configured as at transport start.
@@ -351,14 +349,13 @@ rand_bytes(N) ->
%% start_connect/3
start_connect(Prot, PortNr, Ref) ->
- Addr = ?ADDR(Prot),
- {ok, TPid, [_]} = start_connect(Prot,
- {connect, Ref},
- ?SVC([]),
- [{raddr, Addr},
- {rport, PortNr},
- {ip, Addr},
- {port, 0}]),
+ {ok, TPid, [?ADDR]} = start_connect(Prot,
+ {connect, Ref},
+ ?SVC([]),
+ [{raddr, ?ADDR},
+ {rport, PortNr},
+ {ip, ?ADDR},
+ {port, 0}]),
?RECV(?TMSG({TPid, connected, _})),
TPid.
@@ -371,9 +368,9 @@ start_connect(tcp, T, Svc, Opts) ->
start_accept(Prot, Ref) ->
{Mod, Opts} = tmod(Prot),
- {ok, TPid, [_]} = Mod:start({accept, Ref},
- ?SVC([?ADDR(Prot)]),
- [{port, 0} | Opts]),
+ {ok, TPid, [?ADDR]} = Mod:start({accept, Ref},
+ ?SVC([?ADDR]),
+ [{port, 0} | Opts]),
?RECV(?TMSG({TPid, connected})),
TPid.
@@ -387,20 +384,19 @@ tmod(tcp) ->
%% gen_connect/2
gen_connect(sctp = P, PortNr) ->
- Addr = ?ADDR(P),
- {ok, Sock} = Ok = gen_sctp:open([{ip, Addr}, {port, 0} | ?SCTP_OPTS]),
- ok = gen_sctp:connect_init(Sock, Addr, PortNr, []),
+ {ok, Sock} = Ok = gen_sctp:open([{ip, ?ADDR}, {port, 0} | ?SCTP_OPTS]),
+ ok = gen_sctp:connect_init(Sock, ?ADDR, PortNr, []),
Ok = gen_accept(P, Sock);
-gen_connect(tcp = P, PortNr) ->
- gen_tcp:connect(?ADDR(P), PortNr, ?TCP_OPTS).
+gen_connect(tcp, PortNr) ->
+ gen_tcp:connect(?ADDR, PortNr, ?TCP_OPTS).
%% gen_listen/1
-gen_listen(sctp = P) ->
- {ok, Sock} = gen_sctp:open([{ip, ?ADDR(P)}, {port, 0} | ?SCTP_OPTS]),
+gen_listen(sctp) ->
+ {ok, Sock} = gen_sctp:open([{ip, ?ADDR}, {port, 0} | ?SCTP_OPTS]),
{gen_sctp:listen(Sock, true), Sock};
-gen_listen(tcp = P) ->
- gen_tcp:listen(0, [{ip, ?ADDR(P)} | ?TCP_OPTS]).
+gen_listen(tcp) ->
+ gen_tcp:listen(0, [{ip, ?ADDR} | ?TCP_OPTS]).
%% gen_accept/2