aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-10-09 21:37:56 +0200
committerAnders Svensson <[email protected]>2011-10-10 11:27:07 +0200
commit7de6f57074245a51faf1379629fe2000ae1037e5 (patch)
tree7d74da756bc7a08bbba30ce2b2ad1be12b642b73 /lib
parent9118a8b0772aff1aa5b1ec1f280e67aed38f8826 (diff)
downloadotp-7de6f57074245a51faf1379629fe2000ae1037e5.tar.gz
otp-7de6f57074245a51faf1379629fe2000ae1037e5.tar.bz2
otp-7de6f57074245a51faf1379629fe2000ae1037e5.zip
Move certificate generation into own testcase
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/test/diameter_tls_SUITE.erl24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/diameter/test/diameter_tls_SUITE.erl b/lib/diameter/test/diameter_tls_SUITE.erl
index fb4ddcde0f..99f92ca0e0 100644
--- a/lib/diameter/test/diameter_tls_SUITE.erl
+++ b/lib/diameter/test/diameter_tls_SUITE.erl
@@ -44,6 +44,7 @@
%% testcases
-export([start_ssl/1,
start_diameter/1,
+ make_certs/1, make_certs/0,
start_services/1,
add_transports/1,
send1/1,
@@ -134,11 +135,12 @@
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 15}}].
+ [{timetrap, {seconds, 10}}].
all() ->
[start_ssl,
start_diameter,
+ make_certs,
start_services,
add_transports]
++ [{group, N} || {N, _, _} <- groups()]
@@ -184,6 +186,18 @@ start_ssl(_Config) ->
start_diameter(_Config) ->
ok = diameter:start().
+make_certs() ->
+ [{timetrap, {seconds, 30}}].
+
+make_certs(Config) ->
+ Dir = proplists:get_value(priv_dir, Config),
+
+ [] = ?util:run([[fun make_cert/2, Dir, B] || B <- ["server1",
+ "server2",
+ "server4",
+ "server5",
+ "client"]]).
+
start_services(Config) ->
Dir = proplists:get_value(priv_dir, Config),
Servers = [server(S, sopts(S, Dir)) || S <- ?SERVERS],
@@ -325,8 +339,12 @@ inband_security(Ids) ->
[{'Inband-Security-Id', Ids}].
ssl_options(Dir, Base) ->
- {Key, Cert} = make_cert(Dir, Base ++ "_key.pem", Base ++ "_ca.pem"),
- [{ssl_options, [{certfile, Cert}, {keyfile, Key}]}].
+ Root = filename:join([Dir, Base]),
+ [{ssl_options, [{certfile, Root ++ "_ca.pem"},
+ {keyfile, Root ++ "_key.pem"}]}].
+
+make_cert(Dir, Base) ->
+ make_cert(Dir, Base ++ "_key.pem", Base ++ "_ca.pem").
make_cert(Dir, Keyfile, Certfile) ->
[K,C] = Paths = [filename:join([Dir, F]) || F <- [Keyfile, Certfile]],