aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/test
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2015-12-08 14:55:04 +0000
committerMagnus Henoch <[email protected]>2016-01-12 14:51:14 +0000
commit81b63f2c3ffc9a1aee9e84de2e9875bf3acb6623 (patch)
treeab9903b864608108992c283e018e12f8a33296c9 /lib/ssl/test
parent5ee629684383f3931827effaca70a12bc5d4cb2a (diff)
downloadotp-81b63f2c3ffc9a1aee9e84de2e9875bf3acb6623.tar.gz
otp-81b63f2c3ffc9a1aee9e84de2e9875bf3acb6623.tar.bz2
otp-81b63f2c3ffc9a1aee9e84de2e9875bf3acb6623.zip
ssl_dist_SUITE: don't use deprecated functions
Use erlang:unique_integer/1 instead of erlang:now/0 to generate a unique node name. Use rand:uniform/1 instead of random:uniform/1, so we don't need to generate a seed ourselves.
Diffstat (limited to 'lib/ssl/test')
-rw-r--r--lib/ssl/test/ssl_dist_SUITE.erl12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl
index a389442542..00f9ee8e3c 100644
--- a/lib/ssl/test/ssl_dist_SUITE.erl
+++ b/lib/ssl/test/ssl_dist_SUITE.erl
@@ -538,17 +538,13 @@ host_name() ->
Host.
mk_node_name(Config) ->
- {A, B, C} = erlang:now(),
+ N = erlang:unique_integer([positive]),
Case = ?config(testcase, Config),
atom_to_list(?MODULE)
++ "_"
++ atom_to_list(Case)
++ "_"
- ++ integer_to_list(A)
- ++ "-"
- ++ integer_to_list(B)
- ++ "-"
- ++ integer_to_list(C).
+ ++ integer_to_list(N).
mk_node_cmdline(ListenPort, Name, Args) ->
Static = "-detached -noinput",
@@ -777,12 +773,10 @@ rand_bin(N) ->
rand_bin(0, Acc) ->
Acc;
rand_bin(N, Acc) ->
- rand_bin(N-1, [random:uniform(256)-1|Acc]).
+ rand_bin(N-1, [rand:uniform(256)-1|Acc]).
make_randfile(Dir) ->
{ok, IoDev} = file:open(filename:join([Dir, "RAND"]), [write]),
- {A, B, C} = erlang:now(),
- random:seed(A, B, C),
ok = file:write(IoDev, rand_bin(1024)),
file:close(IoDev).