diff options
Diffstat (limited to 'lib/diameter/test/diameter_tls_SUITE.erl')
-rw-r--r-- | lib/diameter/test/diameter_tls_SUITE.erl | 24 |
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]], |