diff options
author | Lukas Larsson <[email protected]> | 2010-10-12 10:38:51 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-02-17 17:25:13 +0100 |
commit | 8bd07f450816eaaae52d28740d89ead1f930cd02 (patch) | |
tree | 0dd5bb7fdaa94978d9326c693f94bb992229b0c2 | |
parent | 670f41232381c6c1a47101349567caf9303dea8f (diff) | |
download | otp-8bd07f450816eaaae52d28740d89ead1f930cd02.tar.gz otp-8bd07f450816eaaae52d28740d89ead1f930cd02.tar.bz2 otp-8bd07f450816eaaae52d28740d89ead1f930cd02.zip |
Update kernel tests to conform with common_test standard
41 files changed, 1013 insertions, 562 deletions
diff --git a/lib/kernel/test/Makefile b/lib/kernel/test/Makefile index f84b343de8..5f8f3a6bf6 100644 --- a/lib/kernel/test/Makefile +++ b/lib/kernel/test/Makefile @@ -142,7 +142,7 @@ release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR) $(INSTALL_DATA) $(APP_FILES) $(RELSYSDIR) - $(INSTALL_DATA) kernel.dynspec $(EMAKEFILE)\ + $(INSTALL_DATA) kernel.spec $(EMAKEFILE)\ $(COVERFILE) $(RELSYSDIR) chmod -f -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) diff --git a/lib/kernel/test/application_SUITE.erl b/lib/kernel/test/application_SUITE.erl index 810689b4a3..d4912680ec 100644 --- a/lib/kernel/test/application_SUITE.erl +++ b/lib/kernel/test/application_SUITE.erl @@ -18,9 +18,9 @@ %% -module(application_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, failover/1, failover_comp/1, permissions/1, load/1, reported_bugs/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, failover/1, failover_comp/1, permissions/1, load/1, load_use_cache/1, otp_1586/1, otp_2078/1, otp_2012/1, otp_2718/1, otp_2973/1, otp_3002/1, otp_3184/1, otp_4066/1, otp_4227/1, otp_5363/1, @@ -30,7 +30,7 @@ nodedown_start/1, init2973/0, loop2973/0, loop5606/1]). -export([config_change/1, - distr_changed/1, distr_changed_tc1/1, distr_changed_tc2/1, + distr_changed_tc1/1, distr_changed_tc2/1, shutdown_func/1, do_shutdown/1]). -define(TESTCASE, testcase_name). @@ -41,12 +41,27 @@ % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(2)). -all(suite) -> - [failover, failover_comp, permissions, load, - load_use_cache, reported_bugs, - start_phases, script_start, nodedown_start, - permit_false_start_local, permit_false_start_dist, - get_key, distr_changed, config_change, shutdown_func]. +all() -> +[failover, failover_comp, permissions, load, + load_use_cache, {group, reported_bugs}, start_phases, + script_start, nodedown_start, permit_false_start_local, + permit_false_start_dist, get_key, + {group, distr_changed}, config_change, shutdown_func]. + +groups() -> + [{reported_bugs, [], + [otp_1586, otp_2078, otp_2012, otp_2718, otp_2973, + otp_3002, otp_3184, otp_4066, otp_4227, otp_5363, + otp_5606]}, + {distr_changed, [], + [distr_changed_tc1, distr_changed_tc2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(otp_2973=Case, Config) -> @@ -932,9 +947,6 @@ nodedown_start(Conf) when is_list(Conf) -> %%%----------------------------------------------------------------- %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> [otp_1586, otp_2078, otp_2012, otp_2718, - otp_2973, otp_3002, otp_3184, otp_4066, - otp_4227, otp_5363, otp_5606]. %%----------------------------------------------------------------- %% Ticket: OTP-1586 @@ -1589,7 +1601,6 @@ get_key(Conf) when is_list(Conf) -> %%%----------------------------------------------------------------- %%% Testing of change of distributed parameter. %%%----------------------------------------------------------------- -distr_changed(suite) -> [distr_changed_tc1, distr_changed_tc2]. distr_changed_tc1(suite) -> []; distr_changed_tc1(doc) -> ["Test change of distributed parameter."]; diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index 47532b0db4..c8ee765dba 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -17,15 +17,15 @@ %% %CopyrightEnd% %% -module(bif_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). --export([spawn_tests/1, +-export([ spawn1/1, spawn2/1, spawn3/1, spawn4/1, - spawn_link_tests/1, + spawn_link1/1, spawn_link2/1, spawn_link3/1, spawn_link4/1, - spawn_opt_tests/1, + spawn_opt2/1, spawn_opt3/1, spawn_opt4/1, spawn_opt5/1, spawn_failures/1, @@ -35,7 +35,7 @@ -export([init_per_testcase/2, end_per_testcase/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). @@ -48,20 +48,26 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [spawn_tests, spawn_link_tests, spawn_opt_tests, spawn_failures, wilderness]. +all() -> +[{group, spawn_tests}, {group, spawn_link_tests}, + {group, spawn_opt_tests}, spawn_failures, wilderness]. + +groups() -> + [{spawn_tests, [], [spawn1, spawn2, spawn3, spawn4]}, + {spawn_link_tests, [], + [spawn_link1, spawn_link2, spawn_link3, spawn_link4]}, + {spawn_opt_tests, [], + [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -spawn_tests(doc) -> ["Test spawn"]; -spawn_tests(suite) -> - [spawn1, spawn2, spawn3, spawn4]. -spawn_link_tests(doc) -> ["Test spawn_link"]; -spawn_link_tests(suite) -> - [spawn_link1, spawn_link2, spawn_link3, spawn_link4]. -spawn_opt_tests(doc) -> ["Test spawn_opt"]; -spawn_opt_tests(suite) -> - [spawn_opt2, spawn_opt3, spawn_opt4, spawn_opt5]. spawn1(doc) -> ["Test spawn/1"]; spawn1(suite) -> diff --git a/lib/kernel/test/cleanup.erl b/lib/kernel/test/cleanup.erl index 831ceba8f5..7fb00b4305 100644 --- a/lib/kernel/test/cleanup.erl +++ b/lib/kernel/test/cleanup.erl @@ -18,11 +18,22 @@ %% -module(cleanup). --export([all/1, cleanup/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, cleanup/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[cleanup]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> {req, [kernel], [cleanup]}. cleanup(suite) -> []; cleanup(_) -> diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl index a5fcaf188d..0f3a79f183 100644 --- a/lib/kernel/test/code_SUITE.erl +++ b/lib/kernel/test/code_SUITE.erl @@ -18,9 +18,9 @@ %% -module(code_SUITE). --include("test_server.hrl"). -%-compile(export_all). --export([all/1]). +-include_lib("test_server/include/test_server.hrl"). + +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([set_path/1, get_path/1, add_path/1, add_paths/1, del_path/1, replace_path/1, load_file/1, load_abs/1, ensure_loaded/1, delete/1, purge/1, soft_purge/1, is_loaded/1, all_loaded/1, @@ -43,19 +43,27 @@ handle_event/2, handle_call/2, handle_info/2, terminate/2]). -all(suite) -> +all() -> [set_path, get_path, add_path, add_paths, del_path, replace_path, load_file, load_abs, ensure_loaded, delete, purge, soft_purge, is_loaded, all_loaded, load_binary, dir_req, object_code, set_path_file, - pa_pz_option, add_del_path, - dir_disappeared, ext_mod_dep, clash, - load_cached, start_node_with_cache, add_and_rehash, - where_is_file_no_cache, where_is_file_cached, - purge_stacktrace, mult_lib_roots, bad_erl_libs, - code_archive, code_archive2, on_load, on_load_embedded, - big_boot_embedded, - on_load_errors, native_early_modules]. + pa_pz_option, add_del_path, dir_disappeared, + ext_mod_dep, clash, load_cached, start_node_with_cache, + add_and_rehash, where_is_file_no_cache, + where_is_file_cached, purge_stacktrace, mult_lib_roots, + bad_erl_libs, code_archive, code_archive2, on_load, + on_load_embedded, big_boot_embedded, on_load_errors, + native_early_modules]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. init_per_suite(Config) -> %% The compiler will no longer create a Beam file if @@ -76,7 +84,17 @@ init_per_testcase(_Func, Config) -> P=code:get_path(), P=code:get_path(), [{watchdog, Dog}, {code_path, P}|Config]. + +end_per_testcase(mult_lib_roots, Config) -> + {ok, HostName} = inet:gethostname(), + NodeName = list_to_atom("mult_lib_roots@"++HostName), + ?t:stop_node(NodeName), + end_per_testcase(Config); end_per_testcase(_Func, Config) -> + end_per_testcase(Config). + +end_per_testcase(Config) -> + code:purge(code_b_test), Dog=?config(watchdog, Config), ?t:timetrap_cancel(Dog), P=?config(code_path, Config), @@ -906,6 +924,8 @@ add_and_rehash(Config) when is_list(Config) -> ?line true = rpc:call(Node, code, add_path, [OkDir]), ?line {error,_} = rpc:call(Node, code, add_path, [BadDir]), ?line ok = rpc:call(Node, code, rehash, []), + + ?t:stop_node(Node), ok. where_is_file_no_cache(suite) -> @@ -1007,9 +1027,9 @@ mult_lib_roots(Config) when is_list(Config) -> ?t:start_node(mult_lib_roots, slave, [{args,"-env ERL_LIBS "++ErlLibs}]), - ?line {ok,Cwd} = file:get_cwd(), + ?line TSPath = filename:dirname(code:which(test_server)), ?line Path0 = rpc:call(Node, code, get_path, []), - ?line [Cwd,"."|Path1] = Path0, + ?line [TSPath,"."|Path1] = Path0, ?line [Kernel|Path2] = Path1, ?line [Stdlib|Path3] = Path2, ?line mult_lib_verify_lib(Kernel, "kernel"), @@ -1028,7 +1048,6 @@ mult_lib_roots(Config) when is_list(Config) -> ?line true = rpc:call(Node, code_SUITE_mult_root_module, works_fine, []), - ?line ?t:stop_node(Node), ok. mult_lib_compile(Root, Last) -> diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl index f3fa2921ed..e7647c251b 100644 --- a/lib/kernel/test/disk_log_SUITE.erl +++ b/lib/kernel/test/disk_log_SUITE.erl @@ -28,46 +28,46 @@ -define(config(X,Y), foo). -define(t,test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir(Conf), ?config(priv_dir, Conf)). -define(datadir(Conf), ?config(data_dir, Conf)). -endif. --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, - halt_int/1, halt_int_inf/1, halt_int_sz/1, + halt_int_inf/1, halt_int_sz_1/1, halt_int_sz_2/1, - read_mode/1, halt_int_ro/1, halt_ext_ro/1, wrap_int_ro/1, + halt_int_ro/1, halt_ext_ro/1, wrap_int_ro/1, wrap_ext_ro/1, halt_trunc/1, halt_misc/1, halt_ro_alog/1, halt_ro_balog/1, halt_ro_crash/1, - wrap_int/1, wrap_int_1/1, wrap_int_2/1, inc_wrap_file/1, + wrap_int_1/1, wrap_int_2/1, inc_wrap_file/1, - halt_ext/1, halt_ext_inf/1, + halt_ext_inf/1, - halt_ext_sz/1, halt_ext_sz_1/1, halt_ext_sz_2/1, + halt_ext_sz_1/1, halt_ext_sz_2/1, - wrap_ext/1, wrap_ext_1/1, wrap_ext_2/1, + wrap_ext_1/1, wrap_ext_2/1, - head/1, head_func/1, plain_head/1, one_header/1, + head_func/1, plain_head/1, one_header/1, - notif/1, wrap_notif/1, full_notif/1, trunc_notif/1, blocked_notif/1, + wrap_notif/1, full_notif/1, trunc_notif/1, blocked_notif/1, new_idx_vsn/1, reopen/1, - block/1, block_blocked/1, block_queue/1, block_queue2/1, + block_blocked/1, block_queue/1, block_queue2/1, unblock/1, - open/1, open_overwrite/1, open_size/1, open_truncate/1, open_error/1, + open_overwrite/1, open_size/1, open_truncate/1, open_error/1, - close/1, close_race/1, close_block/1, close_deadlock/1, + close_race/1, close_block/1, close_deadlock/1, - error/1, error_repair/1, error_log/1, error_index/1, + error_repair/1, error_log/1, error_index/1, chunk/1, @@ -75,15 +75,15 @@ many_users/1, - info/1, info_current/1, + info_current/1, - change_size/1, change_size_before/1, change_size_during/1, + change_size_before/1, change_size_during/1, change_size_after/1, default_size/1, change_size2/1, change_size_truncate/1, change_attribute/1, - distribution/1, dist_open/1, dist_error_open/1, dist_notify/1, + dist_open/1, dist_error_open/1, dist_notify/1, dist_terminate/1, dist_accessible/1, dist_deadlock/1, dist_open2/1, other_groups/1, @@ -142,8 +142,51 @@ change_size_after, default_size]). -all(suite) -> - ?ALL_TESTS. +all() -> +[{group, halt_int}, {group, wrap_int}, + {group, halt_ext}, {group, wrap_ext}, + {group, read_mode}, {group, head}, {group, notif}, + new_idx_vsn, reopen, {group, block}, unblock, + {group, open}, {group, close}, {group, error}, chunk, + truncate, many_users, {group, info}, + {group, change_size}, change_attribute, + {group, distribution}, evil, otp_6278]. + +groups() -> + [{halt_int, [], [halt_int_inf, {group, halt_int_sz}]}, + {halt_int_sz, [], [halt_int_sz_1, halt_int_sz_2]}, + {read_mode, [], + [halt_int_ro, halt_ext_ro, wrap_int_ro, wrap_ext_ro, + halt_trunc, halt_misc, halt_ro_alog, halt_ro_balog, + halt_ro_crash]}, + {wrap_int, [], [wrap_int_1, wrap_int_2, inc_wrap_file]}, + {halt_ext, [], [halt_ext_inf, {group, halt_ext_sz}]}, + {halt_ext_sz, [], [halt_ext_sz_1, halt_ext_sz_2]}, + {wrap_ext, [], [wrap_ext_1, wrap_ext_2]}, + {head, [], [head_func, plain_head, one_header]}, + {notif, [], + [wrap_notif, full_notif, trunc_notif, blocked_notif]}, + {block, [], [block_blocked, block_queue, block_queue2]}, + {open, [], + [open_overwrite, open_size, open_truncate, open_error]}, + {close, [], [close_race, close_block, close_deadlock]}, + {error, [], [error_repair, error_log, error_index]}, + {info, [], [info_current]}, + {change_size, [], + [change_size_before, change_size_during, + change_size_after, default_size, change_size2, + change_size_truncate]}, + {distribution, [], + [dist_open, dist_error_open, dist_notify, + dist_terminate, dist_accessible, dist_deadlock, + dist_open2, other_groups]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Case, Config) -> @@ -172,7 +215,6 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -halt_int(suite) -> [halt_int_inf, halt_int_sz]. halt_int_inf(suite) -> []; halt_int_inf(doc) -> ["Test simple halt disk log, size infinity"]; @@ -187,7 +229,6 @@ halt_int_inf(Conf) when is_list(Conf) -> ?line ok = disk_log:close(a), ?line ok = file:delete(File). -halt_int_sz(suite) -> [halt_int_sz_1, halt_int_sz_2]. halt_int_sz_1(suite) -> []; halt_int_sz_1(doc) -> ["Test simple halt disk log, size defined"]; @@ -275,10 +316,6 @@ halt_int_sz_2(Conf) when is_list(Conf) -> ?line ok = file:delete(File3), ok. -read_mode(suite) -> [halt_int_ro, halt_ext_ro, - wrap_int_ro, wrap_ext_ro, - halt_trunc, halt_misc, halt_ro_alog, halt_ro_balog, - halt_ro_crash]. halt_int_ro(suite) -> []; halt_int_ro(doc) -> ["Test simple halt disk log, read only, internal"]; @@ -480,7 +517,6 @@ halt_ro_crash(Conf) when is_list(Conf) -> -wrap_int(suite) -> [wrap_int_1, wrap_int_2, inc_wrap_file]. wrap_int_1(suite) -> []; wrap_int_1(doc) -> ["Test wrap disk log, internal"]; @@ -628,7 +664,6 @@ inc_wrap_file(Conf) when is_list(Conf) -> -halt_ext(suite) -> [halt_ext_inf, halt_ext_sz]. halt_ext_inf(suite) -> []; halt_ext_inf(doc) -> ["Test halt disk log, external, infinity"]; @@ -642,7 +677,6 @@ halt_ext_inf(Conf) when is_list(Conf) -> ?line ok = disk_log:close(a), ?line ok = file:delete(File). -halt_ext_sz(suite) -> [halt_ext_sz_1, halt_ext_sz_2]. halt_ext_sz_1(suite) -> []; halt_ext_sz_1(doc) -> ["Test halt disk log, external, size defined"]; @@ -734,7 +768,6 @@ halt_ext_sz_2(Conf) when is_list(Conf) -> ?line ok = file:delete(File3), ok. -wrap_ext(suite) -> [wrap_ext_1, wrap_ext_2]. wrap_ext_1(suite) -> []; wrap_ext_1(doc) -> ["Test wrap disk log, external, size defined"]; @@ -1147,7 +1180,6 @@ end_times({T1,W1}) -> {W2, _} = statistics(wall_clock), {T2-T1, W2-W1}. -head(suite) -> [head_func, plain_head, one_header]. head_func(suite) -> []; head_func(doc) -> ["Test head parameter"]; @@ -1327,8 +1359,6 @@ one_header(Conf) when is_list(Conf) -> ok. -notif(suite) -> [wrap_notif, full_notif, trunc_notif, - blocked_notif]. wrap_notif(suite) -> []; wrap_notif(doc) -> ["Test notify parameter, wrap"]; @@ -1553,7 +1583,6 @@ reopen(Conf) when is_list(Conf) -> ?line Q = qlen(), ok. -block(suite) -> [block_blocked, block_queue, block_queue2]. block_blocked(suite) -> []; block_blocked(doc) -> @@ -1826,8 +1855,6 @@ try_unblock(Log) -> ?line Error = {error, {not_blocked_by_pid, n}} = disk_log:unblock(Log), ?line "The disk log" ++ _ = format_error(Error). -open(suite) -> [open_overwrite, open_size, - open_truncate, open_error]. open_overwrite(suite) -> []; open_overwrite(doc) -> @@ -2075,7 +2102,6 @@ open_error(Conf) when is_list(Conf) -> ?line del(File, No). -close(suite) -> [close_race, close_block, close_deadlock]. close_race(suite) -> []; close_race(doc) -> @@ -2497,7 +2523,6 @@ lserv(Log) -> end, lserv(Log). -error(suite) -> [error_repair, error_log, error_index]. error_repair(suite) -> []; error_repair(doc) -> @@ -3215,7 +3240,6 @@ del_files(_Size, File) -> -info(suite) -> [info_current]. info_current(suite) -> []; info_current(doc) -> @@ -3420,11 +3444,6 @@ info_current(Conf) when is_list(Conf) -> ok. -change_size(suite) -> [change_size_before, - change_size_during, - change_size_after, - default_size, change_size2, - change_size_truncate]. change_size_before(suite) -> []; change_size_before(doc) -> @@ -4094,13 +4113,6 @@ change_attribute(Conf) when is_list(Conf) -> ?line Q = qlen(), ?line del(File, No). -distribution(suite) -> [dist_open, dist_error_open, - dist_notify, - dist_terminate, - dist_accessible, - dist_deadlock, - dist_open2, - other_groups]. dist_open(suite) -> []; dist_open(doc) -> diff --git a/lib/kernel/test/erl_boot_server_SUITE.erl b/lib/kernel/test/erl_boot_server_SUITE.erl index a4319eb3c1..b9c632ed9a 100644 --- a/lib/kernel/test/erl_boot_server_SUITE.erl +++ b/lib/kernel/test/erl_boot_server_SUITE.erl @@ -18,9 +18,9 @@ %% -module(erl_boot_server_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([start/1, start_link/1, stop/1, add/1, delete/1, responses/1]). @@ -33,8 +33,18 @@ %% Changed for the new erl_boot_server for R3A by Bjorn Gustavsson. %%----------------------------------------------------------------- -all(suite) -> - [start, start_link, stop, add, delete, responses]. +all() -> +[start, start_link, stop, add, delete, responses]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -define(all_ones, {255, 255, 255, 255}). diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl index 047bedfa74..96589b6165 100644 --- a/lib/kernel/test/erl_distribution_SUITE.erl +++ b/lib/kernel/test/erl_distribution_SUITE.erl @@ -19,13 +19,13 @@ -module(erl_distribution_SUITE). %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([tick/1, tick_change/1, illegal_nodenames/1, hidden_node/1, table_waste/1, net_setuptime/1, - monitor_nodes/1, + monitor_nodes_nodedown_reason/1, monitor_nodes_complex_nodedown_reason/1, monitor_nodes_node_type/1, @@ -57,10 +57,25 @@ %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -all(suite) -> - [tick, tick_change, illegal_nodenames, hidden_node, - table_waste, net_setuptime, - monitor_nodes]. +all() -> +[tick, tick_change, illegal_nodenames, hidden_node, + table_waste, net_setuptime, {group, monitor_nodes}]. + +groups() -> + [{monitor_nodes, [], + [monitor_nodes_nodedown_reason, + monitor_nodes_complex_nodedown_reason, + monitor_nodes_node_type, monitor_nodes_misc, + monitor_nodes_otp_6481, monitor_nodes_errors, + monitor_nodes_combinations, monitor_nodes_cleanup, + monitor_nodes_many]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(4)), @@ -530,18 +545,6 @@ check_monitor_nodes_res(Pid, Node) -> end. -monitor_nodes(doc) -> - []; -monitor_nodes(suite) -> - [monitor_nodes_nodedown_reason, - monitor_nodes_complex_nodedown_reason, - monitor_nodes_node_type, - monitor_nodes_misc, - monitor_nodes_otp_6481, - monitor_nodes_errors, - monitor_nodes_combinations, - monitor_nodes_cleanup, - monitor_nodes_many]. %% %% Testcase: diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl index 83f9d09a4b..e34663496a 100644 --- a/lib/kernel/test/erl_distribution_wb_SUITE.erl +++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl @@ -18,10 +18,10 @@ %% -module(erl_distribution_wb_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2, whitebox/1, switch_options/1, missing_compulsory_dflags/1]). @@ -77,8 +77,18 @@ -define(u32(X3,X2,X1,X0), (((X3) bsl 24) bor ((X2) bsl 16) bor ((X1) bsl 8) bor (X0))). -all(suite) -> - [whitebox,switch_options,missing_compulsory_dflags]. +all() -> +[whitebox, switch_options, missing_compulsory_dflags]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(1)), diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl index 39007bf085..f68ce4f8f7 100644 --- a/lib/kernel/test/erl_prim_loader_SUITE.erl +++ b/lib/kernel/test/erl_prim_loader_SUITE.erl @@ -19,9 +19,9 @@ -module(erl_prim_loader_SUITE). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([get_path/1, set_path/1, get_file/1, inet_existing/1, inet_coming_up/1, inet_disconnects/1, @@ -35,15 +35,21 @@ %% Test suite for erl_prim_loader. (Most code is run during system start/stop.) %%----------------------------------------------------------------- -all(suite) -> - [ - get_path, set_path, get_file, - inet_existing, inet_coming_up, - inet_disconnects, multiple_slaves, - file_requests, local_archive, - remote_archive, primary_archive, - virtual_dir_in_archive - ]. +all() -> +[get_path, set_path, get_file, inet_existing, + inet_coming_up, inet_disconnects, multiple_slaves, + file_requests, local_archive, remote_archive, + primary_archive, virtual_dir_in_archive]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:minutes(3)), @@ -291,7 +297,6 @@ wait_and_shutdown([], _) -> ok. -file_requests(suite) -> {req, [{local_slave_nodes, 1}, {time, 10}]}; file_requests(doc) -> ["Start a node using the 'inet' loading method, ", "verify that the boot server responds to file requests."]; file_requests(Config) when is_list(Config) -> @@ -300,9 +305,11 @@ file_requests(Config) when is_list(Config) -> %% compare with results from file server calls (the %% boot server uses the same file sys and cwd) {ok,Files} = file:list_dir("."), + io:format("Files: ~p~n",[Files]), ?line {ok,Files} = rpc:call(Node, erl_prim_loader, list_dir, ["."]), - {ok,Info} = file:read_file_info("test_server.beam"), - ?line {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info, ["test_server.beam"]), + {ok,Info} = file:read_file_info(code:which(test_server)), + ?line {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info, + [code:which(test_server)]), {ok,Cwd} = file:get_cwd(), ?line {ok,Cwd} = rpc:call(Node, erl_prim_loader, get_cwd, []), case file:get_cwd("C:") of diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl index eda86861d5..90fdd4a00a 100644 --- a/lib/kernel/test/error_logger_SUITE.erl +++ b/lib/kernel/test/error_logger_SUITE.erl @@ -18,7 +18,7 @@ %% -module(error_logger_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%----------------------------------------------------------------- %% We don't have to test the normal behaviour here, i.e. the tty @@ -27,7 +27,7 @@ %% error_logger deliver the expected events. %%----------------------------------------------------------------- --export([all/1, error_report/1, info_report/1, error/1, info/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, error_report/1, info_report/1, error/1, info/1, emulator/1, tty/1, logfile/1, add/1, delete/1]). -export([generate_error/0]). @@ -37,9 +37,19 @@ terminate/2]). -all(suite) -> - [error_report, info_report, error, info, - emulator, tty, logfile, add, delete]. +all() -> +[error_report, info_report, error, info, emulator, tty, + logfile, add, delete]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%----------------------------------------------------------------- diff --git a/lib/kernel/test/error_logger_warn_SUITE.erl b/lib/kernel/test/error_logger_warn_SUITE.erl index 626e35dbb2..85a2a0a303 100644 --- a/lib/kernel/test/error_logger_warn_SUITE.erl +++ b/lib/kernel/test/error_logger_warn_SUITE.erl @@ -18,7 +18,7 @@ %% -module(error_logger_warn_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2, basic/1,warnings_info/1,warnings_warnings/1, rb_basic/1,rb_warnings_info/1,rb_warnings_warnings/1, rb_trunc/1,rb_utc/1,file_utc/1]). @@ -26,7 +26,7 @@ %% Internal exports. -export([init/1,handle_event/2,handle_info/2,handle_call/2]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(EXPECT(Pattern), (fun() -> @@ -43,10 +43,20 @@ -define(default_timeout, ?t:minutes(1)). -all(suite) -> - [basic, warnings_info, warnings_warnings, - rb_basic, rb_warnings_info, rb_warnings_warnings, - rb_trunc,rb_utc, file_utc]. +all() -> +[basic, warnings_info, warnings_warnings, rb_basic, + rb_warnings_info, rb_warnings_warnings, rb_trunc, + rb_utc, file_utc]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog = ?t:timetrap(?default_timeout), diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 596fe301b5..c75b8c03a2 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -40,29 +40,29 @@ -module(?FILE_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1, init_per_testcase/2, end_per_testcase/2, - read_write_file/1, dirs/1, files/1, names/1]). + read_write_file/1, names/1]). -export([cur_dir_0/1, cur_dir_1/1, make_del_dir/1, - pos/1, pos1/1, pos2/1]). --export([close/1, consult/1, consult1/1, path_consult/1, delete/1]). --export([eval/1, eval1/1, path_eval/1, script/1, script1/1, path_script/1, - open/1, open1/1, + pos1/1, pos2/1]). +-export([close/1, consult1/1, path_consult/1, delete/1]). +-export([ eval1/1, path_eval/1, script1/1, path_script/1, + open1/1, old_modes/1, new_modes/1, path_open/1, open_errors/1]). --export([file_info/1, file_info_basic_file/1, file_info_basic_directory/1, +-export([ file_info_basic_file/1, file_info_basic_directory/1, file_info_bad/1, file_info_times/1, file_write_file_info/1]). -export([rename/1, access/1, truncate/1, datasync/1, sync/1, read_write/1, pread_write/1, append/1, exclusive/1]). --export([errors/1, e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). +-export([ e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). -export([otp_5814/1]). --export([compression/1, read_not_really_compressed/1, +-export([ read_not_really_compressed/1, read_compressed_cooked/1, read_compressed_cooked_binary/1, read_cooked_tar_problem/1, write_compressed/1, compress_errors/1, catenated_gzips/1]). --export([links/1, make_link/1, read_link_info_for_non_link/1, symlinks/1]). +-export([ make_link/1, read_link_info_for_non_link/1, symlinks/1]). -export([copy/1]). @@ -93,21 +93,52 @@ --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -all(suite) -> - {conf, init, - [altname, read_write_file, dirs, files, - delete, rename, names, errors, - compression, links, copy, - delayed_write, read_ahead, segment_read, segment_write, - ipread, pid2name, interleaved_read_write, - otp_5814, large_file, read_line_1, read_line_2, read_line_3, read_line_4, - standard_io], - fini}. +all() -> +[altname, read_write_file, {group, dirs}, + {group, files}, delete, rename, names, {group, errors}, + {group, compression}, {group, links}, copy, + delayed_write, read_ahead, segment_read, segment_write, + ipread, pid2name, interleaved_read_write, otp_5814, + large_file, read_line_1, read_line_2, read_line_3, + read_line_4, standard_io]. + +groups() -> + [{dirs, [], [make_del_dir, cur_dir_0, cur_dir_1]}, + {files, [], + [{group, open}, {group, pos}, {group, file_info}, + {group, consult}, {group, eval}, {group, script}, + truncate, sync, datasync, advise]}, + {open, [], + [open1, old_modes, new_modes, path_open, close, access, + read_write, pread_write, append, open_errors, + exclusive]}, + {pos, [], [pos1, pos2]}, + {file_info, [], + [file_info_basic_file, file_info_basic_directory, + file_info_bad, file_info_times, file_write_file_info]}, + {consult, [], [consult1, path_consult]}, + {eval, [], [eval1, path_eval]}, + {script, [], [script1, path_script]}, + {errors, [], + [e_delete, e_rename, e_make_dir, e_del_dir]}, + {compression, [], + [read_compressed_cooked, read_compressed_cooked_binary, + read_cooked_tar_problem, read_not_really_compressed, + write_compressed, compress_errors, catenated_gzips]}, + {links, [], + [make_link, read_link_info_for_non_link, symlinks]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init(Config) when is_list(Config) -> case os:type() of @@ -314,7 +345,6 @@ read_write_file(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirs(suite) -> [make_del_dir, cur_dir_0, cur_dir_1]. make_del_dir(suite) -> []; make_del_dir(doc) -> []; @@ -461,12 +491,7 @@ win_cur_dir_1(_Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -files(suite) -> - [open,pos,file_info,consult,eval,script,truncate, - sync,datasync,advise]. -open(suite) -> [open1,old_modes,new_modes,path_open,close,access,read_write, - pread_write,append,open_errors,exclusive]. open1(suite) -> []; open1(doc) -> []; @@ -858,7 +883,6 @@ exclusive(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -pos(suite) -> [pos1,pos2]. pos1(suite) -> []; pos1(doc) -> []; @@ -950,8 +974,6 @@ pos2(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -file_info(suite) -> [file_info_basic_file, file_info_basic_directory, - file_info_bad, file_info_times, file_write_file_info]. file_info_basic_file(suite) -> []; file_info_basic_file(doc) -> []; @@ -1217,7 +1239,6 @@ file_write_file_info(Config) when is_list(Config) -> get_good_directory(Config) -> ?line ?config(priv_dir, Config). -consult(suite) -> [consult1, path_consult]. consult1(suite) -> []; consult1(doc) -> []; @@ -1278,7 +1299,6 @@ path_consult(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -eval(suite) -> [eval1,path_eval]. eval1(suite) -> []; eval1(doc) -> []; @@ -1351,7 +1371,6 @@ path_eval(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -script(suite) -> [script1,path_script]. script1(suite) -> []; script1(doc) -> ""; @@ -1702,7 +1721,6 @@ names(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -errors(suite) -> [e_delete, e_rename, e_make_dir, e_del_dir]. e_delete(suite) -> []; e_delete(doc) -> []; @@ -1959,12 +1977,6 @@ e_del_dir(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -compression(suite) -> - [read_compressed_cooked, read_compressed_cooked_binary, - read_cooked_tar_problem, - read_not_really_compressed, - write_compressed, compress_errors, - catenated_gzips]. %% Trying reading and positioning from a compressed file. @@ -2258,8 +2270,6 @@ altname(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), Result. -links(doc) -> "Test the link functions."; -links(suite) -> [make_link, read_link_info_for_non_link, symlinks]. make_link(doc) -> "Test creating a hard link."; make_link(suite) -> []; diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl index fbafbcd9b7..9d1315c3ab 100644 --- a/lib/kernel/test/file_name_SUITE.erl +++ b/lib/kernel/test/file_name_SUITE.erl @@ -18,7 +18,7 @@ %% %CopyrightEnd% %% --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). %% @@ -70,7 +70,9 @@ %% list_dir %% read_link --export([all/1,init_per_testcase/2, fin_per_testcase/2]). +-export([all/0,groups/0, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([normal/1,icky/1,very_icky/1,normalize/1]). @@ -78,13 +80,22 @@ init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), [{watchdog,Dog}|Config]. -fin_per_testcase(_Func, Config) -> +end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). +all() -> + [normal, icky, very_icky, normalize]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [normal,icky,very_icky,normalize]. normalize(suite) -> []; diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl index 39db6ab81c..52f3a6b057 100644 --- a/lib/kernel/test/gen_sctp_SUITE.erl +++ b/lib/kernel/test/gen_sctp_SUITE.erl @@ -18,21 +18,51 @@ %% -module(gen_sctp_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet_sctp.hrl"). %%-compile(export_all). --export([all/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0,groups/0, + init_per_suite/1,end_per_suite/1, + init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export( [basic/1, api_open_close/1,api_listen/1,api_connect_init/1,api_opts/1, xfer_min/1,xfer_active/1,def_sndrcvinfo/1,implicit_inet6/1]). -all(suite) -> - [basic, - api_open_close,api_listen,api_connect_init,api_opts, - xfer_min,xfer_active,def_sndrcvinfo,implicit_inet6]. +all() -> +[basic, api_open_close, api_listen, api_connect_init, + api_opts, xfer_min, xfer_active, def_sndrcvinfo, + implicit_inet6]. + +groups() -> + []. + +init_per_suite(Config) -> + try gen_sctp:open() of + {ok,Socket} -> + gen_sctp:close(Socket), + []; + _ -> + [] + catch + error:badarg -> + {skip,"SCTP not supported on this machine"}; + _:_ -> + Config + end. + +end_per_suite(_Conifig) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(15)), diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index b8d1b1722c..233c2535b6 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -22,19 +22,32 @@ %% are not tested here, because they are tested indirectly in this and %% and other test suites. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). --export([all/1, init_per_testcase/2, end_per_testcase/2, - t_accept/1, t_connect_timeout/1, t_accept_timeout/1, - t_connect/1, t_connect_bad/1, - t_recv/1, t_recv_timeout/1, t_recv_eof/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, + t_connect_timeout/1, t_accept_timeout/1, + t_connect_bad/1, + t_recv_timeout/1, t_recv_eof/1, t_shutdown_write/1, t_shutdown_both/1, t_shutdown_error/1, t_fdopen/1, t_implicit_inet6/1]). -all(suite) -> [t_accept, t_connect, t_recv, t_shutdown_write, - t_shutdown_both, t_shutdown_error, t_fdopen, - t_implicit_inet6]. +all() -> +[{group, t_accept}, {group, t_connect}, {group, t_recv}, + t_shutdown_write, t_shutdown_both, t_shutdown_error, + t_fdopen, t_implicit_inet6]. + +groups() -> + [{t_accept, [], [t_accept_timeout]}, + {t_connect, [], [t_connect_timeout, t_connect_bad]}, + {t_recv, [], [t_recv_timeout, t_recv_eof]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), @@ -45,7 +58,6 @@ end_per_testcase(_Func, Config) -> %%% gen_tcp:accept/1,2 -t_accept(suite) -> [t_accept_timeout]. t_accept_timeout(doc) -> "Test that gen_tcp:accept/2 (with timeout) works."; t_accept_timeout(suite) -> []; @@ -55,7 +67,6 @@ t_accept_timeout(Config) when is_list(Config) -> %%% gen_tcp:connect/X -t_connect(suite) -> [t_connect_timeout, t_connect_bad]. t_connect_timeout(doc) -> "Test that gen_tcp:connect/4 (with timeout) works."; t_connect_timeout(Config) when is_list(Config) -> @@ -84,7 +95,6 @@ t_connect_bad(Config) when is_list(Config) -> %%% gen_tcp:recv/X -t_recv(suite) -> [t_recv_timeout, t_recv_eof]. t_recv_timeout(doc) -> "Test that gen_tcp:recv/3 (with timeout works)."; t_recv_timeout(suite) -> []; diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl index f45038b7c4..676dc1c593 100644 --- a/lib/kernel/test/gen_tcp_echo_SUITE.erl +++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl @@ -18,11 +18,11 @@ %% -module(gen_tcp_echo_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %%-compile(export_all). --export([all/1, init_per_testcase/2, end_per_testcase/2, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, active_echo/1, passive_echo/1, active_once_echo/1, slow_active_echo/1, slow_passive_echo/1, limit_active_echo/1, limit_passive_echo/1, @@ -31,11 +31,21 @@ -define(TPKT_VRSN, 3). -define(LINE_LENGTH, 1023). % (default value of gen_tcp option 'recbuf') - 1 -all(suite) -> - [active_echo, passive_echo, active_once_echo, - slow_active_echo, slow_passive_echo, - limit_active_echo, limit_passive_echo, - large_limit_active_echo, large_limit_passive_echo]. +all() -> +[active_echo, passive_echo, active_once_echo, + slow_active_echo, slow_passive_echo, limit_active_echo, + limit_passive_echo, large_limit_active_echo, + large_limit_passive_echo]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:minutes(5)), diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl index 8c2c4b9035..02b243a0ce 100644 --- a/lib/kernel/test/gen_tcp_misc_SUITE.erl +++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl @@ -18,11 +18,11 @@ %% -module(gen_tcp_misc_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). %-compile(export_all). --export([all/1, controlling_process/1, no_accept/1, close_with_pending_output/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, controlling_process/1, no_accept/1, close_with_pending_output/1, data_before_close/1, iter_max_socks/1, get_status/1, passive_sockets/1, accept_closed_by_other_process/1, init_per_testcase/2, end_per_testcase/2, @@ -50,22 +50,34 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). -all(suite) -> - [controlling_process, no_accept, - close_with_pending_output, - data_before_close, iter_max_socks, passive_sockets, - accept_closed_by_other_process, otp_3924, closed_socket, - shutdown_active, shutdown_passive, shutdown_pending, - default_options, http_bad_packet, - busy_send, busy_disconnect_passive, busy_disconnect_active, - fill_sendq, partial_recv_and_close, - partial_recv_and_close_2, partial_recv_and_close_3, so_priority, - primitive_accept,multi_accept_close_listen,accept_timeout, - accept_timeouts_in_order,accept_timeouts_in_order2,accept_timeouts_in_order3, - accept_timeouts_mixed, - killing_acceptor,killing_multi_acceptors,killing_multi_acceptors2, - several_accepts_in_one_go, active_once_closed, send_timeout, otp_7731, - zombie_sockets, otp_7816, otp_8102]. +all() -> +[controlling_process, no_accept, + close_with_pending_output, data_before_close, + iter_max_socks, passive_sockets, + accept_closed_by_other_process, otp_3924, closed_socket, + shutdown_active, shutdown_passive, shutdown_pending, + default_options, http_bad_packet, busy_send, + busy_disconnect_passive, busy_disconnect_active, + fill_sendq, partial_recv_and_close, + partial_recv_and_close_2, partial_recv_and_close_3, + so_priority, primitive_accept, + multi_accept_close_listen, accept_timeout, + accept_timeouts_in_order, accept_timeouts_in_order2, + accept_timeouts_in_order3, accept_timeouts_mixed, + killing_acceptor, killing_multi_acceptors, + killing_multi_acceptors2, several_accepts_in_one_go, + active_once_closed, send_timeout, otp_7731, + zombie_sockets, otp_7816, otp_8102]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + default_options(doc) -> diff --git a/lib/kernel/test/gen_udp_SUITE.erl b/lib/kernel/test/gen_udp_SUITE.erl index 1bd930b8f5..e9ae40b0cd 100644 --- a/lib/kernel/test/gen_udp_SUITE.erl +++ b/lib/kernel/test/gen_udp_SUITE.erl @@ -21,7 +21,7 @@ % because udp is not deterministic. % -module(gen_udp_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). @@ -29,17 +29,27 @@ % XXX - we should pick a port that we _know_ is closed. That's pretty hard. -define(CLOSED_PORT, 6666). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). -export([send_to_closed/1, buffer_size/1, binary_passive_recv/1, bad_address/1, read_packets/1, open_fd/1, connect/1, implicit_inet6/1]). -all(suite) -> - [send_to_closed, - buffer_size, binary_passive_recv, bad_address, read_packets, - open_fd, connect, implicit_inet6]. +all() -> +[send_to_closed, buffer_size, binary_passive_recv, + bad_address, read_packets, open_fd, connect, + implicit_inet6]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/kernel/test/global_SUITE.erl b/lib/kernel/test/global_SUITE.erl index 001debddcf..887ce059d3 100644 --- a/lib/kernel/test/global_SUITE.erl +++ b/lib/kernel/test/global_SUITE.erl @@ -20,7 +20,8 @@ %-define(line_trace, 1). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1, names/1, names_hidden/1, locks/1, locks_hidden/1, bad_input/1, names_and_locks/1, lock_die/1, name_die/1, basic_partition/1, basic_name_partition/1, @@ -42,14 +43,14 @@ -export([global_load/3, lock_global/2, lock_global2/2]). --export([ttt/1]). +-export([]). -export([mass_spawn/1]). -export([start_tracer/0, stop_tracer/0, get_trace/0]). -compile(export_all). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(NODES, [node()|nodes()]). @@ -58,40 +59,59 @@ %% The resource used by the global module. -define(GLOBAL_LOCK, global). -ttt(suite) -> - [ -%% 5&6: succeeds -%% 4&5&6: succeeds -%% 3&4&5&6: succeeds -%% 1&2&3&6: fails -%% 1&2&6: succeeds -%% 3&6: succeeds - names, names_hidden, locks, locks_hidden, - bad_input, - names_and_locks, lock_die, name_die, basic_partition, -% advanced_partition, basic_name_partition, -% stress_partition, simple_ring, simple_line, - ring]. - -all(suite) -> - case init:get_argument(ring_line) of - {ok, _} -> - [ring_line]; - _ -> - [names, names_hidden, locks, locks_hidden, - bad_input, - names_and_locks, lock_die, name_die, basic_partition, - advanced_partition, basic_name_partition, - stress_partition, simple_ring, simple_line, - ring, line, global_lost_nodes, otp_1849, - otp_3162, otp_5640, otp_5737, otp_6931, - simple_disconnect, simple_resolve, simple_resolve2, - simple_resolve3, - leftover_name, re_register_name, name_exit, - external_nodes, many_nodes, sync_0, global_groups_change, - register_1, both_known_1, lost_unregister, - mass_death, garbage_messages] - end. + +all() -> +case init:get_argument(ring_line) of + {ok, _} -> [ring_line]; + _ -> + [names, names_hidden, locks, locks_hidden, bad_input, + names_and_locks, lock_die, name_die, basic_partition, + advanced_partition, basic_name_partition, + stress_partition, simple_ring, simple_line, ring, line, + global_lost_nodes, otp_1849, otp_3162, otp_5640, + otp_5737, otp_6931, simple_disconnect, simple_resolve, + simple_resolve2, simple_resolve3, leftover_name, + re_register_name, name_exit, external_nodes, many_nodes, + sync_0, global_groups_change, register_1, both_known_1, + lost_unregister, mass_death, garbage_messages] +end. + +groups() -> + [{ttt, [], + [names, names_hidden, locks, locks_hidden, bad_input, + names_and_locks, lock_die, name_die, basic_partition, + ring]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + +init_per_suite(Config) -> + + %% Copied from test_server_ctrl ln 647, we have to do this here as + %% the test_server only does this when run without common_test + global:sync(), + case global:whereis_name(test_server) of + undefined -> + io:format(user, "Registering test_server globally!~n",[]), + global:register_name(test_server, whereis(test_server_ctrl)); + Pid -> + case node() of + N when N == node(Pid) -> + io:format(user, "Warning: test_server already running!\n", []), + global:re_register_name(test_server,self()); + _ -> + ok + end + end, + Config. + +end_per_suite(_Config) -> + global:unregister_name(test_server), + ok. + -define(TESTCASE, testcase_name). -define(testcase, ?config(?TESTCASE, Config)). diff --git a/lib/kernel/test/global_group_SUITE.erl b/lib/kernel/test/global_group_SUITE.erl index 301f1246c2..a94944c0e9 100644 --- a/lib/kernel/test/global_group_SUITE.erl +++ b/lib/kernel/test/global_group_SUITE.erl @@ -19,7 +19,8 @@ -module(global_group_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_suite/1, end_per_suite/1]). -export([start_gg_proc/1, no_gg_proc/1, no_gg_proc_sync/1, compatible/1, one_grp/1, one_grp_x/1, two_grp/1, hidden_groups/1, test_exit/1]). -export([init/1, init/2, init2/2, start_proc/1, start_proc_rereg/1]). @@ -28,16 +29,49 @@ %-compile(export_all). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(NODES, [node()|nodes()]). -define(UNTIL(Seq), loop_until_true(fun() -> Seq end)). -all(suite) -> - [start_gg_proc, no_gg_proc, no_gg_proc_sync, - compatible, one_grp, one_grp_x, two_grp, test_exit, - hidden_groups]. +all() -> +[start_gg_proc, no_gg_proc, no_gg_proc_sync, compatible, + one_grp, one_grp_x, two_grp, test_exit, hidden_groups]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +init_per_suite(Config) -> + + %% Copied from test_server_ctrl ln 647, we have to do this here as + %% the test_server only does this when run without common_test + global:sync(), + case global:whereis_name(test_server) of + undefined -> + io:format(user, "Registering test_server globally!~n",[]), + global:register_name(test_server, whereis(test_server_ctrl)); + Pid -> + case node() of + N when N == node(Pid) -> + io:format(user, "Warning: test_server already running!\n", []), + global:re_register_name(test_server,self()); + _ -> + ok + end + end, + Config. + +end_per_suite(_Config) -> + global:unregister_name(test_server), + ok. -define(TESTCASE, testcase_name). -define(testcase, ?config(?TESTCASE, Config)). diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index b739f555d0..d811183a41 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -18,9 +18,9 @@ %% -module(heart_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, ostype/1, start/1, restart/1, reboot/1, set_cmd/1, clear_cmd/1, dont_drop/1, kill_pid/1, fini/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -53,9 +53,18 @@ end_per_testcase(_Func, Config) -> %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -all(suite) -> - [{conf, ostype, [start, restart, reboot, - set_cmd, clear_cmd, kill_pid], fini}]. +all() -> +[start, restart, reboot, set_cmd, clear_cmd, kill_pid]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + ostype(Config) when is_list(Config) -> case os:type() of diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl index ec05bf99b9..596f31eb7e 100644 --- a/lib/kernel/test/inet_SUITE.erl +++ b/lib/kernel/test/inet_SUITE.erl @@ -18,29 +18,63 @@ %% -module(inet_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/1, t_gethostbyaddr/1, t_getaddr/1, t_gethostbyname/1, - t_gethostbyaddr_v6/1, t_getaddr_v6/1, t_gethostbyname_v6/1, - ipv4_to_ipv6/1, host_and_addr/1, parse/1, t_gethostnative/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + t_gethostbyaddr/0, t_gethostbyaddr/1, + t_getaddr/0, t_getaddr/1, + t_gethostbyname/0, t_gethostbyname/1, + t_gethostbyaddr_v6/0, t_gethostbyaddr_v6/1, + t_getaddr_v6/0, t_getaddr_v6/1, + t_gethostbyname_v6/0, t_gethostbyname_v6/1, + ipv4_to_ipv6/0, ipv4_to_ipv6/1, + host_and_addr/0, host_and_addr/1, + t_gethostnative/1, gethostnative_parallell/1, cname_loop/1, - gethostnative_soft_restart/1,gethostnative_debug_level/1,getif/1, - getif_ifr_name_overflow/1,getservbyname_overflow/1,getifaddrs/1]). + gethostnative_soft_restart/0, gethostnative_soft_restart/1, + gethostnative_debug_level/0, gethostnative_debug_level/1, + getif/1, + getif_ifr_name_overflow/1,getservbyname_overflow/1, getifaddrs/1]). -export([get_hosts/1, get_ipv6_hosts/1, parse_hosts/1, parse_address/1, kill_gethost/0, parallell_gethost/0]). -export([init_per_testcase/2, end_per_testcase/2]). +all() -> + [t_gethostbyaddr, t_gethostbyname, t_getaddr, + t_gethostbyaddr_v6, t_gethostbyname_v6, t_getaddr_v6, + ipv4_to_ipv6, host_and_addr, {group, parse}, + t_gethostnative, gethostnative_parallell, cname_loop, + gethostnative_debug_level, gethostnative_soft_restart, + getif, getif_ifr_name_overflow, getservbyname_overflow, + getifaddrs]. + +groups() -> + [{parse, [], [parse_hosts, parse_address]}]. + +%% Required configuaration +required(v4) -> + [{require, test_host_ipv4_only}, + {require, test_dummy_host}]; +required(v6) -> + [{require, test_host_ipv6_only}, + {require, test_dummy_ipv6_host}]; +required(hosts) -> + case os:type() of + {OS, _} when OS =:= win32; OS =:= vxworks -> + [{require, hardcoded_hosts}, + {require, hardcoded_ipv6_hosts}]; + _Else -> + [{require, test_hosts}] + end. + +init_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [t_gethostbyaddr, t_gethostbyname, t_getaddr, - t_gethostbyaddr_v6, t_gethostbyname_v6, t_getaddr_v6, - ipv4_to_ipv6, host_and_addr, parse,t_gethostnative, - gethostnative_parallell, cname_loop, - gethostnative_debug_level,gethostnative_soft_restart, - getif,getif_ifr_name_overflow,getservbyname_overflow,getifaddrs]. +end_per_group(_GroupName, Config) -> + Config. init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), @@ -50,10 +84,12 @@ end_per_testcase(_Func, Config) -> Dog = ?config(watchdog, Config), test_server:timetrap_cancel(Dog). - +t_gethostbyaddr() -> + required(v4). t_gethostbyaddr(doc) -> "Test the inet:gethostbyaddr/1 function."; t_gethostbyaddr(Config) when is_list(Config) -> - ?line {Name,FullName,IPStr,IP,Aliases,_,_} = ?config(test_host_ipv4_only, Config), + ?line {Name,FullName,IPStr,IP,Aliases,_,_} = + ct:get_config(test_host_ipv4_only), ?line {ok,HEnt} = inet:gethostbyaddr(IPStr), ?line {ok,HEnt} = inet:gethostbyaddr(IP), ?line {error,Error} = inet:gethostbyaddr(Name), @@ -75,15 +111,16 @@ t_gethostbyaddr(Config) when is_list(Config) -> end, ?line {_DName, _DFullName, DIPStr, DIP, _, _, _} = - ?config(test_dummy_host, Config), + ct:get_config(test_dummy_host), ?line {error,nxdomain} = inet:gethostbyaddr(DIPStr), ?line {error,nxdomain} = inet:gethostbyaddr(DIP), ok. +t_gethostbyaddr_v6() -> required(v6). t_gethostbyaddr_v6(doc) -> "Test the inet:gethostbyaddr/1 inet6 function."; t_gethostbyaddr_v6(Config) when is_list(Config) -> ?line {Name6, FullName6, IPStr6, IP6, Aliases6} = - ?config(test_host_ipv6_only, Config), + ct:get_config(test_host_ipv6_only), ?line case inet:gethostbyaddr(IPStr6) of %% Even if IPv6 is not supported, the native resolver may succeed @@ -103,27 +140,28 @@ t_gethostbyaddr_v6(Config) when is_list(Config) -> {HEnt6#hostent.h_aliases,[[],Aliases6]}]), ?line {_DName6, _DFullName6, DIPStr6, DIP6, _} = - ?config(test_dummy_ipv6_host, Config), + ct:get_config(test_dummy_ipv6_host), ?line {error,nxdomain} = inet:gethostbyaddr(DIPStr6), ?line {error,nxdomain} = inet:gethostbyaddr(DIP6), ok end. +t_gethostbyname() -> required(v4). t_gethostbyname(doc) -> "Test the inet:gethostbyname/1 function."; t_gethostbyname(suite) -> []; t_gethostbyname(Config) when is_list(Config) -> ?line {Name,FullName,IPStr,IP,Aliases,IP_46_Str,_} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), ?line {ok,_} = inet:gethostbyname(IPStr), ?line {ok,HEnt} = inet:gethostbyname(Name), ?line {ok,HEnt} = inet:gethostbyname(list_to_atom(Name)), ?line HEnt_ = HEnt#hostent{h_addrtype = inet, h_length = 4, h_addr_list = [IP]}, + ?line HEnt_ = HEnt, ?line check_elems([{HEnt#hostent.h_name,[Name,FullName]}, {HEnt#hostent.h_aliases,[[],Aliases]}]), - ?line {ok,HEntF} = inet:gethostbyname(FullName), ?line HEntF_ = HEntF#hostent{h_name = FullName, h_addrtype = inet, @@ -133,15 +171,16 @@ t_gethostbyname(Config) when is_list(Config) -> ?line check_elems([{HEnt#hostent.h_aliases,[[],Aliases]}]), ?line {DName, _DFullName, _DIPStr, _DIP, _, _, _} = - ?config(test_dummy_host, Config), + ct:get_config(test_dummy_host), ?line {error,nxdomain} = inet:gethostbyname(DName), ?line {error,nxdomain} = inet:gethostbyname(IP_46_Str). +t_gethostbyname_v6() -> required(v6). t_gethostbyname_v6(doc) -> "Test the inet:gethostbyname/1 inet6 function."; t_gethostbyname_v6(suite) -> []; t_gethostbyname_v6(Config) when is_list(Config) -> ?line {Name, _, _, _,Aliases,IP_46_Str,IP_46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), case {inet:gethostbyname(IP_46_Str, inet6), inet:gethostbyname(Name, inet6)} of @@ -154,7 +193,7 @@ t_gethostbyname_v6(Config) when is_list(Config) -> ?line check_elems([{HEnt46#hostent.h_aliases,[[],Aliases]}]), ?line {Name6, FullName6, IPStr6, IP6, Aliases6} = - ?config(test_host_ipv6_only, Config), + ct:get_config(test_host_ipv6_only), ?line {ok,_} = inet:gethostbyname(IPStr6, inet6), ?line {ok,HEnt6} = inet:gethostbyname(Name6, inet6), ?line {ok,HEnt6} = inet:gethostbyname(list_to_atom(Name6), inet6), @@ -200,7 +239,7 @@ t_gethostbyname_v6(Config) when is_list(Config) -> end, ?line {DName6, _DFullName6, _DIPStr6, _DIP6, _} = - ?config(test_dummy_ipv6_host, Config), + ct:get_config(test_dummy_ipv6_host), ?line {error,nxdomain} = inet:gethostbyname(DName6, inet6), ok; {_,_} -> @@ -219,11 +258,12 @@ check_elem(Val, [], Tests0) -> ?t:fail({no_match,Val,Tests0}). +t_getaddr() -> required(v4). t_getaddr(doc) -> "Test the inet:getaddr/2 function."; t_getaddr(suite) -> []; t_getaddr(Config) when is_list(Config) -> ?line {Name,FullName,IPStr,IP,_,IP_46_Str,IP46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), ?line {ok,IP} = inet:getaddr(list_to_atom(Name), inet), ?line {ok,IP} = inet:getaddr(Name, inet), ?line {ok,IP} = inet:getaddr(FullName, inet), @@ -232,17 +272,18 @@ t_getaddr(Config) when is_list(Config) -> ?line {error,nxdomain} = inet:getaddr(IP_46_Str, inet), ?line {error,eafnosupport} = inet:getaddr(IP46, inet), - ?line {DName, DFullName, DIPStr, DIP, _, _, _} = ?config(test_dummy_host, Config), + ?line {DName, DFullName, DIPStr, DIP, _, _, _} = ct:get_config(test_dummy_host), ?line {error,nxdomain} = inet:getaddr(DName, inet), ?line {error,nxdomain} = inet:getaddr(DFullName, inet), ?line {ok,DIP} = inet:getaddr(DIPStr, inet), ?line {ok,DIP} = inet:getaddr(DIP, inet). +t_getaddr_v6() -> required(v4) ++ required(v6). t_getaddr_v6(doc) -> "Test the inet:getaddr/2 function."; t_getaddr_v6(suite) -> []; t_getaddr_v6(Config) when is_list(Config) -> ?line {Name,FullName,IPStr,_IP,_,IP_46_Str,IP46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), case {inet:getaddr(IP_46_Str, inet6),inet:getaddr(Name, inet6)} of {{ok,IP46},{ok,_}} -> %% Since we suceeded in parsing an IPv6 address string and @@ -261,7 +302,7 @@ t_getaddr_v6(Config) when is_list(Config) -> %% inet_db:res_option(lookup)) %% end, ?line {Name6, FullName6, IPStr6, IP6, _} = - ?config(test_host_ipv6_only, Config), + ct:get_config(test_host_ipv6_only), ?line {ok,_} = inet:getaddr(list_to_atom(Name6), inet6), ?line {ok,_} = inet:getaddr(Name6, inet6), ?line {ok,_} = inet:getaddr(FullName6, inet6), @@ -269,7 +310,7 @@ t_getaddr_v6(Config) when is_list(Config) -> ?line {ok,IP6} = inet:getaddr(IPStr6, inet6), ?line {DName6, DFullName6, DIPStr6, DIP6, _} = - ?config(test_dummy_ipv6_host, Config), + ct:get_config(test_dummy_ipv6_host), ?line {error,nxdomain} = inet:getaddr(DName6, inet6), ?line {error,nxdomain} = inet:getaddr(DFullName6, inet6), ?line {ok,DIP6} = inet:getaddr(DIPStr6, inet6), @@ -279,6 +320,7 @@ t_getaddr_v6(Config) when is_list(Config) -> {skip, "IPv6 is not supported on this host"} end. +ipv4_to_ipv6() -> required(v4). ipv4_to_ipv6(doc) -> "Test if IPv4 address is converted to IPv6 address."; ipv4_to_ipv6(suite) -> []; ipv4_to_ipv6(Config) when is_list(Config) -> @@ -287,7 +329,7 @@ ipv4_to_ipv6(Config) when is_list(Config) -> %% address should be returned. If no IPv6 support on this host, an %% error should beturned. ?line {_Name,_FullName,IPStr,_IP,Aliases,IP_46_Str,IP_46} = - ?config(test_host_ipv4_only, Config), + ct:get_config(test_host_ipv4_only), ?line IP4to6Res = case inet:getaddr(IPStr, inet6) of {ok,IP_46} -> @@ -314,6 +356,7 @@ ipv4_to_ipv6(Config) when is_list(Config) -> end, ok. +host_and_addr() -> required(hosts). host_and_addr(doc) -> ["Test looking up hosts and addresses. Use 'ypcat hosts' ", "or the local eqivalent to find all hosts."]; host_and_addr(suite) -> []; @@ -339,12 +382,12 @@ get_hosts(Config) -> {unix, _} -> List = lists:map(fun(X) -> atom_to_list(X)++" " - end, ?config(test_hosts, Config)), + end, ct:get_config(test_hosts)), Cmd = "ypmatch "++List++" hosts.byname", HostFile = os:cmd(Cmd), get_hosts(HostFile, [], [], []); _ -> - ?config(hardcoded_hosts, Config) + ct:get_config(hardcoded_hosts) end. get_ipv6_hosts(Config) -> @@ -352,12 +395,12 @@ get_ipv6_hosts(Config) -> {unix, _} -> List = lists:map(fun(X) -> atom_to_list(X)++" " - end, ?config(test_hosts, Config)), + end, ct:get_config(test_hosts)), Cmd = "ypmatch "++List++" ipnodes.byname", HostFile = os:cmd(Cmd), get_hosts(HostFile, [], [], []); _ -> - ?config(hardcoded_ipv6_hosts, Config) + ct:get_config(hardcoded_ipv6_hosts) end. get_hosts([$\t|Rest], Cur, Ip, Result) when Ip /= [] -> @@ -376,9 +419,6 @@ get_hosts([C|Rest], Cur, Ip, Result) -> get_hosts([], _, _, Result) -> Result. -parse(suite) -> [parse_hosts, parse_address]; -parse(doc) -> ["Test that parsing of the hosts file or equivalent works,", - "and that erroneous lines are skipped"]. parse_hosts(Config) when is_list(Config) -> ?line DataDir = ?config(data_dir,Config), @@ -730,6 +770,7 @@ cname_loop(Config) when is_list(Config) -> lookup_count=300, lookup_processes=20}). +gethostnative_soft_restart() -> required(hosts). gethostnative_soft_restart(suite) -> []; gethostnative_soft_restart(doc) -> @@ -740,6 +781,8 @@ gethostnative_soft_restart(Config) when is_list(Config) -> #gethostnative_control{ control_seq=[soft_restart]}). + +gethostnative_debug_level() -> required(hosts). gethostnative_debug_level(suite) -> []; gethostnative_debug_level(doc) -> diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index cc32d1f8f9..9c7f232631 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -18,24 +18,42 @@ %% -module(inet_res_SUITE). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("test_server_line.hrl"). -include_lib("kernel/include/inet.hrl"). -include_lib("kernel/src/inet_dns.hrl"). --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, + init_per_testcase/2, end_per_testcase/2]). -export([basic/1, resolve/1, edns0/1, txt_record/1, files_monitor/1]). --export([gethostbyaddr/1, gethostbyaddr_v6/1, - gethostbyname/1, gethostbyname_v6/1, - getaddr/1, getaddr_v6/1, ipv4_to_ipv6/1, host_and_addr/1]). +-export([ + gethostbyaddr/0, gethostbyaddr/1, + gethostbyaddr_v6/0, gethostbyaddr_v6/1, + gethostbyname/0, gethostbyname/1, + gethostbyname_v6/0, gethostbyname_v6/1, + getaddr/0, getaddr/1, + getaddr_v6/0, getaddr_v6/1, + ipv4_to_ipv6/0, ipv4_to_ipv6/1, + host_and_addr/0, host_and_addr/1 + ]). -define(RUN_NAMED, "run-named"). -all(suite) -> - [basic, resolve, edns0, txt_record, files_monitor, - gethostbyaddr, gethostbyaddr_v6, gethostbyname, gethostbyname_v6, - getaddr, getaddr_v6, ipv4_to_ipv6, host_and_addr]. +all() -> +[basic, resolve, edns0, txt_record, files_monitor, + gethostbyaddr, gethostbyaddr_v6, gethostbyname, + gethostbyname_v6, getaddr, getaddr_v6, ipv4_to_ipv6, + host_and_addr]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. zone_dir(basic) -> otptest; @@ -450,11 +468,19 @@ do_files_monitor(Config) -> %% Compatibility tests. Call the inet_SUITE tests, but with %% lookup = [file,dns] instead of [native] +gethostbyaddr() -> inet_SUITE:t_gethostbyaddr(). gethostbyaddr(Config) -> inet_SUITE:t_gethostbyaddr(Config). +gethostbyaddr_v6() -> inet_SUITE:t_gethostbyaddr_v6(). gethostbyaddr_v6(Config) -> inet_SUITE:t_gethostbyaddr_v6(Config). +gethostbyname() -> inet_SUITE:t_gethostbyname(). gethostbyname(Config) -> inet_SUITE:t_gethostbyname(Config). +gethostbyname_v6() -> inet_SUITE:t_gethostbyname_v6(). gethostbyname_v6(Config) -> inet_SUITE:t_gethostbyname_v6(Config). +getaddr() -> inet_SUITE:t_getaddr(). getaddr(Config) -> inet_SUITE:t_getaddr(Config). +getaddr_v6() -> inet_SUITE:t_getaddr_v6(). getaddr_v6(Config) -> inet_SUITE:t_getaddr_v6(Config). +ipv4_to_ipv6() -> inet_SUITE:ipv4_to_ipv6(). ipv4_to_ipv6(Config) -> inet_SUITE:ipv4_to_ipv6(Config). +host_and_addr() -> inet_SUITE:host_and_addr(). host_and_addr(Config) -> inet_SUITE:host_and_addr(Config). diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index da97accdbe..f9606ff15a 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -18,7 +18,7 @@ %% -module(inet_sockopt_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(C_GET_IPPROTO_TCP,1). @@ -48,7 +48,7 @@ -define(C_QUIT,99). --export([all/1, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, simple/1, loop_all/1, simple_raw/1, simple_raw_getbin/1, doc_examples_raw/1,doc_examples_raw_getbin/1, large_raw/1,large_raw_getbin/1,combined/1,combined_getbin/1, type_errors/1]). @@ -56,10 +56,21 @@ -export([init_per_testcase/2, end_per_testcase/2]). -all(suite) -> - [simple,loop_all,simple_raw,simple_raw_getbin, - doc_examples_raw, doc_examples_raw_getbin, - large_raw,large_raw_getbin,combined,combined_getbin,type_errors]. +all() -> +[simple, loop_all, simple_raw, simple_raw_getbin, + doc_examples_raw, doc_examples_raw_getbin, large_raw, + large_raw_getbin, combined, combined_getbin, + type_errors]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Func, Config) -> Dog = test_server:timetrap(test_server:seconds(60)), diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl index af538b0b8b..ecfc8f8fd0 100644 --- a/lib/kernel/test/init_SUITE.erl +++ b/lib/kernel/test/init_SUITE.erl @@ -18,13 +18,13 @@ %% -module(init_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([get_arguments/1, get_argument/1, boot_var/1, restart/1, get_plain_arguments/1, - reboot/1, stop/1, get_status/1, script_id/1, boot/1]). + reboot/1, stop/1, get_status/1, script_id/1]). -export([boot1/1, boot2/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -38,11 +38,20 @@ %% Should be started in a CC view with: %% erl -sname master -rsh ctrsh %%----------------------------------------------------------------- -all(suite) -> - [get_arguments, get_argument, boot_var, - get_plain_arguments, - restart, - get_status, script_id, boot]. +all() -> +[get_arguments, get_argument, boot_var, + get_plain_arguments, restart, get_status, script_id, + {group, boot}]. + +groups() -> + [{boot, [], [boot1, boot2]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(?DEFAULT_TIMEOUT_SEC)), @@ -488,7 +497,6 @@ script_id(Config) when is_list(Config) -> %% ------------------------------------------------ %% Start the slave system with -boot flag. %% ------------------------------------------------ -boot(suite) -> [boot1, boot2]. boot1(doc) -> []; boot1(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]}; diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index e880233588..8bf08a701a 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -17,8 +17,8 @@ %% %CopyrightEnd% %% -module(interactive_shell_SUITE). --include("test_server.hrl"). --export([all/1, get_columns_and_rows/1, exit_initial/1, job_control_local/1, +-include_lib("test_server/include/test_server.hrl"). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, job_control_remote/1, job_control_remote_noshell/1]). @@ -44,9 +44,19 @@ end_per_testcase(_Func, Config) -> test_server:timetrap_cancel(Dog). -all(suite) -> - [get_columns_and_rows, exit_initial, job_control_local, - job_control_remote, job_control_remote_noshell]. +all() -> +[get_columns_and_rows, exit_initial, job_control_local, + job_control_remote, job_control_remote_noshell]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %-define(DEBUG,1). -ifdef(DEBUG). diff --git a/lib/kernel/test/kernel.dynspec b/lib/kernel/test/kernel.dynspec deleted file mode 100644 index 297a7c71ea..0000000000 --- a/lib/kernel/test/kernel.dynspec +++ /dev/null @@ -1,57 +0,0 @@ -%% -*- erlang -*- -%% You can test this file using this command. -%% file:script("kernel.dynspec", [{'Os',"Unix"}]). - -case Os of - "VxWorks" -> - FsCantHandle = "VxWorks filesystem can't handle this", - FsOverload = "VxWorks filesystem would overload", - CantHandle = "VxWorks can't handle this", - SlaveMisadaption = "Test not adopted to slaves on different machine", - [{skip,{application_SUITE, - "VxWorks: requires manual testing "++ - "(requires multiple nodes (OTP-1774))"}}, - {skip,{bif_SUITE, spawn_link_race1, "Known bug."}}, - {skip,{erl_distribution_SUITE, "VxWorks: More vx nodes needed"}}, - {skip,{file_SUITE,read_write_file,FsCantHandle}}, - {skip,{file_SUITE,cur_dir_0,FsCantHandle}}, - {skip,{file_SUITE,open1,FsCantHandle}}, - {skip,{file_SUITE,file_info_times,FsCantHandle}}, - {skip,{file_SUITE,file_write_file_info,FsCantHandle}}, - {skip,{file_SUITE,truncate,FsCantHandle}}, - {skip,{file_SUITE,rename,FsCantHandle}}, - {skip,{file_SUITE,e_delete,FsCantHandle}}, - {skip,{file_SUITE,e_rename,FsCantHandle}}, - {skip,{file_SUITE,delayed_write,FsCantHandle}}, - {skip,{file_SUITE,read_ahead,FsCantHandle}}, - {skip,{file_SUITE,segment_write,FsOverload}}, - {skip,{file_SUITE,segment_read,FsOverload}}, - {skip,{file_SUITE,compress_errors,FsCantHandle}}, - {skip,{global_SUITE, - "To heavy on slavenodes for VxWorks (and more)."}}, - {skip,{global_group_SUITE, "To heavy on slavenodes for VxWorks."}}, - {skip,{heart_SUITE, "Not for VxWorks heart, it's special"}}, - {skip,{init_SUITE,restart,"Uses peer nodes"}}, - {skip,{kernel_config_SUITE, "VxWorks does not support slave nodes"}}, - {skip,{os_SUITE,space_in_cwd,CantHandle}}, - {skip,{os_SUITE,space_in_name,CantHandle}}, - {skip,{os_SUITE,quoting,CantHandle}}, - {skip,{prim_file_SUITE,open1,FsCantHandle}}, - {skip,{prim_file_SUITE,compress_errors,FsCantHandle}}, - {skip,{seq_trace_SUITE,distributed_recv,SlaveMisadaption}}, - {skip,{seq_trace_SUITE,distributed_exit,SlaveMisadaption}}]; - _ -> - [] -end ++ -try gen_sctp:open() of - {ok,Socket} -> - gen_sctp:close(Socket), - []; - _ -> - [] -catch - error:badarg -> - [{skip,{gen_sctp_SUITE,"SCTP not supported on this machine"}}]; - _:_ -> - [] -end. diff --git a/lib/kernel/test/kernel.spec b/lib/kernel/test/kernel.spec new file mode 100644 index 0000000000..9bb95f9ada --- /dev/null +++ b/lib/kernel/test/kernel.spec @@ -0,0 +1,4 @@ +{config, "../test_server/ts.config"}. +{config, "../test_server/ts.unix.config"}. + +{suites, "kernel_test", all}. diff --git a/lib/kernel/test/kernel.spec.wxworks b/lib/kernel/test/kernel.spec.wxworks new file mode 100644 index 0000000000..370e474e64 --- /dev/null +++ b/lib/kernel/test/kernel.spec.wxworks @@ -0,0 +1,63 @@ +%% -*- erlang -*- +{suites,"kernel_test",all}. +{skip_cases,"kernel_test",bif_SUITE,[spawn_link_race1],"Known bug."}. +{skip_cases,"kernel_test",file_SUITE, + [read_write_file], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [cur_dir_0], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [open1], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [file_info_times], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [file_write_file_info], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [truncate], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [rename], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [e_delete], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [e_rename], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [delayed_write], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [read_ahead], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",file_SUITE, + [segment_write], + "VxWorks filesystem would overload"}. +{skip_cases,"kernel_test",file_SUITE, + [segment_read], + "VxWorks filesystem would overload"}. +{skip_cases,"kernel_test",file_SUITE, + [compress_errors], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",init_SUITE,[restart],"Uses peer nodes"}. +{skip_cases,"kernel_test",os_SUITE,[space_in_cwd],"VxWorks can't handle this"}. +{skip_cases,"kernel_test",os_SUITE, + [space_in_name], + "VxWorks can't handle this"}. +{skip_cases,"kernel_test",os_SUITE,[quoting],"VxWorks can't handle this"}. +{skip_cases,"kernel_test",prim_file_SUITE, + [open1], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",prim_file_SUITE, + [compress_errors], + "VxWorks filesystem can't handle this"}. +{skip_cases,"kernel_test",seq_trace_SUITE, + [distributed_recv], + "Test not adopted to slaves on different machine"}. +{skip_cases,"kernel_test",seq_trace_SUITE, + [distributed_exit], + "Test not adopted to slaves on different machine"}. diff --git a/lib/kernel/test/kernel_SUITE.erl b/lib/kernel/test/kernel_SUITE.erl index 76589ab915..3cf3723a85 100644 --- a/lib/kernel/test/kernel_SUITE.erl +++ b/lib/kernel/test/kernel_SUITE.erl @@ -20,14 +20,14 @@ %%% Kernel application test suite. %%%----------------------------------------------------------------- -module(kernel_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). % Default timetrap timeout (set in init_per_testcase). -define(default_timeout, ?t:minutes(1)). % Test server specific exports --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([init_per_testcase/2, end_per_testcase/2]). % Test cases must be exported. @@ -36,10 +36,18 @@ %% %% all/1 %% -all(doc) -> - []; -all(suite) -> - [app_test]. +all() -> +[app_test]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog=test_server:timetrap(?default_timeout), diff --git a/lib/kernel/test/kernel_config_SUITE.erl b/lib/kernel/test/kernel_config_SUITE.erl index c72fc3f02d..bfb86ebec4 100644 --- a/lib/kernel/test/kernel_config_SUITE.erl +++ b/lib/kernel/test/kernel_config_SUITE.erl @@ -18,23 +18,33 @@ %% -module(kernel_config_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). --export([all/1, sync/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, sync/1]). --export([init/1, fini/1]). +-export([init_per_suite/1, end_per_suite/1]). -all(suite) -> - [{conf, init, [sync], fini}]. +all() -> +[sync]. -init(doc) -> []; -init(suite) -> []; -init(Config) when is_list(Config) -> +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + +init_per_suite(doc) -> []; +init_per_suite(suite) -> []; +init_per_suite(Config) when is_list(Config) -> Config. -fini(doc) -> []; -fini(suite) -> []; -fini(Config) when is_list(Config) -> +end_per_suite(doc) -> []; +end_per_suite(suite) -> []; +end_per_suite(Config) when is_list(Config) -> stop_node(init_test), Config. diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index eacf3c7584..a61c390cf3 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -18,15 +18,25 @@ %% -module(os_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([space_in_cwd/1, quoting/1, space_in_name/1, bad_command/1, find_executable/1, unix_comment_in_command/1, evil/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[space_in_cwd, quoting, space_in_name, bad_command, + find_executable, unix_comment_in_command, evil]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [space_in_cwd, quoting, space_in_name, bad_command, find_executable, - unix_comment_in_command, evil]. space_in_cwd(doc) -> "Test that executing a command in a current working directory " diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl index 09d14208c9..2d33487610 100644 --- a/lib/kernel/test/pdict_SUITE.erl +++ b/lib/kernel/test/pdict_SUITE.erl @@ -20,7 +20,7 @@ %% NB: The ?line macro cannot be used when testing the dictionary. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(M(A,B),m(A,B,?MODULE,?LINE)). -ifdef(DEBUG). @@ -29,7 +29,7 @@ -define(DEBUGF(A,B), noop). -endif. --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, simple/1, complicated/1, heavy/1, info/1]). -export([init_per_testcase/2, end_per_testcase/2]). -export([other_process/2]). @@ -42,8 +42,18 @@ end_per_testcase(_Case, Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [simple, complicated, heavy, info]. +all() -> +[simple, complicated, heavy, info]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + simple(doc) -> ["Tests simple functionality in process dictionary."]; diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl index 08a6b844f6..cd9de48c63 100644 --- a/lib/kernel/test/pg2_SUITE.erl +++ b/lib/kernel/test/pg2_SUITE.erl @@ -20,13 +20,13 @@ %%----------------------------------------------------------------- -module(pg2_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(datadir, ?config(data_dir, Config)). -define(privdir, ?config(priv_dir, Config)). --export([all/1, init_per_testcase/2, end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2]). --export([tickets/1, +-export([ otp_7277/1, otp_8259/1, otp_8653/1, compat/1, basic/1]). @@ -49,11 +49,20 @@ end_per_testcase(_Case, _Config) -> test_server:timetrap_cancel(Dog), ok. -all(suite) -> - [tickets]. +all() -> +[{group, tickets}]. + +groups() -> + [{tickets, [], + [otp_7277, otp_8259, otp_8653, compat, basic]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -tickets(suite) -> - [otp_7277, otp_8259, otp_8653, compat, basic]. otp_7277(doc) -> "OTP-7277. Bugfix leave()."; diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl index 1688ec45ca..9d0d704b92 100644 --- a/lib/kernel/test/prim_file_SUITE.erl +++ b/lib/kernel/test/prim_file_SUITE.erl @@ -17,17 +17,17 @@ %% %CopyrightEnd% %% -module(prim_file_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init/1, fini/1, - read_write_file/1, dirs/1, files/1]). + read_write_file/1]). -export([cur_dir_0a/1, cur_dir_0b/1, cur_dir_1a/1, cur_dir_1b/1, make_del_dir_a/1, make_del_dir_b/1, - pos/1, pos1/1, pos2/1]). + pos1/1, pos2/1]). -export([close/1, delete_a/1, delete_b/1]). --export([open/1, open1/1, modes/1]). --export([file_info/1, +-export([ open1/1, modes/1]). +-export([ file_info_basic_file_a/1, file_info_basic_file_b/1, file_info_basic_directory_a/1, file_info_basic_directory_b/1, file_info_bad_a/1, file_info_bad_b/1, @@ -36,13 +36,13 @@ -export([rename_a/1, rename_b/1, access/1, truncate/1, datasync/1, sync/1, read_write/1, pread_write/1, append/1, exclusive/1]). --export([errors/1, e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). +-export([ e_delete/1, e_rename/1, e_make_dir/1, e_del_dir/1]). --export([compression/1, read_not_really_compressed/1, +-export([ read_not_really_compressed/1, read_compressed/1, write_compressed/1, compress_errors/1]). --export([links/1, +-export([ make_link_a/1, make_link_b/1, read_link_info_for_non_link/1, symlinks_a/1, symlinks_b/1, @@ -50,7 +50,7 @@ -export([advise/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -define(PRIM_FILE, prim_file). @@ -67,12 +67,43 @@ _ -> apply(?PRIM_FILE, F, [H | A]) end). -all(suite) -> {req, [kernel], - {conf, init, - [read_write_file, dirs, files, - delete_a, delete_b, rename_a, rename_b, errors, - compression, links, list_dir_limit], - fini}}. +all() -> +[read_write_file, {group, dirs}, {group, files}, + delete_a, delete_b, rename_a, rename_b, {group, errors}, + {group, compression}, {group, links}, list_dir_limit]. + +groups() -> + [{dirs, [], + [make_del_dir_a, make_del_dir_b, cur_dir_0a, cur_dir_0b, + cur_dir_1a, cur_dir_1b]}, + {files, [], + [{group, open}, {group, pos}, {group, file_info}, + truncate, sync, datasync, advise]}, + {open, [], + [open1, modes, close, access, read_write, pread_write, + append, exclusive]}, + {pos, [], [pos1, pos2]}, + {file_info, [], + [file_info_basic_file_a, file_info_basic_file_b, + file_info_basic_directory_a, + file_info_basic_directory_b, file_info_bad_a, + file_info_bad_b, file_info_times_a, file_info_times_b, + file_write_file_info_a, file_write_file_info_b]}, + {errors, [], + [e_delete, e_rename, e_make_dir, e_del_dir]}, + {compression, [], + [read_compressed, read_not_really_compressed, + write_compressed, compress_errors]}, + {links, [], + [make_link_a, make_link_b, read_link_info_for_non_link, + symlinks_a, symlinks_b]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init(Config) when is_list(Config) -> case os:type() of @@ -190,9 +221,6 @@ read_write_file(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirs(suite) -> [make_del_dir_a, make_del_dir_b, - cur_dir_0a, cur_dir_0b, - cur_dir_1a, cur_dir_1b]. make_del_dir_a(suite) -> []; make_del_dir_a(doc) -> []; @@ -382,10 +410,7 @@ win_cur_dir_1(_Config, Handle) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -files(suite) -> [open,pos,file_info,truncate,sync,datasync,advise]. -open(suite) -> [open1,modes,close,access,read_write, - pread_write,append,exclusive]. open1(suite) -> []; open1(doc) -> []; @@ -628,7 +653,6 @@ exclusive(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -pos(suite) -> [pos1,pos2]. pos1(suite) -> []; pos1(doc) -> []; @@ -716,12 +740,6 @@ pos2(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -file_info(suite) -> [file_info_basic_file_a, file_info_basic_file_b, - file_info_basic_directory_a, - file_info_basic_directory_b, - file_info_bad_a, file_info_bad_b, - file_info_times_a, file_info_times_b, - file_write_file_info_a, file_write_file_info_b]. file_info_basic_file_a(suite) -> []; file_info_basic_file_a(doc) -> []; @@ -1298,7 +1316,6 @@ rename(Config, Handle, Suffix) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -errors(suite) -> [e_delete, e_rename, e_make_dir, e_del_dir]. e_delete(suite) -> []; e_delete(doc) -> []; @@ -1550,8 +1567,6 @@ e_del_dir(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -compression(suite) -> [read_compressed, read_not_really_compressed, - write_compressed, compress_errors]. %% Trying reading and positioning from a compressed file. @@ -1704,11 +1719,6 @@ compress_errors(Config) when is_list(Config) -> ?line test_server:timetrap_cancel(Dog), ok. -links(doc) -> "Test the link functions."; -links(suite) -> - [make_link_a, make_link_b, - read_link_info_for_non_link, - symlinks_a, symlinks_b]. make_link_a(doc) -> "Test creating a hard link."; make_link_a(suite) -> []; diff --git a/lib/kernel/test/ram_file_SUITE.erl b/lib/kernel/test/ram_file_SUITE.erl index fadf695c53..6b5df2a887 100644 --- a/lib/kernel/test/ram_file_SUITE.erl +++ b/lib/kernel/test/ram_file_SUITE.erl @@ -19,14 +19,14 @@ -module(ram_file_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, %% init/1, fini/1, init_per_testcase/2, end_per_testcase/2]). -export([open_modes/1, open_old_modes/1, pread_pwrite/1, position/1, truncate/1, sync/1, get_set_file/1, compress/1, uuencode/1, large_file_errors/1, large_file_light/1, large_file_heavy/1]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include_lib("kernel/include/file.hrl"). -define(FILE_MODULE, file). % Name of module to test @@ -34,10 +34,20 @@ %%-------------------------------------------------------------------------- -all(suite) -> - [open_modes, open_old_modes, pread_pwrite, position, - truncate, sync, get_set_file, compress, uuencode, - large_file_errors, large_file_light, large_file_heavy]. +all() -> +[open_modes, open_old_modes, pread_pwrite, position, + truncate, sync, get_set_file, compress, uuencode, + large_file_errors, large_file_light, large_file_heavy]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Time = diff --git a/lib/kernel/test/rpc_SUITE.erl b/lib/kernel/test/rpc_SUITE.erl index 2b7de40797..4c31924052 100644 --- a/lib/kernel/test/rpc_SUITE.erl +++ b/lib/kernel/test/rpc_SUITE.erl @@ -18,7 +18,7 @@ %% -module(rpc_SUITE). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -export([call/1, block_call/1, multicall/1, multicall_timeout/1, multicall_dies/1, multicall_node_dies/1, called_dies/1, called_node_dies/1, @@ -26,13 +26,23 @@ -export([suicide/2, suicide/3, f/0, f2/0]). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). + +all() -> +[call, block_call, multicall, multicall_timeout, + multicall_dies, multicall_node_dies, called_dies, + called_node_dies, called_throws, call_benchmark, + async_call]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. -all(suite) -> - [call, block_call, multicall, multicall_timeout, - multicall_dies, multicall_node_dies, - called_dies, called_node_dies, - called_throws, call_benchmark, async_call]. call(doc) -> "Test different rpc calls"; diff --git a/lib/kernel/test/seq_trace_SUITE.erl b/lib/kernel/test/seq_trace_SUITE.erl index 3b54216fa9..c7736b3f27 100644 --- a/lib/kernel/test/seq_trace_SUITE.erl +++ b/lib/kernel/test/seq_trace_SUITE.erl @@ -18,7 +18,7 @@ %% -module(seq_trace_SUITE). --export([all/1,init_per_testcase/2,end_per_testcase/2]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2,init_per_testcase/2,end_per_testcase/2]). -export([token_set_get/1, tracer_set_get/1, print/1, send/1, distributed_send/1, recv/1, distributed_recv/1, trace_exit/1, distributed_exit/1, call/1, port/1, @@ -30,14 +30,25 @@ do_match_set_seq_token/1, do_gc_seq_token/1, countdown_start/2]). %-define(line_trace, 1). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(default_timeout, ?t:minutes(1)). -all(suite) -> [token_set_get, tracer_set_get, print, - send, distributed_send, recv, distributed_recv, - trace_exit, distributed_exit, call, port, - match_set_seq_token, gc_seq_token]. +all() -> +[token_set_get, tracer_set_get, print, send, + distributed_send, recv, distributed_recv, trace_exit, + distributed_exit, call, port, match_set_seq_token, + gc_seq_token]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) -> ?line Dog = test_server:timetrap(?default_timeout), diff --git a/lib/kernel/test/wrap_log_reader_SUITE.erl b/lib/kernel/test/wrap_log_reader_SUITE.erl index ea1ee77efb..616d777e9b 100644 --- a/lib/kernel/test/wrap_log_reader_SUITE.erl +++ b/lib/kernel/test/wrap_log_reader_SUITE.erl @@ -28,25 +28,38 @@ -define(config(X,Y), foo). -define(t,test_server). -else. --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -define(format(S, A), ok). -define(privdir(Conf), ?config(priv_dir, Conf)). -endif. --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, no_file/1, - one/1, one_empty/1, one_filled/1, - two/1, two_filled/1, - four/1, four_filled/1, - wrap/1, wrap_filled/1, + one_empty/1, one_filled/1, + two_filled/1, + four_filled/1, + wrap_filled/1, wrapping/1, external/1, error/1]). -export([init_per_testcase/2, end_per_testcase/2]). -all(suite) -> - [no_file, one, two, four, wrap, wrapping, external, error]. +all() -> +[no_file, {group, one}, {group, two}, {group, four}, + {group, wrap}, wrapping, external, error]. + +groups() -> + [{one, [], [one_empty, one_filled]}, + {two, [], [two_filled]}, {four, [], [four_filled]}, + {wrap, [], [wrap_filled]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> Dog=?t:timetrap(?t:seconds(60)), @@ -76,8 +89,6 @@ no_file(Conf) when is_list(Conf) -> delete_files(File), ok. -one(suite) -> [one_empty, one_filled]; -one(doc) -> ["One index file"]. one_empty(suite) -> []; one_empty(doc) -> ["One empty index file"]; @@ -139,8 +150,6 @@ test_one(File) -> {chunk, 1, ["first round, two"]}, eof], wlt, ?LINE), ok. -two(suite) -> [two_filled]; -two(doc) -> ["Two index files"]. two_filled(suite) -> []; two_filled(doc) -> ["Two filled index files"]; @@ -181,8 +190,6 @@ test_two(File) -> {chunk, 2, ["first round, 12"]}, eof], wlt, ?LINE), ok. -four(suite) -> [four_filled]; -four(doc) -> ["Four index files"]. four_filled(suite) -> []; four_filled(doc) -> ["Four filled index files"]; @@ -226,8 +233,6 @@ test_four(File) -> {chunk, 2, ["first round, 42"]}, eof], wlt, ?LINE), ok. -wrap(suite) -> [wrap_filled]; -wrap(doc) -> ["Wrap index file, first wrapping"]. wrap_filled(suite) -> []; wrap_filled(doc) -> ["First wrap, open, filled index file"]; diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl index 8ef3d0040f..135ef5ddaa 100644 --- a/lib/kernel/test/zlib_SUITE.erl +++ b/lib/kernel/test/zlib_SUITE.erl @@ -19,7 +19,7 @@ -module(zlib_SUITE). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -compile(export_all). @@ -69,33 +69,32 @@ error(Format, Args, File, Line) -> %% end, %% log("<>ERROR<>~n" ++ Format, Args, File, Line). -all(suite) -> - [api, examples, func, smp, otp_7359]. - -api(doc) -> "Basic the api tests"; -api(suite) -> - [api_open_close, - api_deflateInit, - api_deflateSetDictionary, - api_deflateReset, - api_deflateParams, - api_deflate, - api_deflateEnd, - api_inflateInit, - api_inflateSetDictionary, - api_inflateSync, - api_inflateReset, - api_inflate, - api_inflateEnd, - api_setBufsz, - api_getBufsz, - api_crc32, - api_adler32, - api_getQSize, - api_un_compress, - api_un_zip, -% api_g_un_zip_file, - api_g_un_zip]. +all() -> +[{group, api}, {group, examples}, {group, func}, smp, + otp_7359]. + +groups() -> + [{api, [], + [api_open_close, api_deflateInit, + api_deflateSetDictionary, api_deflateReset, + api_deflateParams, api_deflate, api_deflateEnd, + api_inflateInit, api_inflateSetDictionary, + api_inflateSync, api_inflateReset, api_inflate, + api_inflateEnd, api_setBufsz, api_getBufsz, api_crc32, + api_adler32, api_getQSize, api_un_compress, api_un_zip, + api_g_un_zip]}, + {examples, [], [intro]}, + {func, [], + [zip_usage, gz_usage, gz_usage2, compress_usage, + dictionary_usage, large_deflate, crc, adler]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + api_open_close(doc) -> "Test open/0 and close/1"; api_open_close(suite) -> []; @@ -517,11 +516,6 @@ bad_len_data() -> %% zlib:zip(<<42>>), one byte changed. <<31,139,8,0,0,0,0,0,0,3,211,2,0,91,38,185,9,2,0,0,0>>. -examples(doc) -> "Test the doc examples"; -examples(suite) -> - [ - intro - ]. intro(suite) -> []; intro(doc) -> ""; @@ -551,15 +545,6 @@ intro(Config) when is_list(Config) -> Orig = list_to_binary(lists:duplicate(5, D)), ?m(Orig, zlib:uncompress(Res)). -func(doc) -> "Test the functionality"; -func(suite) -> - [zip_usage, gz_usage, gz_usage2, compress_usage, - dictionary_usage, - large_deflate, - %% inflateSync, - crc, - adler - ]. large_deflate(doc) -> "Test deflate large file, which had a bug reported on erlang-bugs"; large_deflate(suite) -> []; |