diff options
author | Björn Gustavsson <[email protected]> | 2013-03-14 14:54:07 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-03-14 14:54:07 +0100 |
commit | 2251b9344c2e5d0ba5d43f89a1ad896c1e67cb0c (patch) | |
tree | 169caa76a1c314684b699a0eb2cdf7581ce76dc4 /lib/common_test/test/ct_cover_SUITE.erl | |
parent | 59ab7fcb61da503f7a25d6d85fa555b4d9be5f8f (diff) | |
parent | 5f764a80aab1af1bbae170f8819fe3c3393b0cb6 (diff) | |
download | otp-2251b9344c2e5d0ba5d43f89a1ad896c1e67cb0c.tar.gz otp-2251b9344c2e5d0ba5d43f89a1ad896c1e67cb0c.tar.bz2 otp-2251b9344c2e5d0ba5d43f89a1ad896c1e67cb0c.zip |
Merge branch 'maint'
* maint:
[sasl] Fix tests that compare execution time
Prepare release
PER: Ensure that the complete encoding is at least one byte
PER/UPER: Correct decoding of ENUMERATEDs with a single value
[jinterface] Kill process between tests to avoid consequential error
[observer] Extend timer to allow trace msgs to arrive over tcp/ip
[observer] Kill slave node between tests in etop_SUITE
[observer] Accept current function for a process to be 'undefined' on hipe
[observer] Improve measurement of CPU utilization in etop
[observer] Fix non tail-recusive loop when measuring scheduler utilization
[jinterface] Make tests handle space in path on windows
[common_test] Extend timers for slave nodes in ct_cover_SUITE
[test_server] Clean up unused code in test_server_SUITE
[reltool] Increase timetrap timeout for reltool_server_SUTIE to 10 minutes
[test_server] Fix encoding of HTML file references to work on windows
[test_server] Use simpler tc name in unicode test to make it work on windows
Diffstat (limited to 'lib/common_test/test/ct_cover_SUITE.erl')
-rw-r--r-- | lib/common_test/test/ct_cover_SUITE.erl | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/lib/common_test/test/ct_cover_SUITE.erl b/lib/common_test/test/ct_cover_SUITE.erl index cb49dc423f..ec2680f664 100644 --- a/lib/common_test/test/ct_cover_SUITE.erl +++ b/lib/common_test/test/ct_cover_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2012. All Rights Reserved. +%% Copyright Ericsson AB 2012-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -59,10 +59,8 @@ init_per_testcase(TestCase, Config) -> ct_test_support:init_per_testcase(TestCase, Config). end_per_testcase(TestCase, Config) -> - Node = fullname(existing_node), - case lists:member(Node,nodes()) of - true -> rpc:call(Node,erlang,halt,[]); - false -> ok + try apply(?MODULE,TestCase,[cleanup,Config]) + catch error:undef -> ok end, ct_test_support:end_per_testcase(TestCase, Config). @@ -125,33 +123,35 @@ slave_start_slave(Config) -> %% spec file. %% Check that cover is collected from test node and slave node. cover_node_option(Config) -> - {ok, HostStr}=inet:gethostname(), - Host = list_to_atom(HostStr), DataDir = ?config(data_dir,Config), - {ok,Node} = ct_slave:start(Host,existing_node, - [{erl_flags,"-pa " ++ DataDir}]), + {ok,Node} = start_slave(existing_node_1, "-pa " ++ DataDir), false = check_cover(Node), CoverSpec = default_cover_file_content() ++ [{nodes,[Node]}], CoverFile = create_cover_file(cover_node_option,CoverSpec,Config), {ok,Events} = run_test(cover_node_option,cover_node_option, [{cover,CoverFile}],Config), check_calls(Events,2), - {ok,Node} = ct_slave:stop(existing_node), + {ok,Node} = ct_slave:stop(existing_node_1), + ok. + +cover_node_option(cleanup,_Config) -> + _ = ct_slave:stop(existing_node_1), ok. %% Test ct_cover:add_nodes/1 and ct_cover:remove_nodes/1 %% Check that cover is collected from added node ct_cover_add_remove_nodes(Config) -> - {ok, HostStr}=inet:gethostname(), - Host = list_to_atom(HostStr), DataDir = ?config(data_dir,Config), - {ok,Node} = ct_slave:start(Host,existing_node, - [{erl_flags,"-pa " ++ DataDir}]), + {ok,Node} = start_slave(existing_node_2, "-pa " ++ DataDir), false = check_cover(Node), {ok,Events} = run_test(ct_cover_add_remove_nodes,ct_cover_add_remove_nodes, [],Config), check_calls(Events,2), - {ok,Node} = ct_slave:stop(existing_node), + {ok,Node} = ct_slave:stop(existing_node_2), + ok. + +ct_cover_add_remove_nodes(cleanup,_Config) -> + _ = ct_slave:stop(existing_node_2), ok. %% Test that the test suite itself can be cover compiled and that @@ -310,3 +310,12 @@ create_cover_file(Filename,Terms,Config) -> end,Terms), ok = file:close(Fd), File. + +start_slave(Name,Args) -> + {ok, HostStr}=inet:gethostname(), + Host = list_to_atom(HostStr), + ct_slave:start(Host,Name, + [{erl_flags,Args}, + {boot_timeout,10}, % extending some timers for slow test hosts + {init_timeout,10}, + {startup_timeout,10}]). |