@@ -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 (
@@ -110,29 +112,29 @@ init_per_group(https_down, Config) ->
110112
111113 [{issuer , build_issuer (" https" )},
112114 {oauth_provider_id , <<" uaa" >>},
113- {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config ];
115+ {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config0 ];
114116
115117init_per_group (openid_configuration_with_path , Config ) ->
116118 [{use_openid_configuration_with_path , true } | Config ];
117119
118120init_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" >>},
125- {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config ];
127+ {oauth_provider , build_https_oauth_provider (<<" uaa" >>, CaCertFile )} | Config0 ];
126128
127129init_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 (
135- build_https_oauth_provider (<<" uaa" >>, CaCertFile ))} | Config ];
137+ build_https_oauth_provider (<<" uaa" >>, CaCertFile ))} | Config0 ];
136138
137139init_per_group (with_default_oauth_provider , Config ) ->
138140 OAuthProvider = ? config (oauth_provider , Config ),
@@ -244,9 +246,8 @@ 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- ListOfExpectations );
249+ start_https_oauth_server (? AUTH_PORT , ? config (certsDir , Config ),
250+ ListOfExpectations );
250251 _ ->
251252 do_nothing
252253 end ,
@@ -262,6 +263,8 @@ end_per_testcase(_, Config) ->
262263 case ? config (group , Config ) of
263264 https ->
264265 stop_https_auth_server ();
266+ without_all_oauth_providers_settings ->
267+ stop_https_auth_server ();
265268 _ ->
266269 do_nothing
267270 end ,
@@ -618,8 +621,8 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
618621 {'_' , [{Path , oauth_http_mock , Expected } || #{request := #{path := Path }}
619622 = Expected <- Expectations ]}
620623 ]),
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 ]),
623626 {ok , _ } = cowboy :start_tls (
624627 mock_http_auth_listener ,
625628 [{port , Port },
@@ -630,8 +633,8 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
630633
631634start_https_oauth_server (Port , CertsDir , #{request := #{path := Path }} = Expected ) ->
632635 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 ]),
635638 {ok , _ } = cowboy :start_tls (
636639 mock_http_auth_listener ,
637640 [{port , Port },
0 commit comments