aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/test/diameter_util.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/diameter/test/diameter_util.erl')
-rw-r--r--lib/diameter/test/diameter_util.erl46
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/diameter/test/diameter_util.erl b/lib/diameter/test/diameter_util.erl
index 52b747e99c..cca28dd23c 100644
--- a/lib/diameter/test/diameter_util.erl
+++ b/lib/diameter/test/diameter_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2015. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@
fold/3,
foldl/3,
scramble/1,
- seed/0,
unique_string/0,
have_sctp/0]).
@@ -178,23 +177,15 @@ scramble(L) ->
[[fun s/1, L]]).
s(L) ->
- random:seed(seed()),
s([], L).
s(Acc, []) ->
Acc;
s(Acc, L) ->
- {H, [T|Rest]} = lists:split(random:uniform(length(L)) - 1, L),
+ {H, [T|Rest]} = lists:split(rand:uniform(length(L)) - 1, L),
s([T|Acc], H ++ Rest).
%% ---------------------------------------------------------------------------
-%% seed/0
-
-seed() ->
- {_,T} = diameter_lib:seed(),
- T.
-
-%% ---------------------------------------------------------------------------
%% unique_string/0
unique_string() ->
@@ -204,13 +195,21 @@ unique_string() ->
%% have_sctp/0
have_sctp() ->
- case gen_sctp:open() of
- {ok, Sock} ->
- gen_sctp:close(Sock),
- true;
- {error, E} when E == eprotonosupport;
- E == esocktnosupport -> %% fail on any other reason
- false
+ case erlang:system_info(system_architecture) of
+ %% We do not support the sctp version present in solaris
+ %% version "sparc-sun-solaris2.10", that behaves differently
+ %% from later versions and linux
+ "sparc-sun-solaris2.10" ->
+ false;
+ _->
+ case gen_sctp:open() of
+ {ok, Sock} ->
+ gen_sctp:close(Sock),
+ true;
+ {error, E} when E == eprotonosupport;
+ E == esocktnosupport -> %% fail on any other reason
+ false
+ end
end.
%% ---------------------------------------------------------------------------
@@ -345,11 +344,12 @@ transport(SvcName, Ref) ->
disconnect(Client, Ref, Server, LRef) ->
true = diameter:subscribe(Server),
ok = diameter:remove_transport(Client, Ref),
- ok = receive
- {diameter_event, Server, {down, LRef, _, _}} -> ok
- after 10000 ->
- {Client, Ref, Server, LRef, process_info(self(), messages)}
- end.
+ receive
+ {diameter_event, Server, {down, LRef, _, _}} ->
+ ok
+ after 10000 ->
+ {Client, Ref, Server, LRef, process_info(self(), messages)}
+ end.
%% ---------------------------------------------------------------------------