From c6498930285d96faff64a845370badf600b6fe98 Mon Sep 17 00:00:00 2001 From: Maxim Fedorov Date: Thu, 18 Nov 2021 19:57:14 -0800 Subject: [stdlib] peer-ify application tests Replace usage of `test_server:start_node` with `?CT_PEER`. Additionally, disable local_time_to_universal_time_dst when running outside of MET/CET (otherwise it inevitably fails), and fix tar_SUITE test that fails when `compile` module is taken from the installed system (in that case compile.beam would be read-only, and after un-tarring mode will be read-write, making this test fail). --- lib/stdlib/test/error_logger_h_SUITE.erl | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'lib/stdlib/test/error_logger_h_SUITE.erl') diff --git a/lib/stdlib/test/error_logger_h_SUITE.erl b/lib/stdlib/test/error_logger_h_SUITE.erl index bf9b6d9ad6..89db16a899 100644 --- a/lib/stdlib/test/error_logger_h_SUITE.erl +++ b/lib/stdlib/test/error_logger_h_SUITE.erl @@ -57,8 +57,7 @@ logfile(Config) -> do_one_logfile(Log, Ev, unlimited), - Pa = "-pa " ++ filename:dirname(code:which(?MODULE)), - {ok,Node} = start_node(logfile, Pa), + {ok,Peer,Node} = ?CT_PEER(), error_logger:logfile({open,Log}), ok = rpc:call(Node, erlang, apply, [fun gen_events/1,[Ev]]), AtNode = iolist_to_binary(["** at node ",atom_to_list(Node)," **"]), @@ -79,7 +78,7 @@ logfile(Config) -> end end, processes()), - test_server:stop_node(Node), + peer:stop(Peer), cleanup(Log), ok. @@ -119,8 +118,7 @@ tty(Config) -> do_one_tty(Log, Ev, unlimited), - Pa = "-pa " ++ filename:dirname(code:which(?MODULE)), - {ok,Node} = start_node(tty, Pa), + {ok,Peer,Node} = ?CT_PEER(), tty_log_open(Log), ok = rpc:call(Node, erlang, apply, [fun gen_events/1,[Ev]]), tty_log_close(), @@ -128,7 +126,7 @@ tty(Config) -> timer:sleep(1000), % some time get all log events in the log analyse_events(Log, Ev, [AtNode], unlimited), - test_server:stop_node(Node), + peer:stop(Peer), cleanup(Log), ok. @@ -339,14 +337,6 @@ match_head(Tag, Head) -> "\\d\\d:\\d\\d:\\d\\d ===$">>, {match,_} = re:run(Head, Re). -start_node(Name, Args) -> - case test_server:start_node(Name, slave, [{args,Args}]) of - {ok,Node} -> - {ok,Node}; - Error -> - ct:fail(Error) - end. - cleanup(File) -> %% The point of this test case is not to test file operations. %% Therefore ignore any failures. -- cgit v1.2.1