@@ -90,9 +90,11 @@ init_per_group(https, Config) ->
90
90
application :ensure_all_started (cowboy ),
91
91
Config0 = rabbit_ct_helpers :run_setup_steps (Config ),
92
92
CertsDir = ? config (rmq_certsdir , Config0 ),
93
+ ct :log (" certsdir: ~p " , [CertsDir ]),
93
94
CaCertFile = filename :join ([CertsDir , " testca" , " cacert.pem" ]),
94
95
WrongCaCertFile = filename :join ([CertsDir , " server" , " server.pem" ]),
95
96
[{group , https },
97
+ {certsDir , CertsDir },
96
98
{oauth_provider_id , <<" uaa" >>},
97
99
{oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )},
98
100
{oauth_provider_with_issuer , keep_only_issuer_and_ssl_options (
@@ -110,29 +112,29 @@ init_per_group(https_down, Config) ->
110
112
111
113
[{issuer , build_issuer (" https" )},
112
114
{oauth_provider_id , <<" uaa" >>},
113
- {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config ];
115
+ {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config0 ];
114
116
115
117
init_per_group (openid_configuration_with_path , Config ) ->
116
118
[{use_openid_configuration_with_path , true } | Config ];
117
119
118
120
init_per_group (with_all_oauth_provider_settings , Config ) ->
119
121
Config0 = rabbit_ct_helpers :run_setup_steps (Config ),
120
- CertsDir = ? config (rmq_certsdir , Config0 ),
122
+ CertsDir = ? config (certsDir , Config0 ),
121
123
CaCertFile = filename :join ([CertsDir , " testca" , " cacert.pem" ]),
122
-
124
+ ct : log ( " certsdir: ~p " , [ CertsDir ]),
123
125
[{with_all_oauth_provider_settings , true },
124
126
{oauth_provider_id , <<" uaa" >>},
125
- {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config ];
127
+ {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config0 ];
126
128
127
129
init_per_group (without_all_oauth_providers_settings , Config ) ->
128
130
Config0 = rabbit_ct_helpers :run_setup_steps (Config ),
129
- CertsDir = ? config (rmq_certsdir , Config0 ),
131
+ CertsDir = ? config (certsDir , Config0 ),
130
132
CaCertFile = filename :join ([CertsDir , " testca" , " cacert.pem" ]),
131
-
133
+ ct : log ( " certsdir: ~p " , [ CertsDir ]),
132
134
[{with_all_oauth_provider_settings , false },
133
135
{oauth_provider_id , <<" uaa" >>},
134
136
{oauth_provider , keep_only_issuer_and_ssl_options (
135
- build_https_oauth_provider (<<" uaa" >>, CaCertFile ))} | Config ];
137
+ build_https_oauth_provider (<<" uaa" >>, CaCertFile ))} | Config0 ];
136
138
137
139
init_per_group (with_default_oauth_provider , Config ) ->
138
140
OAuthProvider = ? config (oauth_provider , Config ),
@@ -244,9 +246,8 @@ init_per_testcase(TestCase, Config) ->
244
246
245
247
case ? config (group , Config ) of
246
248
https ->
247
- ct :log (" Start https with expectations ~p " , [ListOfExpectations ]),
248
- start_https_oauth_server (? AUTH_PORT , ? config (rmq_certsdir , Config ),
249
- ListOfExpectations );
249
+ start_https_oauth_server (? AUTH_PORT , ? config (certsDir , Config ),
250
+ ListOfExpectations );
250
251
_ ->
251
252
do_nothing
252
253
end ,
@@ -262,6 +263,8 @@ end_per_testcase(_, Config) ->
262
263
case ? config (group , Config ) of
263
264
https ->
264
265
stop_https_auth_server ();
266
+ without_all_oauth_providers_settings ->
267
+ stop_https_auth_server ();
265
268
_ ->
266
269
do_nothing
267
270
end ,
@@ -618,8 +621,8 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
618
621
{'_' , [{Path , oauth_http_mock , Expected } || #{request := #{path := Path }}
619
622
= Expected <- Expectations ]}
620
623
]),
621
- ct :log (" start_https_oauth_server with expectation list : ~p -> dispatch: ~p " ,
622
- [Expectations , Dispatch ]),
624
+ ct :log (" start_https_oauth_server with expectation : ~p -> dispatch: ~p . certsDir : ~p " ,
625
+ [Expectations , Dispatch , CertsDir ]),
623
626
{ok , _ } = cowboy :start_tls (
624
627
mock_http_auth_listener ,
625
628
[{port , Port },
@@ -630,8 +633,8 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
630
633
631
634
start_https_oauth_server (Port , CertsDir , #{request := #{path := Path }} = Expected ) ->
632
635
Dispatch = cowboy_router :compile ([{'_' , [{Path , oauth_http_mock , Expected }]}]),
633
- ct :log (" start_https_oauth_server with expectation : ~p -> dispatch: ~p " ,
634
- [Expected , Dispatch ]),
636
+ ct :log (" start_https_oauth_server with expectation : ~p -> dispatch: ~p . certsDir: ~p " ,
637
+ [Expected , Dispatch , CertsDir ]),
635
638
{ok , _ } = cowboy :start_tls (
636
639
mock_http_auth_listener ,
637
640
[{port , Port },
0 commit comments