@@ -72,7 +72,8 @@ run_teardown_steps(Config) ->
72
72
73
73
run_teardown_steps (Config , ExtraSteps ) ->
74
74
Steps = [
75
- fun stop_long_running_testsuite_monitor /1
75
+ fun stop_long_running_testsuite_monitor /1 ,
76
+ fun symlink_priv_dir /1
76
77
],
77
78
run_steps (Config , ExtraSteps ++ Steps ).
78
79
@@ -258,6 +259,43 @@ ensure_ssl_certs(Config) ->
258
259
{skip , " Failed to create SSL certificates" }
259
260
end .
260
261
262
+ link_name ([" deps" , _ | Tail ]) ->
263
+ case lists :reverse (Tail ) of
264
+ [" logs" | Rest ] ->
265
+ string :join (lists :reverse ([" private_log" | Rest ]), " ." );
266
+ _ ->
267
+ string :join (Tail , " ." )
268
+ end ;
269
+ link_name (X ) -> X .
270
+
271
+ get_selection_from_tc_logfile ([" logs" , _ , S | _Tail ]) ->
272
+ {ok , link_name (string :tokens (S , " ." ))};
273
+ get_selection_from_tc_logfile ([_ | Tail ]) ->
274
+ get_selection_from_tc_logfile (Tail );
275
+ get_selection_from_tc_logfile ([]) -> not_found .
276
+
277
+ get_selection (Config ) ->
278
+ TcLogFile = ? config (tc_logfile , Config ),
279
+ get_selection_from_tc_logfile (filename :split (TcLogFile )).
280
+
281
+
282
+ symlink_priv_dir (Config ) ->
283
+ SrcDir = ? config (current_srcdir , Config ),
284
+ PrivDir = ? config (priv_dir , Config ),
285
+ case get_selection (Config ) of
286
+ {ok , Name } ->
287
+ Target = filename :join ([SrcDir , " logs" , Name ]),
288
+ case exec ([" ln" , " -snf" , PrivDir , Target ]) of
289
+ {ok , _ } -> ok ;
290
+ _ -> ct :pal (? LOW_IMPORTANCE ,
291
+ " Failed to symlink private_log directory." )
292
+ end ,
293
+ Config ;
294
+ not_found ->
295
+ ct :pal (? LOW_IMPORTANCE , " Failed to symlink private_log directory." ),
296
+ Config
297
+ end .
298
+
261
299
% % -------------------------------------------------------------------
262
300
% % Process to log a message every minute during long testcases.
263
301
% % -------------------------------------------------------------------
0 commit comments