Skip to content

Commit 950a1a8

Browse files
Use certs generated on first outer group https
1 parent 251ef24 commit 950a1a8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

deps/oauth2_client/test/system_SUITE.erl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ init_per_group(https, Config) ->
9090
application:ensure_all_started(cowboy),
9191
Config0 = rabbit_ct_helpers:run_setup_steps(Config),
9292
CertsDir = ?config(rmq_certsdir, Config0),
93+
ct:log("certsdir: ~p", [CertsDir]),
9394
CaCertFile = filename:join([CertsDir, "testca", "cacert.pem"]),
9495
WrongCaCertFile = filename:join([CertsDir, "server", "server.pem"]),
9596
[{group, https},
97+
{certsDir, CertsDir},
9698
{oauth_provider_id, <<"uaa">>},
9799
{oauth_provider, build_https_oauth_provider(<<"uaa">>, CaCertFile)},
98100
{oauth_provider_with_issuer, keep_only_issuer_and_ssl_options(
@@ -117,18 +119,18 @@ init_per_group(openid_configuration_with_path, Config) ->
117119

118120
init_per_group(with_all_oauth_provider_settings, Config) ->
119121
Config0 = rabbit_ct_helpers:run_setup_steps(Config),
120-
CertsDir = ?config(rmq_certsdir, Config0),
122+
CertsDir = ?config(certsDir, Config0),
121123
CaCertFile = filename:join([CertsDir, "testca", "cacert.pem"]),
122-
124+
ct:log("certsdir: ~p", [CertsDir]),
123125
[{with_all_oauth_provider_settings, true},
124126
{oauth_provider_id, <<"uaa">>},
125127
{oauth_provider, build_https_oauth_provider(<<"uaa">>, CaCertFile)} | Config0];
126128

127129
init_per_group(without_all_oauth_providers_settings, Config) ->
128130
Config0 = rabbit_ct_helpers:run_setup_steps(Config),
129-
CertsDir = ?config(rmq_certsdir, Config0),
131+
CertsDir = ?config(certsDir, Config0),
130132
CaCertFile = filename:join([CertsDir, "testca", "cacert.pem"]),
131-
133+
ct:log("certsdir: ~p", [CertsDir]),
132134
[{with_all_oauth_provider_settings, false},
133135
{oauth_provider_id, <<"uaa">>},
134136
{oauth_provider, keep_only_issuer_and_ssl_options(
@@ -244,8 +246,7 @@ init_per_testcase(TestCase, Config) ->
244246

245247
case ?config(group, Config) of
246248
https ->
247-
ct:log("Start https with expectations ~p", [ListOfExpectations]),
248-
start_https_oauth_server(?AUTH_PORT, ?config(rmq_certsdir, Config),
249+
start_https_oauth_server(?AUTH_PORT, ?config(certsDir, Config),
249250
ListOfExpectations);
250251
without_all_oauth_providers_settings ->
251252
start_https_oauth_server(?AUTH_PORT, ?config(rmq_certsdir, Config),
@@ -623,8 +624,8 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
623624
{'_', [{Path, oauth_http_mock, Expected} || #{request := #{path := Path}}
624625
= Expected <- Expectations ]}
625626
]),
626-
ct:log("start_https_oauth_server with expectation list : ~p -> dispatch: ~p",
627-
[Expectations, Dispatch]),
627+
ct:log("start_https_oauth_server with expectation : ~p -> dispatch: ~p . certsDir: ~p",
628+
[Expectations, Dispatch, CertsDir]),
628629
{ok, _} = cowboy:start_tls(
629630
mock_http_auth_listener,
630631
[{port, Port},
@@ -635,8 +636,8 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
635636

636637
start_https_oauth_server(Port, CertsDir, #{request := #{path := Path}} = Expected) ->
637638
Dispatch = cowboy_router:compile([{'_', [{Path, oauth_http_mock, Expected}]}]),
638-
ct:log("start_https_oauth_server with expectation : ~p -> dispatch: ~p",
639-
[Expected, Dispatch]),
639+
ct:log("start_https_oauth_server with expectation : ~p -> dispatch: ~p . certsDir: ~p",
640+
[Expected, Dispatch, CertsDir]),
640641
{ok, _} = cowboy:start_tls(
641642
mock_http_auth_listener,
642643
[{port, Port},

0 commit comments

Comments
 (0)