diff options
author | Lukas Larsson <[email protected]> | 2010-10-12 10:34:20 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-02-17 17:25:12 +0100 |
commit | f46420139c89668f24f9b86e80f0f93fbbb9827b (patch) | |
tree | 85b7b58a6b66c5bbd53600593df295f4bc90078d | |
parent | e895e8ae96264ed7b5a0cb5f30f5a0af3d076831 (diff) | |
download | otp-f46420139c89668f24f9b86e80f0f93fbbb9827b.tar.gz otp-f46420139c89668f24f9b86e80f0f93fbbb9827b.tar.bz2 otp-f46420139c89668f24f9b86e80f0f93fbbb9827b.zip |
Update snmp tests to conform with common_test standard
-rw-r--r-- | lib/snmp/test/snmp.spec | 2 | ||||
-rw-r--r-- | lib/snmp/test/snmp_SUITE.erl | 144 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_mibs_test.erl | 47 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_ms_test.erl | 474 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_mt_test.erl | 474 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_nfilter_test.erl | 8 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_test.erl | 642 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_v2_test.erl | 474 | ||||
-rw-r--r-- | lib/snmp/test/snmp_agent_v3_test.erl | 474 | ||||
-rw-r--r-- | lib/snmp/test/snmp_app_test.erl | 54 | ||||
-rw-r--r-- | lib/snmp/test/snmp_appup_test.erl | 30 | ||||
-rw-r--r-- | lib/snmp/test/snmp_compiler_test.erl | 35 | ||||
-rw-r--r-- | lib/snmp/test/snmp_conf_test.erl | 40 | ||||
-rw-r--r-- | lib/snmp/test/snmp_log_test.erl | 65 | ||||
-rw-r--r-- | lib/snmp/test/snmp_manager_config_test.erl | 155 | ||||
-rw-r--r-- | lib/snmp/test/snmp_manager_test.erl | 202 | ||||
-rw-r--r-- | lib/snmp/test/snmp_manager_user_test.erl | 79 | ||||
-rw-r--r-- | lib/snmp/test/snmp_note_store_test.erl | 24 | ||||
-rw-r--r-- | lib/snmp/test/snmp_pdus_test.erl | 29 |
19 files changed, 1585 insertions, 1867 deletions
diff --git a/lib/snmp/test/snmp.spec b/lib/snmp/test/snmp.spec index 0af52c139e..07492337fb 100644 --- a/lib/snmp/test/snmp.spec +++ b/lib/snmp/test/snmp.spec @@ -1 +1 @@ -{topcase, {dir, "../snmp_test"}}. +{suites,"snmp_test",all}. diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl index 5cf0af7992..4261a1c155 100644 --- a/lib/snmp/test/snmp_SUITE.erl +++ b/lib/snmp/test/snmp_SUITE.erl @@ -19,27 +19,26 @@ -module(snmp_SUITE). --export([all/1, +-export([all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2 ]). --export([app/1, compiler/1, misc/1, agent/1, manager/1]). +-export([]). -export([ - app_test/1, - appup_test/1, - compiler_test/1, - conf_test/1, - pdus_test/1, - log_test/1, - note_store_test/1, - mibs_test/1, - nfilter_test/1, - agent_test/1, - manager_config_test/1, - manager_user_test/1, - manager_test/1 - ]). + + + + + + + + + + + + +]). %% %% ----- @@ -55,103 +54,74 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Top test case -all(doc) -> - ["Test suites for the snmp application.", - "There are eight different sub test-suites."]; - -all(suite) -> - [ - app, - compiler, - misc, - agent, - manager - - ]. - -app(suite) -> - [ - app_test, - appup_test - ]. - -compiler(suite) -> - [ - compiler_test - ]. - -misc(suite) -> - [ - conf_test, - pdus_test, - log_test, - note_store_test - ]. - -agent(suite) -> - [ - mibs_test, - nfilter_test, - agent_test - ]. +all() -> +[{group, app}, {group, compiler}, {group, misc}, + {group, agent}, {group, manager}]. -manager(suite) -> - [ - manager_config_test, - manager_user_test, - manager_test - ]. +groups() -> + [{app, [], [{group, app_test}, {group, appup_test}]}, + {compiler, [], [{group, compiler_test}]}, + {misc, [], + [{group, conf_test}, {group, pdus_test}, + {group, log_test}, {group, note_store_test}]}, + {agent, [], + [{group, mibs_test}, {group, nfilter_test}, + {group, agent_test}]}, + {manager, [], + [{group, manager_config_test}, + {group, manager_user_test}, {group, manager_test}]}, + {app_test, [], [{snmp_app_test, all}]}, + {appup_test, [], [{snmp_appup_test, all}]}, + {compiler_test, [], [{snmp_compiler_test, all}]}, + {conf_test, [], [{snmp_conf_test, all}]}, + {pdus_test, [], [{snmp_pdus_test, all}]}, + {log_test, [], [{snmp_log_test, all}]}, + {note_store_test, [], [{snmp_note_store_test, all}]}, + {mibs_test, [], [{snmp_agent_mibs_test, all}]}, + {nfilter_test, [], [{snmp_agent_nfilter_test, all}]}, + {agent_test, [], [{snmp_agent_test, all}]}, + {manager_config_test, [], + [{snmp_manager_config_test, all}]}, + {manager_user_test, [], + [{snmp_manager_user_test, all}]}, + {manager_test, [], [{snmp_manager_test, all}]}]. +init_per_group(_GroupName, Config) -> + Config. -app_test(suite) -> - [{snmp_app_test, all}]. +end_per_group(_GroupName, Config) -> + Config. -appup_test(suite) -> - [{snmp_appup_test, all}]. -compiler_test(suite) -> - [{snmp_compiler_test, all}]. -conf_test(suite) -> - [{snmp_conf_test, all}]. -pdus_test(suite) -> - [{snmp_pdus_test, all}]. -log_test(suite) -> - [{snmp_log_test, all}]. + -note_store_test(suite) -> - [{snmp_note_store_test, all}]. + + -mibs_test(suite) -> - [{snmp_agent_mibs_test, all}]. + + -nfilter_test(suite) -> - [{snmp_agent_nfilter_test, all}]. -agent_test(suite) -> - [{snmp_agent_test, all}]. -manager_config_test(suite) -> - [{snmp_manager_config_test, all}]. -manager_user_test(suite) -> - [{snmp_manager_user_test, all}]. + + -manager_test(suite) -> - [{snmp_manager_test, all}]. + diff --git a/lib/snmp/test/snmp_agent_mibs_test.erl b/lib/snmp/test/snmp_agent_mibs_test.erl index c28fa81ae0..3e48130fac 100644 --- a/lib/snmp/test/snmp_agent_mibs_test.erl +++ b/lib/snmp/test/snmp_agent_mibs_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). -include_lib("snmp/include/SNMP-COMMUNITY-MIB.hrl"). @@ -39,12 +39,12 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - init_all/1, finish_all/1, + init_per_suite/1, end_per_suite/1, start_and_stop/1, - size_check/1, + size_check_ets/1, size_check_dets/1, size_check_mnesia/1, @@ -58,8 +58,6 @@ %%---------------------------------------------------------------------- %% Internal exports %%---------------------------------------------------------------------- --export([ - ]). %%---------------------------------------------------------------------- %% Macros @@ -121,20 +119,25 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - {conf, init_all, cases(), finish_all}. +all() -> +cases(). + +groups() -> + [{size_check, [], + [size_check_ets, size_check_dets, size_check_mnesia]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + -cases() -> - [ - start_and_stop, - load_unload, - size_check, - me_lookup, - which_mib, - cache_test - ]. +cases() -> +[start_and_stop, load_unload, {group, size_check}, + me_lookup, which_mib, cache_test]. -init_all(Config) when is_list(Config) -> +init_per_suite(Config) when is_list(Config) -> %% Data dir points wrong DataDir0 = ?config(data_dir, Config), DataDir1 = filename:split(filename:absname(DataDir0)), @@ -142,7 +145,7 @@ init_all(Config) when is_list(Config) -> DataDir = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]), [{snmp_data_dir, DataDir ++ "/"}|Config]. -finish_all(Config) when is_list(Config) -> +end_per_suite(Config) when is_list(Config) -> lists:keydelete(snmp_data_dir, 1, Config). @@ -217,12 +220,6 @@ load_unload(Config) when is_list(Config) -> %% --------------------------------------------------------------------- -size_check(suite) -> - [ - size_check_ets, - size_check_dets, - size_check_mnesia - ]. size_check_ets(suite) -> []; diff --git a/lib/snmp/test/snmp_agent_ms_test.erl b/lib/snmp/test/snmp_agent_ms_test.erl index cc4cdae32f..1f34f1c8d1 100644 --- a/lib/snmp/test/snmp_agent_ms_test.erl +++ b/lib/snmp/test/snmp_agent_ms_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% <base>, and a second version <base>_2. There may be several %% versions as well, <base>_N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_mt_test.erl b/lib/snmp/test/snmp_agent_mt_test.erl index c664dba288..4f125c0017 100644 --- a/lib/snmp/test/snmp_agent_mt_test.erl +++ b/lib/snmp/test/snmp_agent_mt_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% <base>, and a second version <base>_2. There may be several %% versions as well, <base>_N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_nfilter_test.erl b/lib/snmp/test/snmp_agent_nfilter_test.erl index f406ea1e63..f08060cee3 100644 --- a/lib/snmp/test/snmp_agent_nfilter_test.erl +++ b/lib/snmp/test/snmp_agent_nfilter_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). @@ -33,7 +33,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0, init_per_testcase/2, end_per_testcase/2 ]). @@ -64,8 +64,8 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(_) -> - ?SKIP(not_yet_implemented). +all() -> + {skip,not_yet_implemented}. %%====================================================================== diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl index cb4edf998b..692d29fda0 100644 --- a/lib/snmp/test/snmp_agent_test.erl +++ b/lib/snmp/test/snmp_agent_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -85,11 +85,164 @@ end). -all(suite) -> - Reqs = [mnesia, distribution, {local_slave_nodes, 2}, {time, 360}], - Conf1 = [{conf, init_all, cases(), finish_all}], - Conf2 = [tickets2], - {req, Reqs, Conf1 ++ Conf2}. +all() -> + Reqs = [mnesia, distribution, {local_slave_nodes, 2}, + {time, 360}], + Conf1 = [{group, all_tcs}], + Conf2 = [{group, tickets2}], + Conf1 ++ Conf2. + +groups() -> + [{all_tcs, [], cases()}, + {mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {misc, [], misc_cases()}, {test_v1, [], v1_cases()}, + {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets1, [], [{group, otp_4394}, {group, otp_7157}]}, + {tickets2, [], [otp8395]}, + {otp_4394, [], [otp_4394_test]}, + {otp_7157, [], + begin Reqs = [], Conf = [otp_7157_test], Conf end}]. + +init_per_group(all_tcs, Config) -> + init_all(Config); +init_per_group(otp_7157, Config) -> + init_otp_7157(Config); +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(misc, Config) -> + init_misc(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(all_tcs, Config) -> + finish_all(Config); +end_per_group(otp_7157, Config) -> + finish_otp_7157(Config); +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(misc, Config) -> + finish_misc(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(otp8395 = Case, Config) when is_list(Config) -> @@ -175,7 +328,7 @@ init_per_suite(Config) -> Config2. %% end_per_suite(Config) -> -end_suite(Config) -> +end_per_suite(Config) -> Config. fix_data_dir(Config) -> @@ -224,31 +377,18 @@ end_per_testcase2(_Case, Config) -> Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - misc, - test_v1, - test_v2, - test_v1_v2, - test_multi_threaded, - mib_storage, - tickets1 - ]; - _Else -> - [ - misc, - test_v1, - test_v2, - test_v1_v2, - test_v3, - test_multi_threaded, - mib_storage, - tickets1 - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [{group, misc}, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets1}]; + _Else -> + [{group, misc}, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets1}] +end. %%%----------------------------------------------------------------- @@ -355,144 +495,56 @@ delete_mib_storage_mnesia_tables() -> %% <base>, and a second version <base>_2. There may be several %% versions as well, <base>_N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when is_list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -975,8 +1027,6 @@ mib_of(Oid, ExpectedMibName) -> end. -misc(suite) -> - {req, [], {conf, init_misc, misc_cases(), finish_misc}}. init_misc(Config) -> init_v1(Config). @@ -984,11 +1034,8 @@ init_misc(Config) -> finish_misc(Config) -> finish_v1(Config). -misc_cases() -> - [ - app_info, - info_test - ]. +misc_cases() -> +[app_info, info_test]. app_info(suite) -> []; app_info(Config) when is_list(Config) -> @@ -1021,34 +1068,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [ - simple, - db_notify_client, - v1_processing, - big, - big2, - loop_mib, - api, - subagent, - mnesia, - multiple_reqs, - sa_register, - v1_trap, - sa_error, - next_across_sa, - undo, - reported_bugs, - standard_mibs, - sparse_table, - cnt_64, - opaque, - - change_target_addr_config - ]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when is_list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1065,34 +1092,14 @@ finish_v1(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. - -v2_cases() -> - [ - simple_2, - v2_processing, - big_2, - big2_2, - loop_mib_2, - api_2, - subagent_2, - mnesia_2, - multiple_reqs_2, - sa_register_2, - v2_trap, - v2_inform, - sa_error_2, - next_across_sa_2, - undo_2, - reported_bugs_2, - standard_mibs_2, - v2_types, - implied, - sparse_table_2, - cnt_64_2, - opaque_2, - v2_caps - ]. + +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1109,11 +1116,9 @@ finish_v2(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> - {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1130,35 +1135,15 @@ finish_v1_v2(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. - -v3_cases() -> - [ - simple_3, - v3_processing, - big_3, - big2_3, - api_3, - subagent_3, - mnesia_3, - loop_mib_3, - multiple_reqs_3, - sa_register_3, - v3_trap, - v3_inform, - sa_error_3, - next_across_sa_3, - undo_3, - reported_bugs_3, - standard_mibs_3, - v3_security, - v2_types_3, - implied_3, - sparse_table_3, - cnt_64_3, - opaque_3, - v2_caps_3 - ]. + +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when is_list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1196,11 +1181,9 @@ finish_v3(Config) when is_list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> - {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when is_list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1690,21 +1673,19 @@ mnesia_2(X) -> ?P(mnesia_2), mnesia(X). mnesia_3(X) -> ?P(mnesia_3), mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1929,8 +1910,6 @@ v3_trap(Config) when is_list(Config) -> ?P(v3_trap), trap2(Config). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2190,13 +2169,6 @@ v3_processing(Config) when is_list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> - [ - v3_crypto_basic, - v3_md5_auth, - v3_sha_auth, - v3_des_priv - ]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -4044,36 +4016,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [ - snmp_standard_mib, - snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, - snmp_notification_mib, - snmp_view_based_acm_mib - ]. - -standard_mibs_2(suite) -> - [ - snmpv2_mib_2, - snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, - snmp_notification_mib_2, - snmp_view_based_acm_mib_2 - ]. - -standard_mibs_3(suite) -> - [ - snmpv2_mib_3, - snmp_framework_mib_3, - snmp_mpd_mib_3, - snmp_target_mib_3, - snmp_notification_mib_3, - snmp_view_based_acm_mib_3, - snmp_user_based_sm_mib_3 - ]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -5117,70 +5061,14 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [ - otp_1128, - otp_1129, - otp_1131, - otp_1162, - otp_1222, - otp_1298, - otp_1331, - otp_1338, - otp_1342, - otp_2776, - otp_2979, - otp_3187, - otp_3725 - ]. - -reported_bugs_2(suite) -> - [ - otp_1128_2, - otp_1129_2, - otp_1131_2, - otp_1162_2, - otp_1222_2, - otp_1298_2, - otp_1331_2, - otp_1338_2, - otp_1342_2, - otp_2776_2, - otp_2979_2, - otp_3187_2 - ]. - -reported_bugs_3(suite) -> - [ - otp_1128_3, - otp_1129_3, - otp_1131_3, - otp_1162_3, - otp_1222_3, - otp_1298_3, - otp_1331_3, - otp_1338_3, - otp_1342_3, - otp_2776_3, - otp_2979_3, - otp_3187_3, - otp_3542 - ]. + + %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets1(suite) -> - [ - otp_4394, - otp_7157 - ]. -tickets2(suite) -> - [ - otp8395 - ]. @@ -5661,10 +5549,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when is_list(Config) -> ?DBG("init_otp_4394 -> entry with" @@ -5758,10 +5642,6 @@ otp_4394_test1() -> %%----------------------------------------------------------------- -otp_7157(suite) -> - Reqs = [], - Conf = [{conf, init_otp_7157, [otp_7157_test], finish_otp_7157}], - {req, Reqs, Conf}. init_otp_7157(Config) when is_list(Config) -> %% <CONDITIONAL-SKIP> diff --git a/lib/snmp/test/snmp_agent_v2_test.erl b/lib/snmp/test/snmp_agent_v2_test.erl index 549521341e..dc94c18ad9 100644 --- a/lib/snmp/test/snmp_agent_v2_test.erl +++ b/lib/snmp/test/snmp_agent_v2_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% <base>, and a second version <base>_2. There may be several %% versions as well, <base>_N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_agent_v3_test.erl b/lib/snmp/test/snmp_agent_v3_test.erl index 71b355057d..266be72878 100644 --- a/lib/snmp/test/snmp_agent_v3_test.erl +++ b/lib/snmp/test/snmp_agent_v3_test.erl @@ -28,7 +28,7 @@ -define(application, snmp). -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -83,10 +83,143 @@ _ -> V3 end). -all(suite) -> {req, - [mnesia, distribution, - {local_slave_nodes, 2}, {time, 360}], - [{conf, init_all, cases(), finish_all}]}. +all() -> +[cases()]. + +groups() -> + [{mib_storage, [], + [{group, mib_storage_ets}, {group, mib_storage_dets}, + {group, mib_storage_mnesia}, + {group, mib_storage_size_check_ets}, + {group, mib_storage_size_check_dets}, + {group, mib_storage_size_check_mnesia}, + {group, mib_storage_varm_dets}, + {group, mib_storage_varm_mnesia}]}, + {mib_storage_ets, [], mib_storage_ets_cases()}, + {mib_storage_dets, [], mib_storage_dets_cases()}, + {mib_storage_mnesia, [], mib_storage_mnesia_cases()}, + {mib_storage_size_check_ets, [], + mse_size_check_cases()}, + {mib_storage_size_check_dets, [], + msd_size_check_cases()}, + {mib_storage_size_check_mnesia, [], + msm_size_check_cases()}, + {mib_storage_varm_dets, [], + varm_mib_storage_dets_cases()}, + {mib_storage_varm_mnesia, [], + varm_mib_storage_mnesia_cases()}, + {test_v1, [], v1_cases()}, {test_v2, [], v2_cases()}, + {test_v1_v2, [], v1_v2_cases()}, + {test_v3, [], v3_cases()}, + {test_multi_threaded, [], mt_cases()}, + {multiple_reqs, [], mul_cases()}, + {multiple_reqs_2, [], mul_cases_2()}, + {v2_inform, [], [v2_inform_i]}, + {v3_security, [], + [v3_crypto_basic, v3_md5_auth, v3_sha_auth, + v3_des_priv]}, + {standard_mibs, [], + [snmp_standard_mib, snmp_community_mib, + snmp_framework_mib, snmp_target_mib, + snmp_notification_mib, snmp_view_based_acm_mib]}, + {standard_mibs_2, [], + [snmpv2_mib_2, snmp_community_mib_2, + snmp_framework_mib_2, snmp_target_mib_2, + snmp_notification_mib_2, snmp_view_based_acm_mib_2]}, + {standard_mibs_3, [], + [snmpv2_mib_3, snmp_framework_mib_3, snmp_mpd_mib_3, + snmp_target_mib_3, snmp_notification_mib_3, + snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]}, + {reported_bugs, [], + [otp_1128, otp_1129, otp_1131, otp_1162, otp_1222, + otp_1298, otp_1331, otp_1338, otp_1342, otp_2776, + otp_2979, otp_3187, otp_3725]}, + {reported_bugs_2, [], + [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, + otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, + otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]}, + {reported_bugs_3, [], + [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, + otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, + otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, + otp_3542]}, + {tickets, [], [{group, otp_4394}]}, + {otp_4394, [], [otp_4394_test]}]. + +init_per_group(otp_4394, Config) -> + init_otp_4394(Config); +init_per_group(v2_inform, Config) -> + init_v2_inform(Config); +init_per_group(multiple_reqs_2, Config) -> + init_mul(Config); +init_per_group(multiple_reqs, Config) -> + init_mul(Config); +init_per_group(test_multi_threaded, Config) -> + init_mt(Config); +init_per_group(test_v3, Config) -> + init_v3(Config); +init_per_group(test_v1_v2, Config) -> + init_v1_v2(Config); +init_per_group(test_v2, Config) -> + init_v2(Config); +init_per_group(test_v1, Config) -> + init_v1(Config); +init_per_group(mib_storage_varm_mnesia, Config) -> + init_varm_mib_storage_mnesia(Config); +init_per_group(mib_storage_varm_dets, Config) -> + init_varm_mib_storage_dets(Config); +init_per_group(mib_storage_size_check_mnesia, Config) -> + init_size_check_msm(Config); +init_per_group(mib_storage_size_check_dets, Config) -> + init_size_check_msd(Config); +init_per_group(mib_storage_size_check_ets, Config) -> + init_size_check_mse(Config); +init_per_group(mib_storage_mnesia, Config) -> + init_mib_storage_mnesia(Config); +init_per_group(mib_storage_dets, Config) -> + init_mib_storage_dets(Config); +init_per_group(mib_storage_ets, Config) -> + init_mib_storage_ets(Config); +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(otp_4394, Config) -> + finish_otp_4394(Config); +end_per_group(v2_inform, Config) -> + finish_v2_inform(Config); +end_per_group(multiple_reqs_2, Config) -> + finish_mul(Config); +end_per_group(multiple_reqs, Config) -> + finish_mul(Config); +end_per_group(test_multi_threaded, Config) -> + finish_mt(Config); +end_per_group(test_v3, Config) -> + finish_v3(Config); +end_per_group(test_v1_v2, Config) -> + finish_v1_v2(Config); +end_per_group(test_v2, Config) -> + finish_v2(Config); +end_per_group(test_v1, Config) -> + finish_v1(Config); +end_per_group(mib_storage_varm_mnesia, Config) -> + finish_varm_mib_storage_mnesia(Config); +end_per_group(mib_storage_varm_dets, Config) -> + finish_varm_mib_storage_dets(Config); +end_per_group(mib_storage_size_check_mnesia, Config) -> + finish_size_check_msm(Config); +end_per_group(mib_storage_size_check_dets, Config) -> + finish_size_check_msd(Config); +end_per_group(mib_storage_size_check_ets, Config) -> + finish_size_check_mse(Config); +end_per_group(mib_storage_mnesia, Config) -> + finish_mib_storage_mnesia(Config); +end_per_group(mib_storage_dets, Config) -> + finish_mib_storage_dets(Config); +end_per_group(mib_storage_ets, Config) -> + finish_mib_storage_ets(Config); +end_per_group(_GroupName, Config) -> + Config. + init_per_testcase(_Case, Config) when list(Config) -> Dog = ?t:timetrap(?t:minutes(6)), @@ -97,25 +230,18 @@ end_per_testcase(_Case, Config) when list(Config) -> ?t:timetrap_cancel(Dog), Config. -cases() -> - case ?OSTYPE() of - vxworks -> - %% No crypto app, so skip v3 testcases - [ - app_info, - test_v1, test_v2, test_v1_v2, - test_multi_threaded, - mib_storage, - tickets]; - _Else -> - [ - app_info, - test_v1, test_v2, test_v1_v2, test_v3, - test_multi_threaded, - mib_storage, - tickets - ] - end. +cases() -> +case ?OSTYPE() of + vxworks -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_multi_threaded}, + {group, mib_storage}, {group, tickets}]; + _Else -> + [app_info, {group, test_v1}, {group, test_v2}, + {group, test_v1_v2}, {group, test_v3}, + {group, test_multi_threaded}, {group, mib_storage}, + {group, tickets}] +end. %%%----------------------------------------------------------------- @@ -460,144 +586,56 @@ delete_mib_storage_mnesia_tables() -> %% <base>, and a second version <base>_2. There may be several %% versions as well, <base>_N. %%----------------------------------------------------------------- -mib_storage(suite) -> [ - mib_storage_ets, - mib_storage_dets, - mib_storage_mnesia, - mib_storage_size_check_ets, - mib_storage_size_check_dets, - mib_storage_size_check_mnesia, - mib_storage_varm_dets, - mib_storage_varm_mnesia - ]. - -mib_storage_ets(suite) -> {req, [], {conf, init_mib_storage_ets, - mib_storage_ets_cases(), - finish_mib_storage_ets}}. - -mib_storage_dets(suite) -> {req, [], {conf, init_mib_storage_dets, - mib_storage_dets_cases(), - finish_mib_storage_dets}}. - -mib_storage_mnesia(suite) -> {req, [], {conf, init_mib_storage_mnesia, - mib_storage_mnesia_cases(), - finish_mib_storage_mnesia}}. - -mib_storage_size_check_ets(suite) -> - {req, [], {conf, - init_size_check_mse, - mse_size_check_cases(), - finish_size_check_mse}}. - -mib_storage_size_check_dets(suite) -> - {req, [], {conf, - init_size_check_msd, - msd_size_check_cases(), - finish_size_check_msd}}. - -mib_storage_size_check_mnesia(suite) -> - {req, [], {conf, - init_size_check_msm, - msm_size_check_cases(), - finish_size_check_msm}}. - -mib_storage_varm_dets(suite) -> - {req, [], {conf, - init_varm_mib_storage_dets, - varm_mib_storage_dets_cases(), - finish_varm_mib_storage_dets}}. - -mib_storage_varm_mnesia(suite) -> - {req, [], {conf, - init_varm_mib_storage_mnesia, - varm_mib_storage_mnesia_cases(), - finish_varm_mib_storage_mnesia}}. - -mib_storage_ets_cases() -> - [ - mse_simple, - mse_v1_processing, - mse_big, - mse_big2, - mse_loop_mib, - mse_api, - mse_sa_register, - mse_v1_trap, - mse_sa_error, - mse_next_across_sa, - mse_undo, - mse_standard_mib, - mse_community_mib, - mse_framework_mib, - mse_target_mib, - mse_notification_mib, - mse_view_based_acm_mib, - mse_sparse_table, - mse_me_of, - mse_mib_of]. - -mib_storage_dets_cases() -> - [ - msd_simple, - msd_v1_processing, - msd_big, - msd_big2, - msd_loop_mib, - msd_api, - msd_sa_register, - msd_v1_trap, - msd_sa_error, - msd_next_across_sa, - msd_undo, - msd_standard_mib, - msd_community_mib, - msd_framework_mib, - msd_target_mib, - msd_notification_mib, - msd_view_based_acm_mib, - msd_sparse_table, - msd_me_of, - msd_mib_of - ]. - -mib_storage_mnesia_cases() -> - [ - msm_simple, - msm_v1_processing, - msm_big, - msm_big2, - msm_loop_mib, - msm_api, - msm_sa_register, - msm_v1_trap, - msm_sa_error, - msm_next_across_sa, - msm_undo, - msm_standard_mib, - msm_community_mib, - msm_framework_mib, - msm_target_mib, - msm_notification_mib, - msm_view_based_acm_mib, - msm_sparse_table, - msm_me_of, - msm_mib_of - ]. - -mse_size_check_cases() -> - [mse_size_check]. - -msd_size_check_cases() -> - [msd_size_check]. - -msm_size_check_cases() -> - [msm_size_check]. - -varm_mib_storage_dets_cases() -> - [msd_varm_mib_start]. - -varm_mib_storage_mnesia_cases() -> - [msm_varm_mib_start]. + + + + + + + + + +mib_storage_ets_cases() -> +[mse_simple, mse_v1_processing, mse_big, mse_big2, + mse_loop_mib, mse_api, mse_sa_register, mse_v1_trap, + mse_sa_error, mse_next_across_sa, mse_undo, + mse_standard_mib, mse_community_mib, mse_framework_mib, + mse_target_mib, mse_notification_mib, + mse_view_based_acm_mib, mse_sparse_table, mse_me_of, + mse_mib_of]. + +mib_storage_dets_cases() -> +[msd_simple, msd_v1_processing, msd_big, msd_big2, + msd_loop_mib, msd_api, msd_sa_register, msd_v1_trap, + msd_sa_error, msd_next_across_sa, msd_undo, + msd_standard_mib, msd_community_mib, msd_framework_mib, + msd_target_mib, msd_notification_mib, + msd_view_based_acm_mib, msd_sparse_table, msd_me_of, + msd_mib_of]. + +mib_storage_mnesia_cases() -> +[msm_simple, msm_v1_processing, msm_big, msm_big2, + msm_loop_mib, msm_api, msm_sa_register, msm_v1_trap, + msm_sa_error, msm_next_across_sa, msm_undo, + msm_standard_mib, msm_community_mib, msm_framework_mib, + msm_target_mib, msm_notification_mib, + msm_view_based_acm_mib, msm_sparse_table, msm_me_of, + msm_mib_of]. + +mse_size_check_cases() -> +[mse_size_check]. + +msd_size_check_cases() -> +[msd_size_check]. + +msm_size_check_cases() -> +[msm_size_check]. + +varm_mib_storage_dets_cases() -> +[msd_varm_mib_start]. + +varm_mib_storage_mnesia_cases() -> +[msm_varm_mib_start]. init_mib_storage_ets(Config) when list(Config) -> ?LOG("init_mib_storage_ets -> entry", []), @@ -1099,20 +1137,14 @@ app_dir(App) -> end. -test_v1(suite) -> {req, [], {conf, init_v1, v1_cases(), finish_v1}}. %v1_cases() -> [loop_mib]; -v1_cases() -> - [simple, - db_notify_client, - v1_processing, big, big2, loop_mib, - api, subagent, mnesia, multiple_reqs, - sa_register, v1_trap, sa_error, next_across_sa, undo, reported_bugs, - standard_mibs, sparse_table, cnt_64, - opaque, - % opaque]. - - change_target_addr_config]. +v1_cases() -> +[simple, db_notify_client, v1_processing, big, big2, + loop_mib, api, subagent, mnesia, {group, multiple_reqs}, + sa_register, v1_trap, sa_error, next_across_sa, undo, + {group, reported_bugs}, {group, standard_mibs}, + sparse_table, cnt_64, opaque, change_target_addr_config]. init_v1(Config) when list(Config) -> ?line SaNode = ?config(snmp_sa, Config), @@ -1129,15 +1161,15 @@ finish_v1(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v2(suite) -> {req, [], {conf, init_v2, v2_cases(), finish_v2}}. %v2_cases() -> [loop_mib_2]; -v2_cases() -> - [simple_2, v2_processing, big_2, big2_2, loop_mib_2, - api_2, subagent_2, mnesia_2, - multiple_reqs_2, sa_register_2, v2_trap, v2_inform, sa_error_2, - next_across_sa_2, undo_2, reported_bugs_2, standard_mibs_2, - v2_types, implied, sparse_table_2, cnt_64_2, opaque_2, v2_caps]. +v2_cases() -> +[simple_2, v2_processing, big_2, big2_2, loop_mib_2, + api_2, subagent_2, mnesia_2, {group, multiple_reqs_2}, + sa_register_2, v2_trap, {group, v2_inform}, sa_error_2, + next_across_sa_2, undo_2, {group, reported_bugs_2}, + {group, standard_mibs_2}, v2_types, implied, + sparse_table_2, cnt_64_2, opaque_2, v2_caps]. init_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1154,10 +1186,9 @@ finish_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v1_v2(suite) -> {req, [], {conf, init_v1_v2, v1_v2_cases(), finish_v1_v2}}. -v1_v2_cases() -> - [simple_bi]. +v1_v2_cases() -> +[simple_bi]. init_v1_v2(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1174,16 +1205,16 @@ finish_v1_v2(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_v3(suite) -> {req, [], {conf, init_v3, v3_cases(), finish_v3}}. %v3_cases() -> [loop_mib_3]; -v3_cases() -> - [simple_3, v3_processing, - big_3, big2_3, api_3, subagent_3, mnesia_3, loop_mib_3, - multiple_reqs_3, sa_register_3, v3_trap, v3_inform, sa_error_3, - next_across_sa_3, undo_3, reported_bugs_3, standard_mibs_3, - v3_security, - v2_types_3, implied_3, sparse_table_3, cnt_64_3, opaque_3, v2_caps_3]. +v3_cases() -> +[simple_3, v3_processing, big_3, big2_3, api_3, + subagent_3, mnesia_3, loop_mib_3, multiple_reqs_3, + sa_register_3, v3_trap, v3_inform, sa_error_3, + next_across_sa_3, undo_3, {group, reported_bugs_3}, + {group, standard_mibs_3}, {group, v3_security}, + v2_types_3, implied_3, sparse_table_3, cnt_64_3, + opaque_3, v2_caps_3]. init_v3(Config) when list(Config) -> %% Make sure crypto works, otherwise start_agent will fail @@ -1221,10 +1252,9 @@ finish_v3(Config) when list(Config) -> delete_files(C1), lists:keydelete(vsn, 1, C1). -test_multi_threaded(suite) -> {req, [], {conf, init_mt, mt_cases(), finish_mt}}. -mt_cases() -> - [multi_threaded, mt_trap]. +mt_cases() -> +[multi_threaded, mt_trap]. init_mt(Config) when list(Config) -> SaNode = ?config(snmp_sa, Config), @@ -1739,21 +1769,19 @@ mnesia_2(X) -> mnesia(X). mnesia_3(X) -> mnesia(X). -multiple_reqs(suite) -> - {req, [], {conf, init_mul, mul_cases(), finish_mul}}. -mul_cases() -> - [mul_get, mul_get_err, mul_next, mul_next_err, mul_set_err]. +mul_cases() -> +[mul_get, mul_get_err, mul_next, mul_next_err, + mul_set_err]. -multiple_reqs_2(suite) -> - {req, [], {conf, init_mul, mul_cases_2(), finish_mul}}. multiple_reqs_3(_X) -> {req, [], {conf, init_mul, mul_cases_3(), finish_mul}}. -mul_cases_2() -> - [mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, mul_set_err_2]. +mul_cases_2() -> +[mul_get_2, mul_get_err_2, mul_next_2, mul_next_err_2, + mul_set_err_2]. mul_cases_3() -> @@ -1939,8 +1967,6 @@ v2_trap(Config) when list(Config) -> v3_trap(X) -> v2_trap(X). -v2_inform(suite) -> - {req, [], {conf, init_v2_inform, [v2_inform_i], finish_v2_inform}}. v3_inform(_X) -> %% v2_inform(X). @@ -2112,7 +2138,6 @@ v3_processing(Config) when list(Config) -> %% accomplished by the first inform sent. That one will generate a %% report, which makes it in sync. The notification-generating %% application times out, and send again. This time it'll work. -v3_security(suite) -> [v3_crypto_basic, v3_md5_auth, v3_sha_auth, v3_des_priv]. v3_crypto_basic(suite) -> []; v3_crypto_basic(_Config) -> @@ -3591,22 +3616,8 @@ bad_return() -> %%% Note that many of the functions in the standard mib is %%% already tested by the normal tests. %%%----------------------------------------------------------------- -standard_mibs(suite) -> - [snmp_standard_mib, snmp_community_mib, - snmp_framework_mib, - snmp_target_mib, snmp_notification_mib, - snmp_view_based_acm_mib]. - -standard_mibs_2(suite) -> - [snmpv2_mib_2, snmp_community_mib_2, - snmp_framework_mib_2, - snmp_target_mib_2, snmp_notification_mib_2, - snmp_view_based_acm_mib_2]. - -standard_mibs_3(suite) -> - [snmpv2_mib_3,snmp_framework_mib_3, snmp_mpd_mib_3, - snmp_target_mib_3, snmp_notification_mib_3, - snmp_view_based_acm_mib_3, snmp_user_based_sm_mib_3]. + + %%----------------------------------------------------------------- %% For this test, the agent is configured for v1. @@ -4527,27 +4538,12 @@ loop_it_2(Oid, N) -> %%% Testing of reported bugs and other tickets. %%%----------------------------------------------------------------- -reported_bugs(suite) -> - [otp_1128, otp_1129, otp_1131, otp_1162, - otp_1222, otp_1298, otp_1331, otp_1338, - otp_1342, otp_2776, otp_2979, otp_3187, otp_3725]. -reported_bugs_2(suite) -> - [otp_1128_2, otp_1129_2, otp_1131_2, otp_1162_2, - otp_1222_2, otp_1298_2, otp_1331_2, otp_1338_2, - otp_1342_2, otp_2776_2, otp_2979_2, otp_3187_2]. -reported_bugs_3(suite) -> - [otp_1128_3, otp_1129_3, otp_1131_3, otp_1162_3, - otp_1222_3, otp_1298_3, otp_1331_3, otp_1338_3, - otp_1342_3, otp_2776_3, otp_2979_3, otp_3187_3, - otp_3542]. %% These are (ticket) test cases where the initiation has to be done %% individually. -tickets(suite) -> - [otp_4394]. %%----------------------------------------------------------------- %% Ticket: OTP-1128 @@ -4971,10 +4967,6 @@ otp_3725_test(MaNode) -> %%----------------------------------------------------------------- -otp_4394(suite) -> {req, [], {conf, - init_otp_4394, - [otp_4394_test], - finish_otp_4394}}. init_otp_4394(Config) when list(Config) -> ?DBG("init_otp_4394 -> entry with" diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl index a973a2f325..64dd638f83 100644 --- a/lib/snmp/test/snmp_app_test.erl +++ b/lib/snmp/test/snmp_app_test.erl @@ -23,7 +23,8 @@ -module(snmp_app_test). -export([ - all/1, init_per_suite/1, fin_suite/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2, fields/1, @@ -32,7 +33,7 @@ app_depend/1, undef_funcs/1, - start_and_stop/1, + start_and_stop_empty/1, start_and_stop_with_agent/1, start_and_stop_with_manager/1, @@ -44,23 +45,32 @@ -include_lib("kernel/include/file.hrl"). --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - fields, - modules, - exportall, - app_depend, - undef_funcs, - start_and_stop - ], - {conf, init_per_suite, Cases, fin_suite}. +all() -> +Cases = [fields, modules, exportall, app_depend, + undef_funcs, {group, start_and_stop}], + Cases. + +groups() -> + [{start_and_stop, [], + [start_and_stop_empty, start_and_stop_with_agent, + start_and_stop_with_manager, + start_and_stop_with_agent_and_manager, + start_epmty_and_then_agent_and_manager_and_stop, + start_with_agent_and_then_manager_and_stop, + start_with_manager_and_then_agent_and_stop]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + init_per_suite(Config) when is_list(Config) -> ?DISPLAY_SUITE_INFO(), @@ -97,9 +107,9 @@ is_app(App) -> {error, {invalid_format, Error}} end. -fin_suite(suite) -> []; -fin_suite(doc) -> []; -fin_suite(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. @@ -319,16 +329,6 @@ undef_funcs_make_name(App, PostFix) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -start_and_stop(suite) -> - [ - start_and_stop_empty, - start_and_stop_with_agent, - start_and_stop_with_manager, - start_and_stop_with_agent_and_manager, - start_epmty_and_then_agent_and_manager_and_stop, - start_with_agent_and_then_manager_and_stop, - start_with_manager_and_then_agent_and_stop - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/snmp/test/snmp_appup_test.erl b/lib/snmp/test/snmp_appup_test.erl index 3c708b8977..b93f960814 100644 --- a/lib/snmp/test/snmp_appup_test.erl +++ b/lib/snmp/test/snmp_appup_test.erl @@ -23,25 +23,33 @@ -module(snmp_appup_test). -export([ - all/1, init_per_suite/1, fin_suite/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1, + end_per_suite/1, init_per_testcase/2, end_per_testcase/2, appup_file/1 ]). --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(suite) -> - Cases = - [ - appup_file - ], - {conf, init_per_suite, Cases, fin_suite}. +all() -> +Cases = [appup_file], + Cases. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -76,9 +84,9 @@ file_name(App, Ext) -> filename:join([LibDir, "ebin", atom_to_list(App) ++ Ext]). -fin_suite(suite) -> []; -fin_suite(doc) -> []; -fin_suite(Config) when is_list(Config) -> +end_per_suite(suite) -> []; +end_per_suite(doc) -> []; +end_per_suite(Config) when is_list(Config) -> Config. diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl index 7c1b278ac7..98ffaf8bae 100644 --- a/lib/snmp/test/snmp_compiler_test.erl +++ b/lib/snmp/test/snmp_compiler_test.erl @@ -28,7 +28,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). @@ -37,7 +37,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, description/1, @@ -45,7 +45,7 @@ imports/1, module_identity/1, - tickets/1, + otp_6150/1, otp_8574/1, otp_8595/1 @@ -90,21 +90,20 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - description, - oid_conflicts, - imports, - module_identity, - tickets - ]. - -tickets(suite) -> - [ - otp_6150, - otp_8574, - otp_8595 - ]. +all() -> +[description, oid_conflicts, imports, module_identity, + {group, tickets}]. + +groups() -> + [{tickets, [], [otp_6150, otp_8574, otp_8595]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + %%====================================================================== diff --git a/lib/snmp/test/snmp_conf_test.erl b/lib/snmp/test/snmp_conf_test.erl index 90416919d0..c4341d8d7e 100644 --- a/lib/snmp/test/snmp_conf_test.erl +++ b/lib/snmp/test/snmp_conf_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/STANDARD-MIB.hrl"). @@ -37,7 +37,7 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, check_mandatory/1, @@ -86,26 +86,22 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - check_mandatory, - check_integer1, - check_integer2, - check_string1, - check_string2, - check_atom, - check_ip, - check_taddress, - check_packet_size, - check_oid, - check_sec_model1, - check_sec_model2, - check_sec_level, - check_timer, - - read, - read_files - ]. +all() -> +[check_mandatory, check_integer1, check_integer2, + check_string1, check_string2, check_atom, check_ip, + check_taddress, check_packet_size, check_oid, + check_sec_model1, check_sec_model2, check_sec_level, + check_timer, read, read_files]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl index dd2f27862e..b692017407 100644 --- a/lib/snmp/test/snmp_log_test.erl +++ b/lib/snmp/test/snmp_log_test.erl @@ -29,7 +29,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -define(SNMP_USE_V3, true). -include_lib("snmp/include/snmp_types.hrl"). @@ -42,17 +42,17 @@ -export([ init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, open_and_close/1, - open_write_and_close/1, + open_write_and_close1/1, open_write_and_close2/1, open_write_and_close3/1, open_write_and_close4/1, - log_to_io/1, + log_to_io1/1, log_to_io2/1, - log_to_txt/1, + log_to_txt1/1, log_to_txt2/1, log_to_txt3/1 @@ -108,37 +108,30 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== %% ?SKIP(not_yet_implemented). -all(suite) -> - [ - open_and_close, - open_write_and_close, - log_to_io, - log_to_txt - ]. - - -open_write_and_close(suite) -> - [ - open_write_and_close1, - open_write_and_close2, - open_write_and_close3, - open_write_and_close4 - ]. - - -log_to_io(suite) -> - [ - log_to_io1, - log_to_io2 - ]. - - -log_to_txt(suite) -> - [ - log_to_txt1, - log_to_txt2, - log_to_txt3 - ]. +all() -> +[open_and_close, {group, open_write_and_close}, + {group, log_to_io}, {group, log_to_txt}]. + +groups() -> + [{open_write_and_close, [], + [open_write_and_close1, open_write_and_close2, + open_write_and_close3, open_write_and_close4]}, + {log_to_io, [], [log_to_io1, log_to_io2]}, + {log_to_txt, [], + [log_to_txt1, log_to_txt2, log_to_txt3]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_manager_config_test.erl b/lib/snmp/test/snmp_manager_config_test.erl index f3a4d70ef8..a72dd0cc22 100644 --- a/lib/snmp/test/snmp_manager_config_test.erl +++ b/lib/snmp/test/snmp_manager_config_test.erl @@ -31,7 +31,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/src/manager/snmpm_usm.hrl"). @@ -42,10 +42,10 @@ %% -compile(export_all). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - start_and_stop/1, + simple_start_and_stop/1, start_without_mandatory_opts1/1, @@ -58,36 +58,36 @@ start_with_invalid_agents_conf_file1/1, start_with_invalid_usm_conf_file1/1, - normal_op/1, + - system/1, + simple_system_op/1, - users/1, + register_user_using_file/1, register_user_using_function/1, register_user_failed_using_function1/1, - agents/1, + register_agent_using_file/1, register_agent_using_function/1, register_agent_failed_using_function1/1, - usm_users/1, + register_usm_user_using_file/1, register_usm_user_using_function/1, register_usm_user_failed_using_function1/1, update_usm_user_info/1, - counter/1, + create_and_increment/1, - stats_counter/1, + stats_create_and_increment/1, - tickets/1, + otp_7219/1, - otp_8395/1, + otp_8395_1/1, otp_8395_2/1, otp_8395_3/1, @@ -163,33 +163,55 @@ end_per_testcase(Case, Config) when is_list(Config) -> %%====================================================================== % all(doc) -> % "The top snmp manager config test case"; -all(suite) -> - [ - start_and_stop, - normal_op, - tickets - ]. +all() -> +[{group, start_and_stop}, {group, normal_op}, + {group, tickets}]. + +groups() -> + [{start_and_stop, [], + [simple_start_and_stop, start_without_mandatory_opts1, + start_without_mandatory_opts2, + start_with_all_valid_opts, start_with_unknown_opts, + start_with_incorrect_opts, + start_with_invalid_manager_conf_file1, + start_with_invalid_users_conf_file1, + start_with_invalid_agents_conf_file1, + start_with_invalid_usm_conf_file1]}, + {normal_op, [], + [{group, system}, {group, agents}, {group, users}, + {group, usm_users}, {group, counter}, + {group, stats_counter}]}, + {system, [], [simple_system_op]}, + {users, [], + [register_user_using_file, register_user_using_function, + register_user_failed_using_function1]}, + {agents, [], + [register_agent_using_file, + register_agent_using_function, + register_agent_failed_using_function1]}, + {usm_users, [], + [register_usm_user_using_file, + register_usm_user_using_function, + register_usm_user_failed_using_function1, + update_usm_user_info]}, + {counter, [], [create_and_increment]}, + {stats_counter, [], [stats_create_and_increment]}, + {tickets, [], [otp_7219, {group, otp_8395}]}, + {otp_8395, [], + [otp_8395_1, otp_8395_2, otp_8395_3, otp_8395_4]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== %% Test functions %%====================================================================== -start_and_stop(doc) -> - "A collection of start and stop tests"; -start_and_stop(suite) -> - [ - simple_start_and_stop, - start_without_mandatory_opts1, - start_without_mandatory_opts2, - start_with_all_valid_opts, - start_with_unknown_opts, - start_with_incorrect_opts, - start_with_invalid_manager_conf_file1, - start_with_invalid_users_conf_file1, - start_with_invalid_agents_conf_file1, - start_with_invalid_usm_conf_file1 - ]. %% @@ -1641,29 +1663,12 @@ start_with_invalid_usm_conf_file1(Conf) when is_list(Conf) -> %% --- %% -normal_op(doc) -> - "A collection of tests for normal operation"; -normal_op(suite) -> - [ - system, - agents, - users, - usm_users, - counter, - stats_counter - ]. %% %% --- %% -system(doc) -> - "Various system related operations with the snmp manager config"; -system(suite) -> - [ - simple_system_op - ]. simple_system_op(suite) -> []; simple_system_op(doc) -> @@ -1702,14 +1707,6 @@ simple_system_op(Conf) when is_list(Conf) -> %% --- %% -users(doc) -> - "Various users related operations with the snmp manager config"; -users(suite) -> - [ - register_user_using_file, - register_user_using_function, - register_user_failed_using_function1 - ]. %% @@ -1764,14 +1761,6 @@ register_user_failed_using_function1(Conf) when is_list(Conf) -> %% --- %% -agents(doc) -> - "Various agents related operations with the snmp manager config"; -agents(suite) -> - [ - register_agent_using_file, - register_agent_using_function, - register_agent_failed_using_function1 - ]. %% @@ -1950,15 +1939,6 @@ register_agent_failed_using_function1(Conf) when is_list(Conf) -> %% --- %% -usm_users(doc) -> - "Various USM users related operations with the snmp manager config"; -usm_users(suite) -> - [ - register_usm_user_using_file, - register_usm_user_using_function, - register_usm_user_failed_using_function1, - update_usm_user_info - ]. %% @@ -2208,12 +2188,6 @@ update_usm_user_info(Conf) when is_list(Conf) -> %% --- %% -counter(doc) -> - "Various counter related operations with the snmp manager config"; -counter(suite) -> - [ - create_and_increment - ]. %% @@ -2258,13 +2232,6 @@ create_and_increment(Conf) when is_list(Conf) -> %% --- %% -stats_counter(doc) -> - "Various statistic counter related operations with the " - "snmp manager config"; -stats_counter(suite) -> - [ - stats_create_and_increment - ]. %% @@ -2323,11 +2290,6 @@ loop(N, _, F) when (N > 0) andalso is_function(F) -> %% Ticket test-cases %%====================================================================== -tickets(suite) -> - [ - otp_7219, - otp_8395 - ]. otp_7219(suite) -> @@ -2379,13 +2341,6 @@ otp_7219(Config) when is_list(Config) -> -otp_8395(suite) -> - [ - otp_8395_1, - otp_8395_2, - otp_8395_3, - otp_8395_4 - ]. otp_8395_1(suite) -> []; otp_8395_1(doc) -> diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl index 83e861589d..50836db731 100644 --- a/lib/snmp/test/snmp_manager_test.erl +++ b/lib/snmp/test/snmp_manager_test.erl @@ -31,7 +31,7 @@ %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). -include("snmp_test_data/Test2.hrl"). @@ -43,10 +43,10 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - start_and_stop_tests/1, + simple_start_and_stop1/1, simple_start_and_stop2/1, simple_start_and_monitor_crash1/1, @@ -54,49 +54,49 @@ notify_started01/1, notify_started02/1, - user_tests/1, + register_user1/1, - agent_tests/1, + register_agent1/1, register_agent2/1, - misc_tests/1, + info/1, - request_tests/1, + - get_tests/1, + simple_sync_get1/1, simple_sync_get2/1, simple_async_get1/1, simple_async_get2/1, - get_next_tests/1, + simple_sync_get_next1/1, simple_sync_get_next2/1, simple_async_get_next1/1, simple_async_get_next2/1, - set_tests/1, + simple_sync_set1/1, simple_sync_set2/1, simple_async_set1/1, simple_async_set2/1, - bulk_tests/1, + simple_sync_get_bulk1/1, simple_sync_get_bulk2/1, simple_async_get_bulk1/1, simple_async_get_bulk2/1, - misc_request_tests/1, + misc_async1/1, misc_async2/1, discovery/1, - event_tests/1, + trap1/1, trap2/1, @@ -109,10 +109,10 @@ report/1, - tickets/1, - otp8015/1, + + otp8015_1/1, - otp8395/1, + otp8395_1/1 ]). @@ -359,118 +359,64 @@ end_per_testcase2(Case, Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - start_and_stop_tests, - misc_tests, - user_tests, - agent_tests, - request_tests, - event_tests, - discovery, - tickets - ]. - -start_and_stop_tests(suite) -> - [ - simple_start_and_stop1, - simple_start_and_stop2, - simple_start_and_monitor_crash1, - simple_start_and_monitor_crash2, - notify_started01, - notify_started02 - ]. - -misc_tests(suite) -> - [ - info - ]. - -user_tests(suite) -> - [ - register_user1 - ]. - -agent_tests(suite) -> - [ - register_agent1, - register_agent2 - ]. - -request_tests(suite) -> - [ - get_tests, - get_next_tests, - set_tests, - bulk_tests, - misc_request_tests - ]. - -get_tests(suite) -> - [ - simple_sync_get1, - simple_sync_get2, - simple_async_get1, - simple_async_get2 - ]. - -get_next_tests(suite) -> - [ - simple_sync_get_next1, - simple_sync_get_next2, - simple_async_get_next1, - simple_async_get_next2 - ]. - -set_tests(suite) -> - [ - simple_sync_set1, - simple_sync_set2, - simple_async_set1, - simple_async_set2 - ]. - -bulk_tests(suite) -> - [ - simple_sync_get_bulk1, - simple_sync_get_bulk2, - simple_async_get_bulk1, - simple_async_get_bulk2 - ]. - -misc_request_tests(suite) -> - [ - misc_async1, - misc_async2 - ]. - -event_tests(suite) -> - [ - trap1, - trap2, - inform1, - inform2, - inform3, - inform4, - inform_swarm, - report - ]. - -tickets(suite) -> - [ - otp8015, - otp8395 - ]. - -otp8015(suite) -> - [ - otp8015_1 - ]. - -otp8395(suite) -> - [ - otp8395_1 - ]. +all() -> +[{group, start_and_stop_tests}, {group, misc_tests}, + {group, user_tests}, {group, agent_tests}, + {group, request_tests}, {group, event_tests}, discovery, + {group, tickets}]. + +groups() -> + [{start_and_stop_tests, [], + [simple_start_and_stop1, simple_start_and_stop2, + simple_start_and_monitor_crash1, + simple_start_and_monitor_crash2, notify_started01, + notify_started02]}, + {misc_tests, [], [info]}, + {user_tests, [], [register_user1]}, + {agent_tests, [], [register_agent1, register_agent2]}, + {request_tests, [], + [{group, get_tests}, {group, get_next_tests}, + {group, set_tests}, {group, bulk_tests}, + {group, misc_request_tests}]}, + {get_tests, [], + [simple_sync_get1, simple_sync_get2, simple_async_get1, + simple_async_get2]}, + {get_next_tests, [], + [simple_sync_get_next1, simple_sync_get_next2, + simple_async_get_next1, simple_async_get_next2]}, + {set_tests, [], + [simple_sync_set1, simple_sync_set2, simple_async_set1, + simple_async_set2]}, + {bulk_tests, [], + [simple_sync_get_bulk1, simple_sync_get_bulk2, + simple_async_get_bulk1, simple_async_get_bulk2]}, + {misc_request_tests, [], [misc_async1, misc_async2]}, + {event_tests, [], + [trap1, trap2, inform1, inform2, inform3, inform4, + inform_swarm, report]}, + {tickets, [], [{group, otp8015}, {group, otp8395}]}, + {otp8015, [], [otp8015_1]}, {otp8395, [], [otp8395_1]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + + + + + + + + + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_manager_user_test.erl b/lib/snmp/test/snmp_manager_user_test.erl index b80af16485..fefa1ad713 100644 --- a/lib/snmp/test/snmp_manager_user_test.erl +++ b/lib/snmp/test/snmp_manager_user_test.erl @@ -26,7 +26,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("test_server/include/test_server.hrl"). -include("snmp_test_lib.hrl"). @@ -36,10 +36,10 @@ %% -compile(export_all). -export([ - all/1, +all/0,groups/0,init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2, - register_user/1, + simple_register_and_unregister1/1, simple_register_and_unregister2/1, simple_register_and_unregister3/1, @@ -62,7 +62,7 @@ register_monitor_request_and_crash3/1, register_monitor_request_and_crash4/1, - tickets/1, + otp7902/1 ]). @@ -134,42 +134,41 @@ end_per_testcase(Case, Config) when is_list(Config) -> %% Test case definitions %%====================================================================== -all(suite) -> - [ - register_user, - tickets - ]. - -register_user(suite) -> - [ - simple_register_and_unregister1, - simple_register_and_unregister2, - simple_register_and_unregister3, - register_and_crash1, - register_and_crash2, - register_and_crash3, - register_request_and_crash1, - register_request_and_crash2, - register_request_and_crash3, - simple_register_monitor_and_unregister1, - simple_register_monitor_and_unregister2, - simple_register_monitor_and_unregister3, - register_monitor_and_crash1, - register_monitor_and_crash2, - register_monitor_and_crash3, - register_monitor_and_crash4, - register_monitor_and_crash5, - register_monitor_request_and_crash1, - register_monitor_request_and_crash2, - register_monitor_request_and_crash3, - register_monitor_request_and_crash4 - ]. - - -tickets(suite) -> - [ - otp7902 - ]. +all() -> +[{group, register_user}, {group, tickets}]. + +groups() -> + [{register_user, [], + [simple_register_and_unregister1, + simple_register_and_unregister2, + simple_register_and_unregister3, register_and_crash1, + register_and_crash2, register_and_crash3, + register_request_and_crash1, + register_request_and_crash2, + register_request_and_crash3, + simple_register_monitor_and_unregister1, + simple_register_monitor_and_unregister2, + simple_register_monitor_and_unregister3, + register_monitor_and_crash1, + register_monitor_and_crash2, + register_monitor_and_crash3, + register_monitor_and_crash4, + register_monitor_and_crash5, + register_monitor_request_and_crash1, + register_monitor_request_and_crash2, + register_monitor_request_and_crash3, + register_monitor_request_and_crash4]}, + {tickets, [], [otp7902]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + + %%====================================================================== diff --git a/lib/snmp/test/snmp_note_store_test.erl b/lib/snmp/test/snmp_note_store_test.erl index 763c708bd6..24ba88f986 100644 --- a/lib/snmp/test/snmp_note_store_test.erl +++ b/lib/snmp/test/snmp_note_store_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). @@ -34,7 +34,7 @@ %%---------------------------------------------------------------------- -export([ init_per_testcase/2, end_per_testcase/2, - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, start_and_stop/1, notes/1, info/1, @@ -69,14 +69,18 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - start_and_stop, - notes, - info, - garbage_in - - ]. +all() -> +[start_and_stop, notes, info, garbage_in]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%====================================================================== diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl index 7041552abf..ef510ad62e 100644 --- a/lib/snmp/test/snmp_pdus_test.erl +++ b/lib/snmp/test/snmp_pdus_test.erl @@ -25,7 +25,7 @@ %%---------------------------------------------------------------------- %% Include files %%---------------------------------------------------------------------- --include("test_server.hrl"). +-include_lib("common_test/include/ct.hrl"). -include("snmp_test_lib.hrl"). -include_lib("snmp/include/snmp_types.hrl"). @@ -34,8 +34,8 @@ %% External exports %%---------------------------------------------------------------------- -export([ - all/1, - tickets/1, + all/0,groups/0,init_per_group/2,end_per_group/2, + otp7575/1, otp8563/1, init_per_testcase/2, end_per_testcase/2 @@ -71,16 +71,19 @@ end_per_testcase(_Case, Config) when is_list(Config) -> %%====================================================================== %% Test case definitions %%====================================================================== -all(suite) -> - [ - tickets - ]. - -tickets(suite) -> - [ - otp7575, - otp8563 - ]. +all() -> +[{group, tickets}]. + +groups() -> + [{tickets, [], [otp7575, otp8563]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + |