diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl | 50 | ||||
-rw-r--r-- | lib/common_test/test/ct_repeat_testrun_SUITE.erl | 4 | ||||
-rw-r--r-- | lib/reltool/test/reltool_server_SUITE.erl | 6 | ||||
-rw-r--r-- | lib/sasl/test/release_handler_SUITE.erl | 8 |
4 files changed, 35 insertions, 33 deletions
diff --git a/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl b/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl index d967590c72..83d368c53d 100644 --- a/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl +++ b/lib/common_test/test/ct_cover_SUITE_data/cover_SUITE.erl @@ -52,11 +52,10 @@ init_per_testcase(_Case, Config) -> [{watchdog, Dog}|Config]. end_per_testcase(Case, Config) -> - %% try apply(?MODULE,Case,[cleanup,Config]) - %% catch error:undef -> ok - %% end, + try apply(?MODULE,Case,[cleanup,Config]) + catch error:undef -> ok + end, - kill_slaves(Case,nodes()), Dog=?config(watchdog, Config), test_server:timetrap_cancel(Dog), ok. @@ -67,12 +66,12 @@ break(_Config) -> test_server:break(""), ok. -default(Config) -> +default(_Config) -> cover_compiled = code:which(cover_test_mod), cover_test_mod:foo(), ok. -slave(Config) -> +slave(_Config) -> cover_compiled = code:which(cover_test_mod), cover_test_mod:foo(), N1 = nodename(slave,1), @@ -81,8 +80,10 @@ slave(Config) -> rpc:call(Node,cover_test_mod,foo,[]), {ok,Node} = ct_slave:stop(N1), ok. +slave(cleanup,_Config) -> + kill_slaves([nodename(slave,1)]). -slave_start_slave(Config) -> +slave_start_slave(_Config) -> cover_compiled = code:which(cover_test_mod), cover_test_mod:foo(), N1 = nodename(slave_start_slave,1), @@ -90,13 +91,16 @@ slave_start_slave(Config) -> {ok,Node} = start_slave(N1), cover_compiled = rpc:call(Node,code,which,[cover_test_mod]), rpc:call(Node,cover_test_mod,foo,[]), - {ok,Node2} = rpc:call(Node,ct_slave,start,[N2]), + {ok,Node2} = start_slave(Node,N2), % start slave N2 from node Node rpc:call(Node2,cover_test_mod,foo,[]), {ok,Node2} = rpc:call(Node,ct_slave,stop,[N2]), {ok,Node} = ct_slave:stop(N1), ok. +slave_start_slave(cleanup,_Config) -> + kill_slaves([nodename(slave_start_slave,1), + nodename(slave_start_slave,2)]). -cover_node_option(Config) -> +cover_node_option(_Config) -> cover_compiled = code:which(cover_test_mod), cover_test_mod:foo(), Node = fullname(existing_node_1), @@ -104,7 +108,7 @@ cover_node_option(Config) -> rpc:call(Node,cover_test_mod,foo,[]), ok. -ct_cover_add_remove_nodes(Config) -> +ct_cover_add_remove_nodes(_Config) -> cover_compiled = code:which(cover_test_mod), cover_test_mod:foo(), Node = fullname(existing_node_2), @@ -143,22 +147,20 @@ fullname(Name) -> {ok,Host} = inet:gethostname(), list_to_atom(atom_to_list(Name) ++ "@" ++ Host). -kill_slaves(Case, [Node|Nodes]) -> - Prefix = nodeprefix(Case), - case lists:prefix(Prefix,atom_to_list(Node)) of - true -> - rpc:call(Node,erlang,halt,[]); - _ -> - ok - end, - kill_slaves(Case,Nodes); -kill_slaves(_,[]) -> +kill_slaves([Name|Names]) -> + _ = rpc:call(fullname(Name),erlang,halt,[]), + kill_slaves(Names); +kill_slaves([]) -> ok. start_slave(Name) -> + start_slave(node(),Name). + +start_slave(FromNode,Name) -> {ok, HostStr}=inet:gethostname(), Host = list_to_atom(HostStr), - ct_slave:start(Host,Name, - [{boot_timeout,10}, % extending some timers for slow test hosts - {init_timeout,10}, - {startup_timeout,10}]). + rpc:call(FromNode,ct_slave,start, + [Host,Name, + [{boot_timeout,15}, % extending some timers for slow test hosts + {init_timeout,15}, + {startup_timeout,15}]]). diff --git a/lib/common_test/test/ct_repeat_testrun_SUITE.erl b/lib/common_test/test/ct_repeat_testrun_SUITE.erl index 7ec384c932..35d67a10f2 100644 --- a/lib/common_test/test/ct_repeat_testrun_SUITE.erl +++ b/lib/common_test/test/ct_repeat_testrun_SUITE.erl @@ -51,8 +51,8 @@ %% least 20 seconds (10 sec for each r1_SUITE:tc1) %% -define(t1,30). % time shall expire during second run of r1_SUITE --define(t2,6). % time shall expire during first run of tc1 --define(t3,16). % time shall expire during second run of tc1 +-define(t2,9). % time shall expire during first run of tc1 +-define(t3,19). % time shall expire during second run of tc1 %%-------------------------------------------------------------------- diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl index b1e1787f18..752037042d 100644 --- a/lib/reltool/test/reltool_server_SUITE.erl +++ b/lib/reltool/test/reltool_server_SUITE.erl @@ -2595,8 +2595,8 @@ start_node(Name, ErlPath, Args0) -> %io:format("open_port({spawn_executable, ~p}, [{args,~p}])~n",[ErlPath,Args]), case open_port({spawn_executable, ErlPath}, [{args,Args}]) of Port when is_port(Port) -> - unlink(Port), - erlang:port_close(Port), + %% no need to close port since node is detached (see + %% mk_node_args) so port will be closed anyway. case ping_node(FullName, 50) of ok -> {ok, FullName}; Other -> exit({failed_to_start_node, FullName, Other}) @@ -2629,7 +2629,7 @@ mk_node_args(Name, Args) -> end, {ok, Pwd} = file:get_cwd(), NameStr = atom_to_list(Name), - ["-detached", "-noinput", + ["-detached", NameSw, NameStr, "-pa", Pa, "-env", "ERL_CRASH_DUMP", Pwd ++ "/erl_crash_dump." ++ NameStr, diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl index 97ba70c9bd..a56924d5ca 100644 --- a/lib/sasl/test/release_handler_SUITE.erl +++ b/lib/sasl/test/release_handler_SUITE.erl @@ -1112,10 +1112,10 @@ otp_9395_update_many_mods(Conf) when is_list(Conf) -> true = rpc:call(Node,erlang,check_old_code,[m10]), %% Run check_install_release with purge before install this time - {TCheck,{ok, _RelVsn1, []}} = + {_TCheck,{ok, _RelVsn1, []}} = timer:tc(rpc,call,[Node, release_handler, check_install_release, [RelVsn2,[purge]]]), -% ct:log("check_install_release with purge: ~.2f",[TCheck/1000000]), +% ct:log("check_install_release with purge: ~.2f",[_TCheck/1000000]), %% Finally install release after check and purge, and check that %% this install was faster than the first. @@ -1209,10 +1209,10 @@ otp_9395_rm_many_mods(Conf) when is_list(Conf) -> true = rpc:call(Node,erlang,check_old_code,[m10]), %% Run check_install_release with purge before install this time - {TCheck,{ok, _RelVsn1, []}} = + {_TCheck,{ok, _RelVsn1, []}} = timer:tc(rpc,call,[Node, release_handler, check_install_release, [RelVsn2,[purge]]]), -% ct:log("check_install_release with purge: ~.2f",[TCheck/1000000]), +% ct:log("check_install_release with purge: ~.2f",[_TCheck/1000000]), %% Finally install release after check and purge, and check that %% this install was faster than the first. |