diff options
author | Maxim Fedorov <maximfca@gmail.com> | 2021-11-18 19:57:14 -0800 |
---|---|---|
committer | Maxim Fedorov <maximfca@gmail.com> | 2021-11-19 09:30:06 -0800 |
commit | c6498930285d96faff64a845370badf600b6fe98 (patch) | |
tree | e5a6e8aaad31d2f14c0df505fca1af9352945147 /lib/stdlib/test/tar_SUITE.erl | |
parent | e1fd3e0ca3a555ed6bb776bedcee42517d540941 (diff) | |
download | erlang-c6498930285d96faff64a845370badf600b6fe98.tar.gz |
[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).
Diffstat (limited to 'lib/stdlib/test/tar_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/tar_SUITE.erl | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl index d055eb88cc..8a236583b9 100644 --- a/lib/stdlib/test/tar_SUITE.erl +++ b/lib/stdlib/test/tar_SUITE.erl @@ -914,23 +914,20 @@ do_sparse([Name|Rest], DataDir, PrivDir) -> %% Test filenames with characters outside the US ASCII range. unicode(Config) when is_list(Config) -> - run_unicode_node(Config, "+fnu"), + run_unicode_node(Config, ["+fnu"]), case has_transparent_naming() of true -> - run_unicode_node(Config, "+fnl"); + run_unicode_node(Config, ["+fnl"]); false -> ok end. -run_unicode_node(Config, Option) -> +run_unicode_node(Config, Args) -> PrivDir = proplists:get_value(priv_dir, Config), - Pa = filename:dirname(code:which(?MODULE)), - Args = Option ++ " -pa "++Pa, - io:format("~s\n", [Args]), - Node = start_node(unicode, Args), + {ok, Peer, Node} = ?CT_PEER(Args), ok = rpc:call(Node, erlang, apply, [fun() -> do_unicode(PrivDir) end,[]]), - true = test_server:stop_node(Node), + peer:stop(Peer), ok. has_transparent_naming() -> @@ -1014,7 +1011,7 @@ roundtrip_metadata(Config) -> do_roundtrip_metadata(Dir, File) -> Tar = filename:join(Dir, atom_to_list(?FUNCTION_NAME)++".tar"), - BeamFile = code:which(compile), + BeamFile = code:which(?MODULE), {ok,Fd} = erl_tar:open(Tar, [write]), ok = erl_tar:add(Fd, BeamFile, File, []), ok = erl_tar:close(Fd), @@ -1131,17 +1128,6 @@ make_temp_dir(Base, I) -> {error,eexist} -> make_temp_dir(Base, I+1) end. -start_node(Name, Args) -> - [_,Host] = string:tokens(atom_to_list(node()), "@"), - ct:log("Trying to start ~w@~s~n", [Name,Host]), - case test_server:start_node(Name, peer, [{args,Args}]) of - {error,Reason} -> - ct:fail(Reason); - {ok,Node} -> - ct:log("Node ~p started~n", [Node]), - Node - end. - %% Test that the given tar file is a plain USTAR archive, %% without any PAX extensions. is_ustar(File) -> |