diff options
20 files changed, 890 insertions, 1456 deletions
diff --git a/lib/mnesia/test/mnesia.spec b/lib/mnesia/test/mnesia.spec index 596f8b917d..d24873eed0 100644 --- a/lib/mnesia/test/mnesia.spec +++ b/lib/mnesia/test/mnesia.spec @@ -1,23 +1,76 @@ -{topcase, {dir, "../mnesia_test"}}. -{require_nodenames, 2}. -{skip, {mnesia_measure_test, ram_meter, "Takes to long time"}}. -{skip, {mnesia_measure_test, disc_meter, "Takes to long time"}}. -{skip, {mnesia_measure_test, disc_only_meter, "Takes to long time"}}. -{skip, {mnesia_measure_test, cost, "Takes to long time"}}. -{skip, {mnesia_measure_test, dbn_meters, "Takes to long time"}}. -{skip, {mnesia_measure_test, tpcb, "Takes to long time"}}. -{skip, {mnesia_measure_test, prediction, "Not yet implemented"}}. -{skip, {mnesia_measure_test, consumption, "Not yet implemented"}}. -{skip, {mnesia_measure_test, scalability, "Not yet implemented"}}. -{skip, {mnesia_measure_test, tpcb, "Takes too much time and memory"}}. -{skip, {mnesia_measure_test, measure_all_api_functions, "Not yet implemented"}}. -{skip, {mnesia_measure_test, mnemosyne_vs_mnesia_kernel, "Not yet implemented"}}. -{skip, {mnesia_examples_test, company, "Not yet implemented"}}. -{skip, {mnesia_config_test, ignore_fallback_at_startup, "Not yet implemented"}}. -{skip, {mnesia_evil_backup, local_backup_checkpoint, "Not yet implemented"}}. -{skip, {mnesia_config_test, max_wait_for_decision, "Not yet implemented"}}. -{skip, {mnesia_recovery_test, after_full_disc_partition, "Not yet implemented"}}. -{skip, {mnesia_recovery_test, system_upgrade, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_change_table_copy_type, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_transform_table, "Not yet implemented"}}. -{skip, {mnesia_consistency_test, consistency_after_rename_of_node, "Not yet implemented"}}. +{suites,"mnesia_test",all}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [ram_meter], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [disc_meter], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [disc_only_meter], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test,[cost],"Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [dbn_meters], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [ram_tpcb,disc_tpcb,disc_only_tpcb], + "Takes to long time"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [reader_disturbed_by_node_down,writer_disturbed_by_node_down, + reader_disturbed_by_node_up,writer_disturbed_by_node_up, + reader_disturbed_by_schema_ops,writer_disturbed_by_schema_ops, + reader_disturbed_by_checkpoint,writer_disturbed_by_checkpoint, + reader_disturbed_by_dump_log,writer_disturbed_by_dump_log, + reader_disturbed_by_backup,writer_disturbed_by_backup, + reader_disturbed_by_restore,writer_disturbed_by_restore, + reader_competing_with_reader,reader_competing_with_writer, + writer_competing_with_reader,writer_competing_with_writer], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [measure_resource_consumption,determine_resource_leakage], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [determine_system_limits,performance_at_min_config, + performance_at_max_config,performance_at_full_load, + resource_consumption_at_min_config, + resource_consumption_at_max_config, + resource_consumption_at_full_load], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [ram_tpcb,disc_tpcb,disc_only_tpcb], + "Takes too much time and memory"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [measure_all_api_functions], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_measure_test, + [mnemosyne_vs_mnesia_kernel], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_examples_test, + [company], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_config_test, + [ignore_fallback_at_startup], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_evil_backup, + [local_backup_checkpoint], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_config_test, + [max_wait_for_decision], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_recovery_test, + [after_full_disc_partition], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_recovery_test, + [system_upgrade], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_consistency_test, + [consistency_after_change_table_copy_type], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_consistency_test, + [consistency_after_transform_table_ram, + consistency_after_transform_table_disc, + consistency_after_transform_table_disc_only], + "Not yet implemented"}. +{skip_cases,"mnesia_test",mnesia_consistency_test, + [consistency_after_rename_of_node], + "Not yet implemented"}. diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl index 9c5314bca5..2b9f885c80 100644 --- a/lib/mnesia/test/mnesia_SUITE.erl +++ b/lib/mnesia/test/mnesia_SUITE.erl @@ -30,130 +30,107 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify that Mnesia really is a distributed real-time DBMS", - "This is the test suite of the Mnesia DBMS. The test suite", - "covers many aspects of usage and is indended to be developed", - "incrementally. The test suite is divided into a hierarchy of test", - "suites where the leafs actually implements the test cases.", - "The intention of each test case and sub test suite can be", - "read in comments where they are implemented or in worst cases", - "from their long mnemonic names. ", - "", - "The most simple test case of them all is called 'silly'", - "and is useful to run now and then, e.g. when some new fatal", - "bug has been introduced. It may be run even if Mnesia is in", - "such a bad shape that the test machinery cannot be used.", - "NB! Invoke the function directly with mnesia_SUITE:silly()", - "and do not involve the normal test machinery."]; -all(suite) -> - [ - light, - medium, - heavy, - clean_up_suite - ]. +all() -> +[{group, light}, {group, medium}, {group, heavy}, + clean_up_suite]. + +groups() -> + [{light, [], + [{group, install}, {group, nice}, {group, evil}, + {mnesia_frag_test, [{group, light}]}, {group, qlc}, + {group, registry}, {group, config}, {group, examples}]}, + {install, [], [{mnesia_install_test, all}]}, + {nice, [], [{mnesia_nice_coverage_test, all}]}, + {evil, [], [{mnesia_evil_coverage_test, all}]}, + {qlc, [], [{mnesia_qlc_test, all}]}, + {registry, [], [{mnesia_registry_test, all}]}, + {config, [], [{mnesia_config_test, all}]}, + {examples, [], [{mnesia_examples_test, all}]}, + {medium, [], + [{group, install}, {group, atomicity}, + {group, isolation}, {group, durability}, + {group, recovery}, {group, consistency}, + {mnesia_frag_test, [{group, medium}]}]}, + {atomicity, [], [{mnesia_atomicity_test, all}]}, + {isolation, [], [{mnesia_isolation_test, all}]}, + {durability, [], [{mnesia_durability_test, all}]}, + {recovery, [], [{mnesia_recovery_test, all}]}, + {consistency, [], [{mnesia_consistency_test, all}]}, + {heavy, [], [{group, measure}]}, + {measure, [], [{mnesia_measure_test, all}]}, + {prediction, [], + [{mnesia_measure_test, [{group, prediction}]}]}, + {fairness, [], + [{mnesia_measure_test, [{group, fairness}]}]}, + {benchmarks, [], + [{mnesia_measure_test, [{group, benchmarks}]}]}, + {consumption, [], + [{mnesia_measure_test, [{group, consumption}]}]}, + {scalability, [], + [{mnesia_measure_test, [{group, scalability}]}]}, + {otp_r4b, [], + [{mnesia_config_test, access_module}, + {mnesia_config_test, dump_log_load_regulation}, + {mnesia_config_test, embedded_mnemosyne}, + {mnesia_config_test, ignore_fallback_at_startup}, + {mnesia_config_test, max_wait_for_decision}, + {mnesia_consistency_test, consistency_after_restore}, + {mnesia_evil_backup, restore}, + {mnesia_evil_coverage_test, offline_set_master_nodes}, + {mnesia_evil_coverage_test, record_name}, + {mnesia_evil_coverage_test, user_properties}, + {mnesia_registry_test, all}, {group, otp_2363}]}, + {otp_2363, [], + [{mnesia_dirty_access_test, + dirty_index_match_object_disc_only}, + {mnesia_dirty_access_test, dirty_index_read_disc_only}, + {mnesia_dirty_access_test, + dirty_index_update_bag_disc_only}, + {mnesia_dirty_access_test, + dirty_index_update_set_disc_only}, + {mnesia_evil_coverage_test, + create_live_table_index_disc_only}]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + +init_per_suite(Config) -> + Config. + +end_per_suite(Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% silly() -> mnesia_install_test:silly(). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -light(doc) -> - ["The 'light' test suite runs a selected set of test suites and is", - "intended to be the smallest test suite that is meaningful", - "to run. It starts with an installation test (which in essence is the", - "'silly' test case) and then it covers all functions in the API in", - "various depths. All configuration parameters and examples are also", - "covered."]; -light(suite) -> - [ - install, - nice, - evil, - {mnesia_frag_test, light}, - qlc, - registry, - config, - examples - ]. - -install(suite) -> - [{mnesia_install_test, all}]. - -nice(suite) -> - [{mnesia_nice_coverage_test, all}]. - -evil(suite) -> - [{mnesia_evil_coverage_test, all}]. - -qlc(suite) -> - [{mnesia_qlc_test, all}]. - -registry(suite) -> - [{mnesia_registry_test, all}]. - -config(suite) -> - [{mnesia_config_test, all}]. - -examples(suite) -> - [{mnesia_examples_test, all}]. + + + + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -medium(doc) -> - ["The 'medium' test suite verfies the ACID (atomicity, consistency", - "isolation and durability) properties and various recovery scenarios", - "These tests may take quite while to run."]; -medium(suite) -> - [ - install, - atomicity, - isolation, - durability, - recovery, - consistency, - {mnesia_frag_test, medium} - ]. - -atomicity(suite) -> - [{mnesia_atomicity_test, all}]. + -isolation(suite) -> - [{mnesia_isolation_test, all}]. -durability(suite) -> - [{mnesia_durability_test, all}]. -recovery(suite) -> - [{mnesia_recovery_test, all}]. -consistency(suite) -> - [{mnesia_consistency_test, all}]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -heavy(doc) -> - ["The 'heavy' test suite runs some resource consuming tests and", - "benchmarks"]; -heavy(suite) -> - [measure]. -measure(suite) -> - [{mnesia_measure_test, all}]. -prediction(suite) -> - [{mnesia_measure_test, prediction}]. -fairness(suite) -> - [{mnesia_measure_test, fairness}]. -benchmarks(suite) -> - [{mnesia_measure_test, benchmarks}]. -consumption(suite) -> - [{mnesia_measure_test, consumption}]. -scalability(suite) -> - [{mnesia_measure_test, scalability}]. clean_up_suite(doc) -> ["Not a test case only kills mnesia and nodes, that where" @@ -169,35 +146,7 @@ clean_up_suite(Config) when is_list(Config)-> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -otp_r4b(doc) -> - ["This test suite is an extract of the grand Mnesia suite", - "it contains OTP R4B specific test cases"]; -otp_r4b(suite) -> - [ - {mnesia_config_test, access_module}, - {mnesia_config_test, dump_log_load_regulation}, - {mnesia_config_test, embedded_mnemosyne}, - {mnesia_config_test, ignore_fallback_at_startup}, - {mnesia_config_test, max_wait_for_decision}, - {mnesia_consistency_test, consistency_after_restore}, - {mnesia_evil_backup, restore}, - {mnesia_evil_coverage_test, offline_set_master_nodes}, - {mnesia_evil_coverage_test, record_name}, - {mnesia_evil_coverage_test, user_properties}, - {mnesia_registry_test, all}, - otp_2363 - ]. - -otp_2363(doc) -> - ["Index on disc only tables"]; -otp_2363(suite) -> - [ - {mnesia_dirty_access_test, dirty_index_match_object_disc_only}, - {mnesia_dirty_access_test,dirty_index_read_disc_only}, - {mnesia_dirty_access_test,dirty_index_update_bag_disc_only}, - {mnesia_dirty_access_test,dirty_index_update_set_disc_only}, - {mnesia_evil_coverage_test, create_live_table_index_disc_only} - ]. + diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl index ff34029c9b..3fe38645d6 100644 --- a/lib/mnesia/test/mnesia_atomicity_test.erl +++ b/lib/mnesia/test/mnesia_atomicity_test.erl @@ -31,20 +31,42 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify atomicity of transactions", - "Verify that transactions are atomic, i.e. either all operations", - "in a transaction will be performed or none of them. It must be", - "assured that no partitially completed operations leaves any", - "effects in the database."]; -all(suite) -> - [ - explicit_abort_in_middle_of_trans, - runtime_error_in_middle_of_trans, - kill_self_in_middle_of_trans, - throw_in_middle_of_trans, - mnesia_down_in_middle_of_trans - ]. +all() -> +[explicit_abort_in_middle_of_trans, + runtime_error_in_middle_of_trans, + kill_self_in_middle_of_trans, throw_in_middle_of_trans, + {group, mnesia_down_in_middle_of_trans}]. + +groups() -> + [{mnesia_down_in_middle_of_trans, [], + [mnesia_down_during_infinite_trans, + {group, lock_waiter}, {group, restart_check}]}, + {lock_waiter, [], + [lock_waiter_sw_r, lock_waiter_sw_rt, lock_waiter_sw_wt, + lock_waiter_wr_r, lock_waiter_srw_r, lock_waiter_sw_sw, + lock_waiter_sw_w, lock_waiter_sw_wr, lock_waiter_sw_srw, + lock_waiter_wr_wt, lock_waiter_srw_wt, + lock_waiter_wr_sw, lock_waiter_srw_sw, lock_waiter_wr_w, + lock_waiter_srw_w, lock_waiter_r_sw, lock_waiter_r_w, + lock_waiter_r_wt, lock_waiter_rt_sw, lock_waiter_rt_w, + lock_waiter_rt_wt, lock_waiter_wr_wr, + lock_waiter_srw_srw, lock_waiter_wt_r, lock_waiter_wt_w, + lock_waiter_wt_rt, lock_waiter_wt_wt, lock_waiter_wt_wr, + lock_waiter_wt_srw, lock_waiter_wt_sw, lock_waiter_w_wr, + lock_waiter_w_srw, lock_waiter_w_sw, lock_waiter_w_r, + lock_waiter_w_w, lock_waiter_w_rt, lock_waiter_w_wt]}, + {restart_check, [], + [restart_r_one, restart_w_one, restart_rt_one, + restart_wt_one, restart_wr_one, restart_sw_one, + restart_r_two, restart_w_two, restart_rt_two, + restart_wt_two, restart_wr_two, restart_sw_two]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% explicit_abort_in_middle_of_trans(suite) -> []; @@ -259,12 +281,6 @@ throw_in_middle_of_trans(Config) when is_list(Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down_in_middle_of_trans(suite) -> - [ - mnesia_down_during_infinite_trans, - lock_waiter, - restart_check - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% mnesia_down_during_infinite_trans(suite) -> []; @@ -304,56 +320,6 @@ mnesia_down_during_infinite_trans(Config) when is_list(Config) -> ?verify_mnesia([Node2], [Node1]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -lock_waiter(doc) -> - ["The purpose of this test case is to test the following situation:", - "process B locks an object, process A accesses that object as", - "well, but A has to wait for the lock to be released. Then", - "mnesia of B goes down. Question: will A get the lock ?", - "important: the transaction of A is the oldest one !!! (= a little tricky)", - "", - "several different access operations shall be tested", - "rt = read_lock_table, wt = write_lock_table, r = read,", - "sw = s_write, w = write, wr = wread"]; -lock_waiter(suite) -> - [ - lock_waiter_sw_r, - lock_waiter_sw_rt, - lock_waiter_sw_wt, - lock_waiter_wr_r, - lock_waiter_srw_r, - lock_waiter_sw_sw, - lock_waiter_sw_w, - lock_waiter_sw_wr, - lock_waiter_sw_srw, - lock_waiter_wr_wt, - lock_waiter_srw_wt, - lock_waiter_wr_sw, - lock_waiter_srw_sw, - lock_waiter_wr_w, - lock_waiter_srw_w, - lock_waiter_r_sw, - lock_waiter_r_w, - lock_waiter_r_wt, - lock_waiter_rt_sw, - lock_waiter_rt_w, - lock_waiter_rt_wt, - lock_waiter_wr_wr, - lock_waiter_srw_srw, - lock_waiter_wt_r, - lock_waiter_wt_w, - lock_waiter_wt_rt, - lock_waiter_wt_wt, - lock_waiter_wt_wr, - lock_waiter_wt_srw, - lock_waiter_wt_sw, - lock_waiter_w_wr, - lock_waiter_w_srw, - lock_waiter_w_sw, - lock_waiter_w_r, - lock_waiter_w_w, - lock_waiter_w_rt, - lock_waiter_w_wt - ]. lock_waiter_sw_r(suite) -> []; lock_waiter_sw_r(Config) when is_list(Config) -> @@ -649,29 +615,6 @@ wait(Mseconds) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -restart_check (doc) -> - [ - "test case:'A' performs a transaction on a table which", - "is only replicated on node B. During that transaction", - "mnesia on node B is killed. The transaction of A should", - "be stopped, since there is no further replica", - "rt = read_lock_table, wt = write_lock_table, r = read,", - "sw = s_write, w = write, wr = wread,"]; -restart_check(suite) -> - [ - restart_r_one, - restart_w_one, - restart_rt_one, - restart_wt_one, - restart_wr_one, - restart_sw_one, - restart_r_two, - restart_w_two, - restart_rt_two, - restart_wt_two, - restart_wr_two, - restart_sw_two - ]. restart_r_one(suite) -> []; restart_r_one(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl index 6e998329a4..ac74a69334 100644 --- a/lib/mnesia/test/mnesia_config_test.erl +++ b/lib/mnesia/test/mnesia_config_test.erl @@ -27,14 +27,14 @@ -record(test_table2,{i, b}). -export([ - all/1, + all/0,groups/0,init_per_group/2,end_per_group/2, access_module/1, auto_repair/1, backup_module/1, debug/1, dir/1, dump_log_load_regulation/1, - dump_log_thresholds/1, + dump_log_update_in_place/1, embedded_mnemosyne/1, event_module/1, @@ -44,7 +44,7 @@ send_compressed/1, app_test/1, - schema_config/1, + schema_merge/1, unknown_config/1, @@ -56,7 +56,7 @@ start_first_one_disc_less_then_two_more_disc_less/1, schema_location_and_extra_db_nodes_combinations/1, table_load_to_disc_less_nodes/1, - dynamic_connect/1, + dynamic_basic/1, dynamic_ext/1, dynamic_bad/1, @@ -101,40 +101,34 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - [ - "Test all configuration parameters", - "Perform an exhaustive test of all the various parameters that", - "may be used to configure the Mnesia application.", - "", - "Hint: Check out the unofficial function mnesia:start/1.", - " But be careful to cleanup all configuration parameters", - " afterwards since the rest of the test suite may rely on", - " these default configurations. Perhaps it is best to run", - " these tests in a separate node which is dropped afterwards.", - "Are really all configuration parameters covered?"]; - -all(suite) -> - [ - access_module, - auto_repair, - backup_module, - debug, - dir, - dump_log_load_regulation, - dump_log_thresholds, - dump_log_update_in_place, - embedded_mnemosyne, - event_module, - ignore_fallback_at_startup, - inconsistent_database, - max_wait_for_decision, - send_compressed, - - app_test, - schema_config, - unknown_config - ]. +all() -> +[access_module, auto_repair, backup_module, debug, dir, + dump_log_load_regulation, {group, dump_log_thresholds}, + dump_log_update_in_place, embedded_mnemosyne, + event_module, ignore_fallback_at_startup, + inconsistent_database, max_wait_for_decision, + send_compressed, app_test, {group, schema_config}, + unknown_config]. + +groups() -> + [{dump_log_thresholds, [], + [dump_log_time_threshold, dump_log_write_threshold]}, + {schema_config, [], + [start_one_disc_full_then_one_disc_less, + start_first_one_disc_less_then_one_disc_full, + start_first_one_disc_less_then_two_more_disc_less, + schema_location_and_extra_db_nodes_combinations, + table_load_to_disc_less_nodes, schema_merge, + {group, dynamic_connect}]}, + {dynamic_connect, [], + [dynamic_basic, dynamic_ext, dynamic_bad]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -445,21 +439,6 @@ dump_log_update_in_place(Config) when is_list(Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dump_log_thresholds(doc) -> - ["Elaborate with various values of the dump log thresholds and how", - "they affects each others. Both the dump_log_time_threshold and the", - "dump_log_write_threshold must be covered. Do also check that both", - "kinds of overload events are generated as expected.", - "", - "Logs are checked by first doing whatever has to be done to trigger ", - "a dump, and then stopping Mnesia and then look in the ", - "data files and see that the correct amount of transactions ", - "have been done."]; -dump_log_thresholds(suite) -> - [ - dump_log_time_threshold, - dump_log_write_threshold - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dump_log_write_threshold(doc)-> @@ -783,22 +762,6 @@ event_module(Config) when is_list(Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -schema_config(doc) -> - ["Try many configurations with various schema_location's with and", - "without explicit extra_db_nodes. Do also provoke various schema merge", - "situations. Most of the other test suites focusses on tests where the", - "schema is residing on disc. Now it is time to perform an exhaustive", - "elaboration with various disc less configurations."]; -schema_config(suite) -> - [ - start_one_disc_full_then_one_disc_less, - start_first_one_disc_less_then_one_disc_full, - start_first_one_disc_less_then_two_more_disc_less, - schema_location_and_extra_db_nodes_combinations, - table_load_to_disc_less_nodes, - schema_merge, - dynamic_connect - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% start_one_disc_full_then_one_disc_less(doc)-> ["Start a disk node and then a disk less one. Distribute some", @@ -1160,15 +1123,6 @@ sort(NS) when is_list(NS) -> lists:sort(NS). -dynamic_connect(doc) -> - ["Test the new functionality where we start mnesia first and then " - "connect to the other mnesia nodes"]; -dynamic_connect(suite) -> - [ - dynamic_basic, - dynamic_ext, - dynamic_bad - ]. dynamic_basic(suite) -> []; diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl index e74a6ebd4a..ccd5f416f9 100644 --- a/lib/mnesia/test/mnesia_consistency_test.erl +++ b/lib/mnesia/test/mnesia_consistency_test.erl @@ -31,29 +31,117 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify transaction consistency", - "Consistency is the property of the application that requires any", - "execution of the transaction to take the database from one", - "consistent state to another. Verify that the database is", - "consistent at any point in time.", - "Verify for various configurations.", - " Verify for both set and bag"]; -all(suite) -> - [ - consistency_after_restart, - consistency_after_dump_tables, - consistency_after_add_replica, - consistency_after_del_replica, - consistency_after_move_replica, - consistency_after_transform_table, - consistency_after_change_table_copy_type, - consistency_after_fallback, - consistency_after_restore, - consistency_after_rename_of_node, - checkpoint_retainer_consistency, - backup_consistency - ]. +all() -> +[{group, consistency_after_restart}, + {group, consistency_after_dump_tables}, + {group, consistency_after_add_replica}, + {group, consistency_after_del_replica}, + {group, consistency_after_move_replica}, + {group, consistency_after_transform_table}, + consistency_after_change_table_copy_type, + {group, consistency_after_fallback}, + {group, consistency_after_restore}, + consistency_after_rename_of_node, + {group, checkpoint_retainer_consistency}, + {group, backup_consistency}]. + +groups() -> + [{consistency_after_restart, [], + [consistency_after_restart_1_ram, + consistency_after_restart_1_disc, + consistency_after_restart_1_disc_only, + consistency_after_restart_2_ram, + consistency_after_restart_2_disc, + consistency_after_restart_2_disc_only]}, + {consistency_after_dump_tables, [], + [consistency_after_dump_tables_1_ram, + consistency_after_dump_tables_2_ram]}, + {consistency_after_add_replica, [], + [consistency_after_add_replica_2_ram, + consistency_after_add_replica_2_disc, + consistency_after_add_replica_2_disc_only, + consistency_after_add_replica_3_ram, + consistency_after_add_replica_3_disc, + consistency_after_add_replica_3_disc_only]}, + {consistency_after_del_replica, [], + [consistency_after_del_replica_2_ram, + consistency_after_del_replica_2_disc, + consistency_after_del_replica_2_disc_only, + consistency_after_del_replica_3_ram, + consistency_after_del_replica_3_disc, + consistency_after_del_replica_3_disc_only]}, + {consistency_after_move_replica, [], + [consistency_after_move_replica_2_ram, + consistency_after_move_replica_2_disc, + consistency_after_move_replica_2_disc_only, + consistency_after_move_replica_3_ram, + consistency_after_move_replica_3_disc, + consistency_after_move_replica_3_disc_only]}, + {consistency_after_transform_table, [], + [consistency_after_transform_table_ram, + consistency_after_transform_table_disc, + consistency_after_transform_table_disc_only]}, + {consistency_after_fallback, [], + [consistency_after_fallback_2_ram, + consistency_after_fallback_2_disc, + consistency_after_fallback_2_disc_only, + consistency_after_fallback_3_ram, + consistency_after_fallback_3_disc, + consistency_after_fallback_3_disc_only]}, + {consistency_after_restore, [], + [consistency_after_restore_clear_ram, + consistency_after_restore_clear_disc, + consistency_after_restore_clear_disc_only, + consistency_after_restore_recreate_ram, + consistency_after_restore_recreate_disc, + consistency_after_restore_recreate_disc_only]}, + {checkpoint_retainer_consistency, [], + [{group, updates_during_checkpoint_activation}, + {group, updates_during_checkpoint_iteration}, + {group, load_table_with_activated_checkpoint}, + {group, + add_table_copy_to_table_with_activated_checkpoint}]}, + {updates_during_checkpoint_activation, [], + [updates_during_checkpoint_activation_2_ram, + updates_during_checkpoint_activation_2_disc, + updates_during_checkpoint_activation_2_disc_only, + updates_during_checkpoint_activation_3_ram, + updates_during_checkpoint_activation_3_disc, + updates_during_checkpoint_activation_3_disc_only]}, + {updates_during_checkpoint_iteration, [], + [updates_during_checkpoint_iteration_2_ram, + updates_during_checkpoint_iteration_2_disc, + updates_during_checkpoint_iteration_2_disc_only]}, + {load_table_with_activated_checkpoint, [], + [load_table_with_activated_checkpoint_ram, + load_table_with_activated_checkpoint_disc, + load_table_with_activated_checkpoint_disc_only]}, + {add_table_copy_to_table_with_activated_checkpoint, [], + [add_table_copy_to_table_with_activated_checkpoint_ram, + add_table_copy_to_table_with_activated_checkpoint_disc, + add_table_copy_to_table_with_activated_checkpoint_disc_only]}, + {backup_consistency, [], + [{group, interupted_install_fallback}, + {group, interupted_uninstall_fallback}, + {group, mnesia_down_during_backup_causes_switch}, + {group, mnesia_down_during_backup_causes_abort}, + {group, schema_transactions_during_backup}]}, + {interupted_install_fallback, [], + [inst_fallback_process_dies, fatal_when_inconsistency]}, + {interupted_uninstall_fallback, [], [after_delete]}, + {mnesia_down_during_backup_causes_switch, [], + [cause_switch_before, cause_switch_after]}, + {mnesia_down_during_backup_causes_abort, [], + [cause_abort_before, cause_abort_after]}, + {schema_transactions_during_backup, [], + [change_schema_before, change_schema_after]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -185,15 +273,6 @@ receive_messages(ListOfMsgs) -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_restart(suite) -> - [ - consistency_after_restart_1_ram, - consistency_after_restart_1_disc, - consistency_after_restart_1_disc_only, - consistency_after_restart_2_ram, - consistency_after_restart_2_disc, - consistency_after_restart_2_disc_only - ]. consistency_after_restart_1_ram(suite) -> []; consistency_after_restart_1_ram(Config) when is_list(Config) -> @@ -237,11 +316,6 @@ consistency_after_restart(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_dump_tables(suite) -> - [ - consistency_after_dump_tables_1_ram, - consistency_after_dump_tables_2_ram - ]. consistency_after_dump_tables_1_ram(suite) -> []; consistency_after_dump_tables_1_ram(Config) when is_list(Config) -> @@ -274,15 +348,6 @@ consistency_after_dump_tables(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_add_replica(suite) -> - [ - consistency_after_add_replica_2_ram, - consistency_after_add_replica_2_disc, - consistency_after_add_replica_2_disc_only, - consistency_after_add_replica_3_ram, - consistency_after_add_replica_3_disc, - consistency_after_add_replica_3_disc_only - ]. consistency_after_add_replica_2_ram(suite) -> []; consistency_after_add_replica_2_ram(Config) when is_list(Config) -> @@ -326,15 +391,6 @@ consistency_after_add_replica(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes0, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_del_replica(suite) -> - [ - consistency_after_del_replica_2_ram, - consistency_after_del_replica_2_disc, - consistency_after_del_replica_2_disc_only, - consistency_after_del_replica_3_ram, - consistency_after_del_replica_3_disc, - consistency_after_del_replica_3_disc_only - ]. consistency_after_del_replica_2_ram(suite) -> []; consistency_after_del_replica_2_ram(Config) when is_list(Config) -> @@ -377,15 +433,6 @@ consistency_after_del_replica(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_move_replica(suite) -> - [ - consistency_after_move_replica_2_ram, - consistency_after_move_replica_2_disc, - consistency_after_move_replica_2_disc_only, - consistency_after_move_replica_3_ram, - consistency_after_move_replica_3_disc, - consistency_after_move_replica_3_disc_only - ]. consistency_after_move_replica_2_ram(suite) -> []; consistency_after_move_replica_2_ram(Config) when is_list(Config) -> @@ -430,16 +477,6 @@ consistency_after_move_replica(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_transform_table(doc) -> - ["Check that the database is consistent after transform_table.", - " While applications are updating the involved tables. "]; - -consistency_after_transform_table(suite) -> - [ - consistency_after_transform_table_ram, - consistency_after_transform_table_disc, - consistency_after_transform_table_disc_only - ]. consistency_after_transform_table_ram(suite) -> []; @@ -498,20 +535,6 @@ consistency_after_change_table_copy_type(doc) -> " While applications are updating the involved tables. "]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_fallback(doc) -> - ["Check that installed fallbacks are consistent. Check this by starting ", - "some nodes, run tpcb on them, take a backup at any time, install it ", - "as a fallback, kill all nodes, start mnesia again and check for ", - "any inconsistencies"]; -consistency_after_fallback(suite) -> - [ - consistency_after_fallback_2_ram, - consistency_after_fallback_2_disc, - consistency_after_fallback_2_disc_only, - consistency_after_fallback_3_ram, - consistency_after_fallback_3_disc - , consistency_after_fallback_3_disc_only - ]. consistency_after_fallback_2_ram(suite) -> []; consistency_after_fallback_2_ram(Config) when is_list(Config) -> @@ -583,18 +606,6 @@ consistency_after_fallback(ReplicaType, NodeConfig, Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consistency_after_restore(doc) -> - ["Verify consistency after restore operations."]; - -consistency_after_restore(suite) -> - [ - consistency_after_restore_clear_ram, - consistency_after_restore_clear_disc, - consistency_after_restore_clear_disc_only, - consistency_after_restore_recreate_ram, - consistency_after_restore_recreate_disc, - consistency_after_restore_recreate_disc_only - ]. consistency_after_restore_clear_ram(suite) -> []; consistency_after_restore_clear_ram(Config) when is_list(Config) -> @@ -716,32 +727,8 @@ consistency_after_rename_of_node(doc) -> ["Skipped because it is an unimportant case."]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -checkpoint_retainer_consistency(doc) -> - ["Verify that the contents of a checkpoint retainer has the expected", - "contents in various situations."]; -checkpoint_retainer_consistency(suite) -> - [ - updates_during_checkpoint_activation, - updates_during_checkpoint_iteration, - load_table_with_activated_checkpoint, - add_table_copy_to_table_with_activated_checkpoint - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -updates_during_checkpoint_activation(doc) -> - ["Perform updates while the checkpoint getting activated", - "and verify that all checkpoint retainers associated with", - "different replicas of the same table really has the same", - "contents."]; -updates_during_checkpoint_activation(suite) -> - [ - updates_during_checkpoint_activation_2_ram, - updates_during_checkpoint_activation_2_disc, - updates_during_checkpoint_activation_2_disc_only, - updates_during_checkpoint_activation_3_ram, - updates_during_checkpoint_activation_3_disc - , updates_during_checkpoint_activation_3_disc_only - ]. updates_during_checkpoint_activation_2_ram(suite) -> []; updates_during_checkpoint_activation_2_ram(Config) when is_list(Config) -> @@ -808,17 +795,6 @@ updates_during_checkpoint_activation(ReplicaType,NodeConfig,Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -updates_during_checkpoint_iteration(doc) -> - ["Perform updates while someone is iterating over a checkpoint", - "and verify that the iterator really finds the expected data", - "regardless of ongoing upates."]; - -updates_during_checkpoint_iteration(suite) -> - [ - updates_during_checkpoint_iteration_2_ram, - updates_during_checkpoint_iteration_2_disc - , updates_during_checkpoint_iteration_2_disc_only - ]. updates_during_checkpoint_iteration_2_ram(suite) -> []; updates_during_checkpoint_iteration_2_ram(Config) when is_list(Config) -> @@ -890,17 +866,6 @@ loop_accounts(N_br, N_acc) when N_acc >= 1 -> loop_accounts(_,_) -> done. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -load_table_with_activated_checkpoint(doc) -> - ["Load a table with a checkpoint attached to it and verify that the", - "newly loaded replica also gets a checkpoint retainer attached to it", - "and that it is consistent with the original retainer."]; - -load_table_with_activated_checkpoint(suite) -> - [ - load_table_with_activated_checkpoint_ram, - load_table_with_activated_checkpoint_disc, - load_table_with_activated_checkpoint_disc_only - ]. load_table_with_activated_checkpoint_ram(suite) -> []; load_table_with_activated_checkpoint_ram(Config) when is_list(Config) -> @@ -986,18 +951,6 @@ view(Source, Mod) -> lists:sort(TabList). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -add_table_copy_to_table_with_activated_checkpoint(doc) -> - ["Add a replica to a table with a checkpoint attached to it", - "and verify that the new replica also gets a checkpoint", - "retainer attached to it and that it is consistent with the", - "original retainer."]; - -add_table_copy_to_table_with_activated_checkpoint(suite) -> - [ - add_table_copy_to_table_with_activated_checkpoint_ram, - add_table_copy_to_table_with_activated_checkpoint_disc, - add_table_copy_to_table_with_activated_checkpoint_disc_only - ]. add_table_copy_to_table_with_activated_checkpoint_ram(suite) -> []; add_table_copy_to_table_with_activated_checkpoint_ram(Config) when is_list(Config) -> @@ -1070,25 +1023,8 @@ add_table_copy_to_table_with_activated_checkpoint(Type,Config) -> ?verify_mnesia(Nodes, []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -backup_consistency(suite) -> - [ - interupted_install_fallback, - interupted_uninstall_fallback, - mnesia_down_during_backup_causes_switch, - mnesia_down_during_backup_causes_abort, - schema_transactions_during_backup - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -interupted_install_fallback(doc) -> - ["Verify that a interrupted install_fallback really", - "is performed on all nodes or none"]; - -interupted_install_fallback(suite) -> - [ - inst_fallback_process_dies, - fatal_when_inconsistency - ]. inst_fallback_process_dies(suite) -> []; @@ -1232,13 +1168,6 @@ is_running(Node, Shouldbe) -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -interupted_uninstall_fallback(doc) -> - ["Verify that a interrupted uninstall_fallback really", - "is performed on all nodes or none"]; -interupted_uninstall_fallback(suite) -> - [ - after_delete - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1371,17 +1300,6 @@ do_uninstall(Config,DebugPoint) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down_during_backup_causes_switch(doc) -> - ["Verify that an ongoing backup is not disturbed", - "even if the node hosting the replica that currently", - "is being backup'ed is stopped. The backup utility", - "is expected to switch over to another replica and", - "fulfill the backup."]; -mnesia_down_during_backup_causes_switch(suite) -> - [ - cause_switch_before, - cause_switch_after - ]. %%%%%%%%%%%%%%% @@ -1401,16 +1319,6 @@ cause_switch_after(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down_during_backup_causes_abort(doc) -> - ["Verify that an ongoing backup is aborted nicely", - "without leaving any backup file if the last replica", - "of a table becomes unavailable due to a node down", - "or some crash."]; -mnesia_down_during_backup_causes_abort(suite) -> - [ - cause_abort_before, - cause_abort_after - ]. %%%%%%%%%%%%%%%%%% @@ -1432,14 +1340,6 @@ cause_abort_after(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -schema_transactions_during_backup(doc) -> - ["Verify that an schema transactions does not", - "affect an ongoing backup."]; -schema_transactions_during_backup(suite) -> - [ - change_schema_before, - change_schema_after - ]. %%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl index 7456f63fcb..16eef3a111 100644 --- a/lib/mnesia/test/mnesia_dirty_access_test.erl +++ b/lib/mnesia/test/mnesia_dirty_access_test.erl @@ -30,33 +30,68 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Evil dirty access, regardless of transaction scope.", - "Invoke all functions in the API and try to cover all legal uses", - "cases as well the illegal dito. This is a complement to the", - "other more explicit test cases."]; -all(suite) -> - [ - dirty_write, - dirty_read, - dirty_update_counter, - dirty_delete, - dirty_delete_object, - dirty_match_object, - dirty_index, - dirty_iter, - admin_tests - ]. +all() -> +[{group, dirty_write}, {group, dirty_read}, + {group, dirty_update_counter}, {group, dirty_delete}, + {group, dirty_delete_object}, + {group, dirty_match_object}, {group, dirty_index}, + {group, dirty_iter}, {group, admin_tests}]. + +groups() -> + [{dirty_write, [], + [dirty_write_ram, dirty_write_disc, + dirty_write_disc_only]}, + {dirty_read, [], + [dirty_read_ram, dirty_read_disc, + dirty_read_disc_only]}, + {dirty_update_counter, [], + [dirty_update_counter_ram, dirty_update_counter_disc, + dirty_update_counter_disc_only]}, + {dirty_delete, [], + [dirty_delete_ram, dirty_delete_disc, + dirty_delete_disc_only]}, + {dirty_delete_object, [], + [dirty_delete_object_ram, dirty_delete_object_disc, + dirty_delete_object_disc_only]}, + {dirty_match_object, [], + [dirty_match_object_ram, dirty_match_object_disc, + dirty_match_object_disc_only]}, + {dirty_index, [], + [{group, dirty_index_match_object}, + {group, dirty_index_read}, + {group, dirty_index_update}]}, + {dirty_index_match_object, [], + [dirty_index_match_object_ram, + dirty_index_match_object_disc, + dirty_index_match_object_disc_only]}, + {dirty_index_read, [], + [dirty_index_read_ram, dirty_index_read_disc, + dirty_index_read_disc_only]}, + {dirty_index_update, [], + [dirty_index_update_set_ram, + dirty_index_update_set_disc, + dirty_index_update_set_disc_only, + dirty_index_update_bag_ram, dirty_index_update_bag_disc, + dirty_index_update_bag_disc_only]}, + {dirty_iter, [], + [dirty_iter_ram, dirty_iter_disc, + dirty_iter_disc_only]}, + {admin_tests, [], + [del_table_copy_1, del_table_copy_2, del_table_copy_3, + add_table_copy_1, add_table_copy_2, add_table_copy_3, + add_table_copy_4, move_table_copy_1, move_table_copy_2, + move_table_copy_3, move_table_copy_4]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Write records dirty -dirty_write(suite) -> - [ - dirty_write_ram, - dirty_write_disc, - dirty_write_disc_only - ]. dirty_write_ram(suite) -> []; dirty_write_ram(Config) when is_list(Config) -> @@ -88,12 +123,6 @@ dirty_write(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Read records dirty -dirty_read(suite) -> - [ - dirty_read_ram, - dirty_read_disc, - dirty_read_disc_only - ]. dirty_read_ram(suite) -> []; dirty_read_ram(Config) when is_list(Config) -> @@ -137,12 +166,6 @@ dirty_read(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Update counter record dirty -dirty_update_counter(suite) -> - [ - dirty_update_counter_ram, - dirty_update_counter_disc, - dirty_update_counter_disc_only - ]. dirty_update_counter_ram(suite) -> []; dirty_update_counter_ram(Config) when is_list(Config) -> @@ -180,12 +203,6 @@ dirty_update_counter(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Delete record dirty -dirty_delete(suite) -> - [ - dirty_delete_ram, - dirty_delete_disc, - dirty_delete_disc_only - ]. dirty_delete_ram(suite) -> []; dirty_delete_ram(Config) when is_list(Config) -> @@ -223,12 +240,6 @@ dirty_delete(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Delete matching record dirty -dirty_delete_object(suite) -> - [ - dirty_delete_object_ram, - dirty_delete_object_disc, - dirty_delete_object_disc_only - ]. dirty_delete_object_ram(suite) -> []; dirty_delete_object_ram(Config) when is_list(Config) -> @@ -272,12 +283,6 @@ dirty_delete_object(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Read matching records dirty -dirty_match_object(suite) -> - [ - dirty_match_object_ram, - dirty_match_object_disc, - dirty_match_object_disc_only - ]. dirty_match_object_ram(suite) -> []; dirty_match_object_ram(Config) when is_list(Config) -> @@ -311,22 +316,10 @@ dirty_match_object(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirty_index(suite) -> - [ - dirty_index_match_object, - dirty_index_read, - dirty_index_update - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Dirty read matching records by using an index -dirty_index_match_object(suite) -> - [ - dirty_index_match_object_ram, - dirty_index_match_object_disc, - dirty_index_match_object_disc_only - ]. dirty_index_match_object_ram(suite) -> []; dirty_index_match_object_ram(Config) when is_list(Config) -> @@ -364,12 +357,6 @@ dirty_index_match_object(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Read records by using an index -dirty_index_read(suite) -> - [ - dirty_index_read_ram, - dirty_index_read_disc, - dirty_index_read_disc_only - ]. dirty_index_read_ram(suite) -> []; dirty_index_read_ram(Config) when is_list(Config) -> @@ -413,19 +400,6 @@ dirty_index_read(Config, Storage) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -dirty_index_update(suite) -> - [ - dirty_index_update_set_ram, - dirty_index_update_set_disc, - dirty_index_update_set_disc_only, - dirty_index_update_bag_ram, - dirty_index_update_bag_disc, - dirty_index_update_bag_disc_only - ]; -dirty_index_update(doc) -> - ["See Ticket OTP-2083, verifies that a table with a index is " - "update in the correct way i.e. the index finds the correct " - "records after a update"]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dirty_index_update_set_ram(suite) -> []; @@ -631,12 +605,6 @@ dirty_index_update_bag(Config, Storage) -> %% Dirty iteration %% dirty_slot, dirty_first, dirty_next -dirty_iter(suite) -> - [ - dirty_iter_ram, - dirty_iter_disc, - dirty_iter_disc_only - ]. dirty_iter_ram(suite) -> []; dirty_iter_ram(Config) when is_list(Config) -> @@ -700,21 +668,6 @@ all_nexts(Tab, PrevKey) -> [PrevKey] ++ all_nexts(Tab, Key). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -admin_tests(doc) -> - ["Verifies that dirty operations work during schema operations"]; - -admin_tests(suite) -> - [del_table_copy_1, - del_table_copy_2, - del_table_copy_3, - add_table_copy_1, - add_table_copy_2, - add_table_copy_3, - add_table_copy_4, - move_table_copy_1, - move_table_copy_2, - move_table_copy_3, - move_table_copy_4]. update_trans(Tab, Key, Acc) -> Update = diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl index f94482cf31..d5b0b978e9 100644 --- a/lib/mnesia/test/mnesia_durability_test.erl +++ b/lib/mnesia/test/mnesia_durability_test.erl @@ -35,40 +35,47 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify durability", - "Verify that the effects of committed transactions are durable.", - "The content of the tables tables must be restored at startup."]; -all(suite) -> - [ - load_tables, - durability_of_dump_tables, - durability_of_disc_copies, - durability_of_disc_only_copies - ]. +all() -> +[{group, load_tables}, + {group, durability_of_dump_tables}, + durability_of_disc_copies, + durability_of_disc_only_copies]. + +groups() -> + [{load_tables, [], + [load_latest_data, load_local_contents_directly, + load_directly_when_all_are_ram_copiesA, + load_directly_when_all_are_ram_copiesB, + {group, late_load_when_all_are_ram_copies_on_ram_nodes}, + load_when_last_replica_becomes_available, + load_when_we_have_down_from_all_other_replica_nodes, + late_load_transforms_into_disc_load, + late_load_leads_to_hanging, + force_load_when_nobody_intents_to_load, + force_load_when_someone_has_decided_to_load, + force_load_when_someone_else_already_has_loaded, + force_load_when_we_has_loaded, + force_load_on_a_non_local_table, + force_load_when_the_table_does_not_exist, + {group, load_tables_with_master_tables}]}, + {late_load_when_all_are_ram_copies_on_ram_nodes, [], + [late_load_when_all_are_ram_copies_on_ram_nodes1, + late_load_when_all_are_ram_copies_on_ram_nodes2]}, + {load_tables_with_master_tables, [], + [master_nodes, starting_master_nodes, + master_on_non_local_tables, + remote_force_load_with_local_master_node]}, + {durability_of_dump_tables, [], + [dump_ram_copies, dump_disc_copies, dump_disc_only]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -load_tables(doc) -> - ["Try to provoke all kinds of table load scenarios."]; -load_tables(suite) -> - [ - load_latest_data, - load_local_contents_directly, - load_directly_when_all_are_ram_copiesA, - load_directly_when_all_are_ram_copiesB, - late_load_when_all_are_ram_copies_on_ram_nodes, - load_when_last_replica_becomes_available, - load_when_we_have_down_from_all_other_replica_nodes, - late_load_transforms_into_disc_load, - late_load_leads_to_hanging, - force_load_when_nobody_intents_to_load, - force_load_when_someone_has_decided_to_load, - force_load_when_someone_else_already_has_loaded, - force_load_when_we_has_loaded, - force_load_on_a_non_local_table, - force_load_when_the_table_does_not_exist, - load_tables_with_master_tables - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% load_latest_data(doc) -> @@ -284,13 +291,6 @@ load_directly_when_all_are_ram_copiesB(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -late_load_when_all_are_ram_copies_on_ram_nodes(doc) -> - ["Load of ram_copies tables when all replicas resides on disc less nodes"]; -late_load_when_all_are_ram_copies_on_ram_nodes(suite) -> - [ - late_load_when_all_are_ram_copies_on_ram_nodes1, - late_load_when_all_are_ram_copies_on_ram_nodes2 - ]. late_load_when_all_are_ram_copies_on_ram_nodes1(suite) -> []; late_load_when_all_are_ram_copies_on_ram_nodes1(Config) when is_list(Config) -> @@ -916,22 +916,6 @@ force_load_when_the_table_does_not_exist(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -load_tables_with_master_tables(doc) -> - ["Verifies the semantics of different master nodes settings", - "The semantics should be:", - "1. Mnesia downs, Normally decides from where mnesia should load tables", - "2. Master tables (overrides mnesia downs) ", - "3. Force load (overrides Master tables) ", - "--- 1st from active master nodes", - "--- 2nd from active nodes", - "--- 3rd get local copy (if ram create new one)" - ]; - -load_tables_with_master_tables(suite) -> - [master_nodes, - starting_master_nodes, - master_on_non_local_tables, - remote_force_load_with_local_master_node]. -define(SDwrite(Tup), fun() -> mnesia:write(Tup) end). @@ -1156,13 +1140,6 @@ remote_force_load_with_local_master_node(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -durability_of_dump_tables(doc) -> - [ "Verify that all tables contain the correct data when Mnesia", - "is restarted and tables are loaded from disc to recover", - " their previous contents. " ]; -durability_of_dump_tables(suite) -> [dump_ram_copies, - dump_disc_copies, - dump_disc_only]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/mnesia/test/mnesia_evil_backup.erl b/lib/mnesia/test/mnesia_evil_backup.erl index a075974f53..fadeca9660 100644 --- a/lib/mnesia/test/mnesia_evil_backup.erl +++ b/lib/mnesia/test/mnesia_evil_backup.erl @@ -40,26 +40,25 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Checking all the functionality regarding ", - "to the backup and different ", - "kinds of restore and fallback interface"]; - -all(suite) -> - [ - backup, - bad_backup, - global_backup_checkpoint, - restore_tables, - traverse_backup, - selective_backup_checkpoint, - incremental_backup_checkpoint, -%% local_backup_checkpoint, - install_fallback, - uninstall_fallback, - local_fallback, - sops_with_checkpoint - ]. +all() -> +[backup, bad_backup, global_backup_checkpoint, + {group, restore_tables}, traverse_backup, + selective_backup_checkpoint, + incremental_backup_checkpoint, install_fallback, + uninstall_fallback, local_fallback, + sops_with_checkpoint]. + +groups() -> + [{restore_tables, [], + [restore_errors, restore_clear, restore_keep, + restore_recreate, restore_clear_ram]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + backup(doc) -> ["Checking the interface to the function backup", "We don't check that the backups can be used here", @@ -132,17 +131,6 @@ global_backup_checkpoint(Config) when is_list(Config) -> ?match(ok, file:delete(File2)), ?verify_mnesia(Nodes, []). -restore_tables(doc) -> - ["Tests the interface of restore"]; - -restore_tables(suite) -> - [ - restore_errors, - restore_clear, - restore_keep, - restore_recreate, - restore_clear_ram - ]. restore_errors(suite) -> []; restore_errors(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 28537fc68a..52322dc2a3 100644 --- a/lib/mnesia/test/mnesia_evil_coverage_test.erl +++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl @@ -34,41 +34,50 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Evil usage of the API.", - "Invoke all functions in the API and try to cover all legal uses", - "cases as well the illegal dito. This is a complement to the", - "other more explicit test cases."]; -all(suite) -> - [ - system_info, - table_info, - error_description, - db_node_lifecycle, - evil_delete_db_node, - start_and_stop, - checkpoint, - table_lifecycle, - add_copy_conflict, - add_copy_when_going_down, - replica_management, - schema_availability, - local_content, - table_access_modifications, - replica_location, - table_sync, - user_properties, - unsupp_user_props, - record_name, - snmp_access, - subscriptions, - iteration, - debug_support, - sorted_ets, - {mnesia_dirty_access_test, all}, - {mnesia_trans_access_test, all}, - {mnesia_evil_backup, all} - ]. +all() -> +[system_info, table_info, error_description, + db_node_lifecycle, evil_delete_db_node, start_and_stop, + checkpoint, table_lifecycle, add_copy_conflict, + add_copy_when_going_down, replica_management, + schema_availability, local_content, + {group, table_access_modifications}, replica_location, + {group, table_sync}, user_properties, unsupp_user_props, + {group, record_name}, {group, snmp_access}, + {group, subscriptions}, {group, iteration}, + {group, debug_support}, sorted_ets, + {mnesia_dirty_access_test, all}, + {mnesia_trans_access_test, all}, + {mnesia_evil_backup, all}]. + +groups() -> + [{table_access_modifications, [], + [change_table_access_mode, change_table_load_order, + set_master_nodes, offline_set_master_nodes]}, + {table_sync, [], + [dump_tables, dump_log, wait_for_tables, + force_load_table]}, + {snmp_access, [], + [snmp_open_table, snmp_close_table, snmp_get_next_index, + snmp_get_row, snmp_get_mnesia_key, snmp_update_counter, + snmp_order]}, + {subscriptions, [], + [subscribe_standard, subscribe_extended]}, + {iteration, [], [foldl]}, + {debug_support, [], + [info, schema_0, schema_1, view_0, view_1, view_2, + lkill, kill]}, + {record_name, [], [{group, record_name_dirty_access}]}, + {record_name_dirty_access, [], + [record_name_dirty_access_ram, + record_name_dirty_access_disc, + record_name_dirty_access_disc_only]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -910,13 +919,6 @@ local_content(Config) when is_list(Config) -> ?verify_mnesia(Nodes, []). -table_access_modifications(suite) -> - [ - change_table_access_mode, - change_table_load_order, - set_master_nodes, - offline_set_master_nodes - ]. change_table_access_mode(suite) -> []; change_table_access_mode(Config) when is_list(Config) -> @@ -1103,13 +1105,6 @@ offline_set_master_nodes(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Syncronize table with log or disc %% -table_sync(suite) -> - [ - dump_tables, - dump_log, - wait_for_tables, - force_load_table - ]. %% Dump ram tables on disc dump_tables(suite) -> []; @@ -1359,19 +1354,6 @@ unsupp_user_props(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -snmp_access(doc) -> - ["Make Mnesia table accessible via SNMP"]; - -snmp_access(suite) -> - [ - snmp_open_table, - snmp_close_table, - snmp_get_next_index, - snmp_get_row, - snmp_get_mnesia_key, - snmp_update_counter, - snmp_order - ]. snmp_open_table(suite) -> []; snmp_open_table(Config) when is_list(Config) -> @@ -1779,11 +1761,6 @@ get_keys(Tab, Key) -> -record(tab, {i, e1, e2}). % Simple test table -subscriptions(doc) -> - ["Test the event subscription mechanism"]; -subscriptions(suite) -> - [subscribe_standard, - subscribe_extended]. subscribe_extended(doc) -> ["Test the extended set of events, test with and without checkpoints. "]; @@ -2009,10 +1986,6 @@ recv_event() -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -iteration(doc) -> - ["Verify that the iteration functions works as expected"]; -iteration(suite) -> - [foldl]. foldl(suite) -> @@ -2074,19 +2047,6 @@ sort_res(Else) -> Else. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -debug_support(doc) -> - ["Check that the debug support has not decayed."]; -debug_support(suite) -> - [ - info, - schema_0, - schema_1, - view_0, - view_1, - view_2, - lkill, - kill - ]. info(suite) -> []; info(Config) when is_list(Config) -> @@ -2173,21 +2133,7 @@ kill(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -record_name(doc) -> - ["Verify that record names may be differ from the name of ", - "the hosting table. Check at least access, restore, " - "registry, subscriptions and traveres_backup"]; -record_name(suite) -> - [ - record_name_dirty_access - ]. - -record_name_dirty_access(suite) -> - [ - record_name_dirty_access_ram, - record_name_dirty_access_disc, - record_name_dirty_access_disc_only - ]. + record_name_dirty_access_ram(suite) -> []; diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl index 96994b9f22..451f7e8e10 100644 --- a/lib/mnesia/test/mnesia_examples_test.erl +++ b/lib/mnesia/test/mnesia_examples_test.erl @@ -61,16 +61,21 @@ opt_load(Mod) -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Run all examples mentioned in the documentation", - "Are really all examples covered?"]; -all(suite) -> - [ - bup, - company, - meter, - tpcb - ]. +all() -> +[bup, company, meter, {group, tpcb}]. + +groups() -> + [{tpcb, [], + [replica_test, sticky_replica_test, dist_test, + conflict_test, frag_test, frag2_test, remote_test, + remote_frag2_test]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bup(doc) -> ["Run the backup examples in bup.erl"]; @@ -85,19 +90,6 @@ company(doc) -> ["Run the company examples in company.erl and company_o.erl"]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -tpcb(doc) -> - ["Run the sample configurations of the stress tests in mnesia_tpcb.erl"]; -tpcb(suite) -> - [ - replica_test, - sticky_replica_test, - dist_test, - conflict_test, - frag_test, - frag2_test, - remote_test, - remote_frag2_test - ]. replica_test(suite) -> []; replica_test(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl index 0008b69ad0..fa9dd17c76 100644 --- a/lib/mnesia/test/mnesia_frag_test.erl +++ b/lib/mnesia/test/mnesia_frag_test.erl @@ -37,34 +37,29 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify the functionality of fragmented tables"]; -all(suite) -> - [ - light, - medium - ]. - -light(suite) -> - [ - nice, - evil - ]. - -medium(suite) -> - [ - consistency - ]. +all() -> +[{group, light}, {group, medium}]. + +groups() -> + [{light, [], [{group, nice}, {group, evil}]}, + {medium, [], [consistency]}, + {nice, [], + [nice_single, nice_multi, nice_access, iter_access]}, + {evil, [], + [evil_create, evil_delete, evil_change, evil_combine, + evil_loop, evil_delete_db_node]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -nice(suite) -> - [ - nice_single, - nice_multi, - nice_access, - iter_access - ]. nice_single(suite) -> []; nice_single(Config) when is_list(Config) -> @@ -503,17 +498,6 @@ consistency(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -evil(doc) -> - ["Evil coverage of fragmentation API."]; -evil(suite) -> - [ - evil_create, - evil_delete, - evil_change, - evil_combine, - evil_loop, - evil_delete_db_node - ]. evil_create(suite) -> []; evil_create(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl index c9ba2dca23..9c4095262f 100644 --- a/lib/mnesia/test/mnesia_install_test.erl +++ b/lib/mnesia/test/mnesia_install_test.erl @@ -31,25 +31,18 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Run some small but demanding test cases in order to verify", - "that the basic functionality in Mnesia still works.", - "", - "Try some very simple things to begin with and increase the", - "difficulty stepwise. This test suite should be run before", - "all the others if you expect to find bugs.", - "", - "The function mnesia_install_test:silly() does not use the whole", - "infra structure of the test suite. Invoke it on a single node to", - "begin with. If that works, proceed with pong = net_adm:ping(SomeOtherNode)", - "and rerun silly() in order to perform some distributed tests."]; -all(suite) -> - [ - silly_durability, - silly_move, - silly_upgrade - %,stress - ]. +all() -> +[silly_durability, silly_move, silly_upgrade]. + +groups() -> + [{stress, [], stress_cases()}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Stepwise of more and more advanced features @@ -286,16 +279,9 @@ transform_some_records(Tab1, _Tab2, Old) -> lists:sort(lists:zf(Filter, Old)). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -stress(doc) -> - ["Stress the system a little"]; -stress(suite) -> - stress_cases(). - -stress_cases() -> - [ - conflict, - dist - ]. + +stress_cases() -> +[conflict, dist]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dist(doc) -> diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl index 2a638190c6..b3c96aed03 100644 --- a/lib/mnesia/test/mnesia_isolation_test.erl +++ b/lib/mnesia/test/mnesia_isolation_test.erl @@ -31,42 +31,49 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify the isolation property.", - "Operations of concurrent transactions must yield results which", - "are indistinguishable from the results which would be obtained by", - "forcing each transaction to be serially executed to completion in", - "some order. This means that repeated reads of the same records", - "within any committed transaction must have returned identical", - "data when run concurrently with any mix of arbitary transactions.", - "Updates in one transaction must not be visible in any other", - "transaction before the transaction has been committed."]; -all(suite) -> - [ - locking, - visibility - ]. +all() -> +[{group, locking}, {group, visibility}]. + +groups() -> + [{locking, [], + [no_conflict, simple_queue_conflict, + advanced_queue_conflict, simple_deadlock_conflict, + advanced_deadlock_conflict, lock_burst, + {group, sticky_locks}, {group, unbound_locking}, + {group, admin_conflict}, nasty]}, + {sticky_locks, [], [basic_sticky_functionality]}, + {unbound_locking, [], [unbound1, unbound2]}, + {admin_conflict, [], + [create_table, delete_table, move_table_copy, + add_table_index, del_table_index, transform_table, + snmp_open_table, snmp_close_table, + change_table_copy_type, change_table_access, + add_table_copy, del_table_copy, dump_tables, + {group, extra_admin_tests}]}, + {extra_admin_tests, [], + [del_table_copy_1, del_table_copy_2, del_table_copy_3, + add_table_copy_1, add_table_copy_2, add_table_copy_3, + add_table_copy_4, move_table_copy_1, move_table_copy_2, + move_table_copy_3, move_table_copy_4]}, + {visibility, [], + [dirty_updates_visible_direct, + dirty_reads_regardless_of_trans, + trans_update_invisibible_outside_trans, + trans_update_visible_inside_trans, write_shadows, + delete_shadows, write_delete_shadows_bag, + write_delete_shadows_bag2, {group, iteration}, + shadow_search, snmp_shadows]}, + {removed_resources, [], [rr_kill_copy]}, + {iteration, [], [foldl, first_next]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -locking(doc) -> - ["Verify locking semantics for various configurations", - " NoLock = lock_funs(no_lock, any_granularity)", - " SharedLock = lock_funs(shared_lock, any_granularity)", - " ExclusiveLock = lock_funs(exclusive_lock, any_granularity)", - " AnyLock = lock_funs(any_lock, any_granularity)"]; -locking(suite) -> - [no_conflict, - simple_queue_conflict, - advanced_queue_conflict, - simple_deadlock_conflict, - advanced_deadlock_conflict, - lock_burst, - sticky_locks, - unbound_locking, - admin_conflict, -%% removed_resources, - nasty - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -431,14 +438,6 @@ burst_incr(Tab, Father) -> Father ! burst_incr_done. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -sticky_locks(doc) -> - ["Simple Tests of sticky locks"]; - -sticky_locks(suite) -> - [ - basic_sticky_functionality - %% Needs to be expandand a little bit further - ]. basic_sticky_functionality(suite) -> []; basic_sticky_functionality(Config) when is_list(Config) -> @@ -519,12 +518,6 @@ get_held() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -unbound_locking(suite) -> - [unbound1, unbound2]; - -unbound_locking(doc) -> - ["Check that mnesia handles unbound key variables, GPRS bug." - "Ticket id: OTP-3342"]. unbound1(suite) -> []; unbound1(Config) when is_list(Config) -> @@ -637,25 +630,6 @@ receiver() -> end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -admin_conflict(doc) -> - ["Provoke lock conflicts with schema transactions and checkpoints."]; -admin_conflict(suite) -> - [ - create_table, - delete_table, - move_table_copy, - add_table_index, - del_table_index, - transform_table, - snmp_open_table, - snmp_close_table, - change_table_copy_type, - change_table_access, - add_table_copy, - del_table_copy, - dump_tables, - extra_admin_tests - ]. create_table(suite) -> []; create_table(Config) when is_list(Config) -> @@ -1088,18 +1062,6 @@ insert(Tab, N) when N > 0 -> ok = mnesia:sync_dirty(fun() -> mnesia:write({Tab, N, N, 0}) end), insert(Tab, N-1). -extra_admin_tests(suite) -> - [del_table_copy_1, - del_table_copy_2, - del_table_copy_3, - add_table_copy_1, - add_table_copy_2, - add_table_copy_3, - add_table_copy_4, - move_table_copy_1, - move_table_copy_2, - move_table_copy_3, - move_table_copy_4]. update_own(Tab, Key, Acc) -> Update = @@ -1347,23 +1309,6 @@ move_table(CallFrom, FromNode, ToNode, [Node1, Node2, Node3], Def) -> ?verify_mnesia([Node1, Node2, Node3], []). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -visibility(doc) -> - ["Verify the visibility semantics for various configurations"]; -visibility(suite) -> - [ - dirty_updates_visible_direct, - dirty_reads_regardless_of_trans, - trans_update_invisibible_outside_trans, - trans_update_visible_inside_trans, - write_shadows, - delete_shadows, -%% delete_shadows2, - write_delete_shadows_bag, - write_delete_shadows_bag2, - iteration, - shadow_search, - snmp_shadows - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dirty_updates_visible_direct(doc) -> @@ -1969,10 +1914,6 @@ shadow_search(Config) when is_list(Config) -> ?verify_mnesia([Node1], []). -removed_resources(suite) -> - [rr_kill_copy]; -removed_resources(doc) -> - ["Verify that the locking behave when resources are removed"]. rr_kill_copy(suite) -> []; rr_kill_copy(Config) when is_list(Config) -> @@ -2138,11 +2079,6 @@ get_exit(Pid) -> ?error("Timeout EXIT ~p~n", [Pid]) end. -iteration(doc) -> - ["Verify that the updates before/during iteration are visable " - "and that the order is preserved for ordered_set tables"]; -iteration(suite) -> - [foldl,first_next]. foldl(doc) -> [""]; diff --git a/lib/mnesia/test/mnesia_measure_test.erl b/lib/mnesia/test/mnesia_measure_test.erl index 2bd8420aba..e9be99411c 100644 --- a/lib/mnesia/test/mnesia_measure_test.erl +++ b/lib/mnesia/test/mnesia_measure_test.erl @@ -37,101 +37,62 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Measure various aspects of Mnesia", - "Verify that Mnesia has predictable response times,", - "that the transaction system has fair algoritms,", - "resource consumption, scalabilitym system limits etc.", - "Perform some benchmarks."]; -all(suite) -> - [ - prediction, - consumption, - scalability, - benchmarks - ]. +all() -> +[{group, prediction}, {group, consumption}, + {group, scalability}, {group, benchmarks}]. + +groups() -> + [{prediction, [], + [reader_disturbed_by_node_down, + writer_disturbed_by_node_down, + reader_disturbed_by_node_up, + writer_disturbed_by_node_up, + reader_disturbed_by_schema_ops, + writer_disturbed_by_schema_ops, + reader_disturbed_by_checkpoint, + writer_disturbed_by_checkpoint, + reader_disturbed_by_dump_log, + writer_disturbed_by_dump_log, + reader_disturbed_by_backup, writer_disturbed_by_backup, + reader_disturbed_by_restore, + writer_disturbed_by_restore, {group, fairness}]}, + {fairness, [], + [reader_competing_with_reader, + reader_competing_with_writer, + writer_competing_with_reader, + writer_competing_with_writer]}, + {consumption, [], + [measure_resource_consumption, + determine_resource_leakage]}, + {scalability, [], + [determine_system_limits, performance_at_min_config, + performance_at_max_config, performance_at_full_load, + resource_consumption_at_min_config, + resource_consumption_at_max_config, + resource_consumption_at_full_load]}, + {benchmarks, [], + [{group, meter}, cost, dbn_meters, + measure_all_api_functions, {group, tpcb}, + mnemosyne_vs_mnesia_kernel]}, + {tpcb, [], [ram_tpcb, disc_tpcb, disc_only_tpcb]}, + {meter, [], [ram_meter, disc_meter, disc_only_meter]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -prediction(doc) -> - ["The system must have predictable response times.", - "The maintenance of the system should not impact on the", - "availability. Make sure that the response times does not vary too", - "much from the undisturbed normal usage.", - "Verify that deadlocks never occurs."]; -prediction(suite) -> - [ - reader_disturbed_by_node_down, - writer_disturbed_by_node_down, - reader_disturbed_by_node_up, - writer_disturbed_by_node_up, - reader_disturbed_by_schema_ops, - writer_disturbed_by_schema_ops, - reader_disturbed_by_checkpoint, - writer_disturbed_by_checkpoint, - reader_disturbed_by_dump_log, - writer_disturbed_by_dump_log, - reader_disturbed_by_backup, - writer_disturbed_by_backup, - reader_disturbed_by_restore, - writer_disturbed_by_restore, - fairness - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -fairness(doc) -> - ["Verify that the transaction system behaves fair, even under intense", - "stress. Combine different access patterns (transaction profiles)", - "in order to verify that concurrent applications gets a fair share", - "of the database resource. Verify that starvation never may occur."]; -fairness(suite) -> - [ - reader_competing_with_reader, - reader_competing_with_writer, - writer_competing_with_reader, - writer_competing_with_writer - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -consumption(doc) -> - ["Measure the resource consumption and publish the outcome. Make", - "sure that resources are released after failures."]; -consumption(suite) -> - [ - measure_resource_consumption, - determine_resource_leakage - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -scalability(doc) -> - ["Try out where the system limits are. We must at least meet the", - "documented system limits.", - "Redo the performance meters for various configurations and load,", - "especially near system limits."]; -scalability(suite) -> - [ - determine_system_limits, - performance_at_min_config, - performance_at_max_config, - performance_at_full_load, - resource_consumption_at_min_config, - resource_consumption_at_max_config, - resource_consumption_at_full_load - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -benchmarks(doc) -> - ["Measure typical database operations and publish them. Try to", - "verify that new releases of Mnesia always outperforms old", - "releases, or at least that the meters does not get worse."]; -benchmarks(suite) -> - [ - meter, - cost, - dbn_meters, - measure_all_api_functions, - tpcb, - mnemosyne_vs_mnesia_kernel - ]. dbn_meters(suite) -> []; dbn_meters(Config) when is_list(Config) -> @@ -139,12 +100,6 @@ dbn_meters(Config) when is_list(Config) -> ?match(ok, mnesia_dbn_meters:start()), ok. -tpcb(suite) -> - [ - ram_tpcb, - disc_tpcb, - disc_only_tpcb - ]. tpcb(ReplicaType, Config) -> HarakiriDelay = {tc_timeout, timer:minutes(20)}, @@ -171,12 +126,6 @@ disc_only_tpcb(suite) -> []; disc_only_tpcb(Config) when is_list(Config) -> tpcb(disc_only_copies, Config). -meter(suite) -> - [ - ram_meter, - disc_meter, - disc_only_meter - ]. ram_meter(suite) -> []; ram_meter(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_nice_coverage_test.erl b/lib/mnesia/test/mnesia_nice_coverage_test.erl index 0d81a4546f..7835c44d6a 100644 --- a/lib/mnesia/test/mnesia_nice_coverage_test.erl +++ b/lib/mnesia/test/mnesia_nice_coverage_test.erl @@ -32,12 +32,18 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Test nice usage of the entire API", - "Invoke all functions in the API, at least once.", - "Try to verify that all functions exists and that they perform", - "reasonable things when used in the most simple way."]; -all(suite) -> [nice]. +all() -> +[nice]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + nice(doc) -> [""]; nice(suite) -> []; diff --git a/lib/mnesia/test/mnesia_qlc_test.erl b/lib/mnesia/test/mnesia_qlc_test.erl index 4d164cf1e6..288bd3c2db 100644 --- a/lib/mnesia/test/mnesia_qlc_test.erl +++ b/lib/mnesia/test/mnesia_qlc_test.erl @@ -22,7 +22,7 @@ -compile(export_all). --export([all/1]). +-export([all/0,groups/0,init_per_group/2,end_per_group/2]). -include("mnesia_test_lib.hrl"). -include_lib("stdlib/include/qlc.hrl"). @@ -34,17 +34,31 @@ init_per_testcase(Func, Conf) -> end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). -all(doc) -> - ["Test that the qlc mnesia interface works as expected."]; -all(suite) -> - case code:which(qlc) of - non_existing -> []; - _ -> - all_qlc() - end. +all() -> +case code:which(qlc) of + non_existing -> []; + _ -> all_qlc() +end. + +groups() -> + [{dirty, [], + [dirty_nice_ram_copies, dirty_nice_disc_copies, + dirty_nice_disc_only_copies]}, + {trans, [], + [trans_nice_ram_copies, trans_nice_disc_copies, + trans_nice_disc_only_copies, {group, atomic}]}, + {atomic, [], [atomic_eval]}]. + +init_per_group(_GroupName, Config) -> + Config. -all_qlc() -> - [dirty, trans, frag, info, mnesia_down]. +end_per_group(_GroupName, Config) -> + Config. + + +all_qlc() -> +[{group, dirty}, {group, trans}, frag, info, + mnesia_down]. init_testcases(Type,Config) -> Nodes = [N1,N2] = ?acquire_nodes(2, Config), @@ -59,10 +73,6 @@ init_testcases(Type,Config) -> Nodes. %% Test cases -dirty(suite) -> - [dirty_nice_ram_copies, - dirty_nice_disc_copies, - dirty_nice_disc_only_copies]. dirty_nice_ram_copies(Setup) -> dirty_nice(Setup,ram_copies). dirty_nice_disc_copies(Setup) -> dirty_nice(Setup,disc_copies). @@ -109,12 +119,6 @@ dirty_nice(Config, Type) when is_list(Config) -> end, ?verify_mnesia(Ns, []). -trans(suite) -> - [trans_nice_ram_copies, - trans_nice_disc_copies, - trans_nice_disc_only_copies, - atomic - ]. trans_nice_ram_copies(Setup) -> trans_nice(Setup,ram_copies). trans_nice_disc_copies(Setup) -> trans_nice(Setup,disc_copies). @@ -182,9 +186,7 @@ recs() -> "-record(b, {k,v}). " "-record(k, {t,v}). " >>. - -atomic(suite) -> [atomic_eval]; -atomic(doc) -> []. + atomic_eval(suite) -> []; atomic_eval(doc) -> []; diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl index 7b16d0d7dc..4cb6c38186 100644 --- a/lib/mnesia/test/mnesia_recovery_test.erl +++ b/lib/mnesia/test/mnesia_recovery_test.erl @@ -42,34 +42,95 @@ end_per_testcase(Func, Conf) -> -endif. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify recoverability", - "Verify that the effects of committed transactions are preserved", - "after recovery from system failures. It must be possible to", - "restore the tables to a consistent state on a node, from (any kind", - "of) replica on other nodes as well as from local disk on the failed", - "node. The system must also recover from instantaneous", - "interruption causing disk files to not be completely synchronized."]; - -all(suite) -> - [ - mnesia_down, - explicit_stop, - coord_dies, - schema_trans, - async_dirty, - sync_dirty, - sym_trans, - asym_trans, - after_full_disc_partition, - after_corrupt_files, - disc_less, - garb_decision, - system_upgrade - ]. - -schema_trans(suite) -> - [{mnesia_schema_recovery_test, all}]. +all() -> +[{group, mnesia_down}, {group, explicit_stop}, + coord_dies, {group, schema_trans}, {group, async_dirty}, + {group, sync_dirty}, {group, sym_trans}, + {group, asym_trans}, after_full_disc_partition, + {group, after_corrupt_files}, disc_less, garb_decision, + system_upgrade]. + +groups() -> + [{schema_trans, [], + [{mnesia_schema_recovery_test, all}]}, + {mnesia_down, [], + [{group, mnesia_down_during_startup}, + {group, master_node_tests}, {group, read_during_down}, + {group, with_checkpoint}, delete_during_start]}, + {master_node_tests, [], + [no_master_2, no_master_3, one_master_2, one_master_3, + two_master_2, two_master_3, all_master_2, + all_master_3]}, + {read_during_down, [], + [dirty_read_during_down, trans_read_during_down]}, + {mnesia_down_during_startup, [], + [mnesia_down_during_startup_disk_ram, + mnesia_down_during_startup_init_ram, + mnesia_down_during_startup_init_disc, + mnesia_down_during_startup_init_disc_only, + mnesia_down_during_startup_tm_ram, + mnesia_down_during_startup_tm_disc, + mnesia_down_during_startup_tm_disc_only]}, + {with_checkpoint, [], + [with_checkpoint_same, with_checkpoint_other]}, + {explicit_stop, [], [explicit_stop_during_snmp]}, + {sym_trans, [], + [sym_trans_before_commit_kill_coord_node, + sym_trans_before_commit_kill_coord_pid, + sym_trans_before_commit_kill_part_after_ask, + sym_trans_before_commit_kill_part_before_ask, + sym_trans_after_commit_kill_coord_node, + sym_trans_after_commit_kill_coord_pid, + sym_trans_after_commit_kill_part_after_ask, + sym_trans_after_commit_kill_part_do_commit_pre, + sym_trans_after_commit_kill_part_do_commit_post]}, + {sync_dirty, [], + [sync_dirty_pre_kill_part, + sync_dirty_pre_kill_coord_node, + sync_dirty_pre_kill_coord_pid, + sync_dirty_post_kill_part, + sync_dirty_post_kill_coord_node, + sync_dirty_post_kill_coord_pid]}, + {async_dirty, [], + [async_dirty_pre_kill_part, + async_dirty_pre_kill_coord_node, + async_dirty_pre_kill_coord_pid, + async_dirty_post_kill_part, + async_dirty_post_kill_coord_node, + async_dirty_post_kill_coord_pid]}, + {asym_trans, [], + [asym_trans_kill_part_ask, + asym_trans_kill_part_commit_vote, + asym_trans_kill_part_pre_commit, + asym_trans_kill_part_log_commit, + asym_trans_kill_part_do_commit, + asym_trans_kill_coord_got_votes, + asym_trans_kill_coord_pid_got_votes, + asym_trans_kill_coord_log_commit_rec, + asym_trans_kill_coord_pid_log_commit_rec, + asym_trans_kill_coord_log_commit_dec, + asym_trans_kill_coord_pid_log_commit_dec, + asym_trans_kill_coord_rec_acc_pre_commit_log_commit, + asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit, + asym_trans_kill_coord_rec_acc_pre_commit_done_commit, + asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit]}, + {after_corrupt_files, [], + [after_corrupt_files_decision_log_head, + after_corrupt_files_decision_log_tail, + after_corrupt_files_latest_log_head, + after_corrupt_files_latest_log_tail, + after_corrupt_files_table_dat_head, + after_corrupt_files_table_dat_tail, + after_corrupt_files_schema_dat_head, + after_corrupt_files_schema_dat_tail]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + tpcb_config(ReplicaType, _NodeConfig, Nodes) -> [{n_branches, 5}, @@ -83,30 +144,7 @@ tpcb_config(ReplicaType, _NodeConfig, Nodes) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -mnesia_down(doc) -> - [" Various tests about recovery when mnesia goes down on one or several nodes."]; -mnesia_down(suite) -> - [ - mnesia_down_during_startup, - master_node_tests, - read_during_down, - with_checkpoint, - delete_during_start - ]. - -master_node_tests(doc) -> - ["Verify that mnesia loads the correct data after it has been down, regarding master node settings."]; -master_node_tests(suite) -> - [ - no_master_2, - no_master_3, - one_master_2, - one_master_3, - two_master_2, - two_master_3, - all_master_2, - all_master_3 - ]. + no_master_2(suite) -> []; no_master_2(Config) when is_list(Config) -> mnesia_down_2(no, Config). @@ -251,13 +289,6 @@ mnesia_down_3(Masters, Config) -> ?verify_mnesia(Nodes, []). -read_during_down(doc) -> - ["Verify that read operation can continue to read when mnesia goes down"]; -read_during_down(suite) -> - [ - dirty_read_during_down, - trans_read_during_down - ]. dirty_read_during_down(suite) -> []; @@ -325,20 +356,6 @@ loop_and_kill_mnesia(N, Node, Tabs) -> timer:sleep(100), loop_and_kill_mnesia(N-1, KN, Tabs). -mnesia_down_during_startup(doc) -> - ["Verify that mnesia can come back up again in a consistent state", - "after it has gone down during startup (with different store and", - "when it goes down in different situations"]; -mnesia_down_during_startup(suite) -> - [ - mnesia_down_during_startup_disk_ram, - mnesia_down_during_startup_init_ram, - mnesia_down_during_startup_init_disc, - mnesia_down_during_startup_init_disc_only, - mnesia_down_during_startup_tm_ram, - mnesia_down_during_startup_tm_disc, - mnesia_down_during_startup_tm_disc_only - ]. mnesia_down_during_startup_disk_ram(suite) -> []; mnesia_down_during_startup_disk_ram(Config) when is_list(Config)-> @@ -433,10 +450,6 @@ mnesia_down_during_startup2(Config, ReplicaType, Debug_Point, _Father) -> ?verify_mnesia(Nodes, []). -with_checkpoint(doc) -> - ["Restart mnesia with checkpoint"]; -with_checkpoint(suite) -> - [with_checkpoint_same, with_checkpoint_other]. with_checkpoint_same(suite) -> []; with_checkpoint_same(Config) when is_list(Config) -> @@ -581,10 +594,6 @@ verify_where2read([]) -> ok. %%------------------------------------------------------------------------------------------- -explicit_stop(doc) -> - ["Stop Mnesia in different situations"]; -explicit_stop(suite) -> - [explicit_stop_during_snmp]. %% This is a bad implementation, but at least gives a indication if something is wrong explicit_stop_during_snmp(suite) -> []; explicit_stop_during_snmp(Config) when is_list(Config) -> @@ -700,21 +709,7 @@ coord_dies(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -sym_trans(doc) -> - ["Recovery of symmetrical transactions in a couple of different", - "situations; when coordinator or participant or node dies"]; - -sym_trans(suite) -> - [sym_trans_before_commit_kill_coord_node, %% coordinator node dies - sym_trans_before_commit_kill_coord_pid, %% coordinator process dies - sym_trans_before_commit_kill_part_after_ask, %% participating node dies - sym_trans_before_commit_kill_part_before_ask, - sym_trans_after_commit_kill_coord_node, - sym_trans_after_commit_kill_coord_pid, - sym_trans_after_commit_kill_part_after_ask, - sym_trans_after_commit_kill_part_do_commit_pre, - sym_trans_after_commit_kill_part_do_commit_post]. + %kill_after_debug_point(Config, TestCase, {Debug_node, Debug_Point}, TransFun, Tab) @@ -828,17 +823,6 @@ do_sym_trans([Tab], _Fahter) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -sync_dirty(doc) -> - ["Verify recovery of synchronously operations in a couple of different", - "situations"]; -sync_dirty(suite) -> - [sync_dirty_pre_kill_part, - sync_dirty_pre_kill_coord_node, - sync_dirty_pre_kill_coord_pid, - sync_dirty_post_kill_part, - sync_dirty_post_kill_coord_node, - sync_dirty_post_kill_coord_pid - ]. sync_dirty_pre_kill_part(suite) -> []; sync_dirty_pre_kill_part(Config) when is_list(Config) -> @@ -916,16 +900,6 @@ do_sync_dirty([Tab], _Father) -> ?dl("SYNC_DIRTY done: ~p ", [Res]), ok. -async_dirty(doc) -> - ["Verify recovery of asynchronously dirty operations in a couple of different", - "situations"]; -async_dirty(suite) -> - [async_dirty_pre_kill_part, - async_dirty_pre_kill_coord_node, - async_dirty_pre_kill_coord_pid, - async_dirty_post_kill_part, - async_dirty_post_kill_coord_node, - async_dirty_post_kill_coord_pid]. async_dirty_pre_kill_part(suite) -> []; async_dirty_pre_kill_part(Config) when is_list(Config) -> @@ -1005,29 +979,6 @@ do_async_dirty([Tab], _Fahter) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -asym_trans(doc) -> - ["Recovery of asymmetrical transactions in a couple of different", - "situations, currently the error cases are not covered, i.e. ", - "not tested are the situations when we kill mnesia or a process", - "during a recovery"]; -asym_trans(suite) -> - [ - asym_trans_kill_part_ask, - asym_trans_kill_part_commit_vote, - asym_trans_kill_part_pre_commit, - asym_trans_kill_part_log_commit, - asym_trans_kill_part_do_commit, - asym_trans_kill_coord_got_votes, - asym_trans_kill_coord_pid_got_votes, - asym_trans_kill_coord_log_commit_rec, - asym_trans_kill_coord_pid_log_commit_rec, - asym_trans_kill_coord_log_commit_dec, - asym_trans_kill_coord_pid_log_commit_dec, - asym_trans_kill_coord_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit, - asym_trans_kill_coord_rec_acc_pre_commit_done_commit, - asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit - ]. asym_trans_kill_part_ask(suite) -> []; asym_trans_kill_part_ask(Config) when is_list(Config) -> @@ -1435,18 +1386,6 @@ after_full_disc_partition(doc) -> %% interrupted_fallback_start %% is implemented in consistency interupted_install_fallback! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -after_corrupt_files(doc) -> - ["Verify that mnesia (and dets) can handle corrupt files"]; -after_corrupt_files(suite) -> % cope with unsynced disks - [after_corrupt_files_decision_log_head, - after_corrupt_files_decision_log_tail, - after_corrupt_files_latest_log_head, - after_corrupt_files_latest_log_tail, - after_corrupt_files_table_dat_head, - after_corrupt_files_table_dat_tail, - after_corrupt_files_schema_dat_head, - after_corrupt_files_schema_dat_tail - ]. after_corrupt_files_decision_log_head(suite) -> []; after_corrupt_files_decision_log_head(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_registry_test.erl b/lib/mnesia/test/mnesia_registry_test.erl index 7d97b66aab..daf6897861 100644 --- a/lib/mnesia/test/mnesia_registry_test.erl +++ b/lib/mnesia/test/mnesia_registry_test.erl @@ -30,13 +30,18 @@ end_per_testcase(Func, Conf) -> mnesia_test_lib:end_per_testcase(Func, Conf). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Test the mnesia_registry module"]; -all(suite) -> - [ - good_dump, - bad_dump - ]. +all() -> +[good_dump, bad_dump]. + +groups() -> + []. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% good_dump(doc) -> diff --git a/lib/mnesia/test/mnesia_schema_recovery_test.erl b/lib/mnesia/test/mnesia_schema_recovery_test.erl index d20c94af40..0fd9ffb9a4 100644 --- a/lib/mnesia/test/mnesia_schema_recovery_test.erl +++ b/lib/mnesia/test/mnesia_schema_recovery_test.erl @@ -41,92 +41,85 @@ end_per_testcase(Func, Conf) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Verify recoverabiliy of schema transactions.", - " Verify that a schema transaction", - " can be completed when it has been logged correctly and Mnesia", - " crashed before the log has been dumped. Then the transaction ", - " should be handled during the log dump at startup" - ]; -all(suite) -> - [interrupted_before_log_dump, - interrupted_after_log_dump]. - -interrupted_before_log_dump(suite) -> - [interrupted_before_create_ram, - interrupted_before_create_disc, - interrupted_before_create_disc_only, - interrupted_before_create_nostore, - interrupted_before_delete_ram, - interrupted_before_delete_disc, - interrupted_before_delete_disc_only, - interrupted_before_add_ram, - interrupted_before_add_disc, - interrupted_before_add_disc_only, - interrupted_before_add_kill_copier, - interrupted_before_move_ram, - interrupted_before_move_disc, - interrupted_before_move_disc_only, - interrupted_before_move_kill_copier, - interrupted_before_delcopy_ram, - interrupted_before_delcopy_disc, - interrupted_before_delcopy_disc_only, - interrupted_before_delcopy_kill_copier, - interrupted_before_addindex_ram, - interrupted_before_addindex_disc, - interrupted_before_addindex_disc_only, - interrupted_before_delindex_ram, - interrupted_before_delindex_disc, - interrupted_before_delindex_disc_only, - interrupted_before_change_type_ram2disc, - interrupted_before_change_type_ram2disc_only, - interrupted_before_change_type_disc2ram, - interrupted_before_change_type_disc2disc_only, - interrupted_before_change_type_disc_only2ram, - interrupted_before_change_type_disc_only2disc, - interrupted_before_change_type_other_node, - interrupted_before_change_schema_type %% Change schema table copy type!! - ]. - -interrupted_after_log_dump(suite) -> - [interrupted_after_create_ram, - interrupted_after_create_disc, - interrupted_after_create_disc_only, - interrupted_after_create_nostore, - interrupted_after_delete_ram, - interrupted_after_delete_disc, - interrupted_after_delete_disc_only, - interrupted_after_add_ram, - interrupted_after_add_disc, - interrupted_after_add_disc_only, - interrupted_after_add_kill_copier, - interrupted_after_move_ram, - interrupted_after_move_disc, - interrupted_after_move_disc_only, - interrupted_after_move_kill_copier, - interrupted_after_delcopy_ram, - interrupted_after_delcopy_disc, - interrupted_after_delcopy_disc_only, - interrupted_after_delcopy_kill_copier, - interrupted_after_addindex_ram, - interrupted_after_addindex_disc, - interrupted_after_addindex_disc_only, - interrupted_after_delindex_ram, - interrupted_after_delindex_disc, - interrupted_after_delindex_disc_only, - interrupted_after_change_type_ram2disc, - interrupted_after_change_type_ram2disc_only, - interrupted_after_change_type_disc2ram, - interrupted_after_change_type_disc2disc_only, - interrupted_after_change_type_disc_only2ram, - interrupted_after_change_type_disc_only2disc, - interrupted_after_change_type_other_node, - interrupted_after_change_schema_type %% Change schema table copy type!! - -% interrupted_before_change_access_mode, -% interrupted_before_transform, -% interrupted_before_restore, - ]. +all() -> +[{group, interrupted_before_log_dump}, + {group, interrupted_after_log_dump}]. + +groups() -> + [{interrupted_before_log_dump, [], + [interrupted_before_create_ram, + interrupted_before_create_disc, + interrupted_before_create_disc_only, + interrupted_before_create_nostore, + interrupted_before_delete_ram, + interrupted_before_delete_disc, + interrupted_before_delete_disc_only, + interrupted_before_add_ram, interrupted_before_add_disc, + interrupted_before_add_disc_only, + interrupted_before_add_kill_copier, + interrupted_before_move_ram, + interrupted_before_move_disc, + interrupted_before_move_disc_only, + interrupted_before_move_kill_copier, + interrupted_before_delcopy_ram, + interrupted_before_delcopy_disc, + interrupted_before_delcopy_disc_only, + interrupted_before_delcopy_kill_copier, + interrupted_before_addindex_ram, + interrupted_before_addindex_disc, + interrupted_before_addindex_disc_only, + interrupted_before_delindex_ram, + interrupted_before_delindex_disc, + interrupted_before_delindex_disc_only, + interrupted_before_change_type_ram2disc, + interrupted_before_change_type_ram2disc_only, + interrupted_before_change_type_disc2ram, + interrupted_before_change_type_disc2disc_only, + interrupted_before_change_type_disc_only2ram, + interrupted_before_change_type_disc_only2disc, + interrupted_before_change_type_other_node, + interrupted_before_change_schema_type]}, + {interrupted_after_log_dump, [], + [interrupted_after_create_ram, + interrupted_after_create_disc, + interrupted_after_create_disc_only, + interrupted_after_create_nostore, + interrupted_after_delete_ram, + interrupted_after_delete_disc, + interrupted_after_delete_disc_only, + interrupted_after_add_ram, interrupted_after_add_disc, + interrupted_after_add_disc_only, + interrupted_after_add_kill_copier, + interrupted_after_move_ram, interrupted_after_move_disc, + interrupted_after_move_disc_only, + interrupted_after_move_kill_copier, + interrupted_after_delcopy_ram, + interrupted_after_delcopy_disc, + interrupted_after_delcopy_disc_only, + interrupted_after_delcopy_kill_copier, + interrupted_after_addindex_ram, + interrupted_after_addindex_disc, + interrupted_after_addindex_disc_only, + interrupted_after_delindex_ram, + interrupted_after_delindex_disc, + interrupted_after_delindex_disc_only, + interrupted_after_change_type_ram2disc, + interrupted_after_change_type_ram2disc_only, + interrupted_after_change_type_disc2ram, + interrupted_after_change_type_disc2disc_only, + interrupted_after_change_type_disc_only2ram, + interrupted_after_change_type_disc_only2disc, + interrupted_after_change_type_other_node, + interrupted_after_change_schema_type]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + + + interrupted_before_create_ram(suite) -> []; interrupted_before_create_ram(Config) when is_list(Config) -> diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl index a1dea72926..01f1fd026c 100644 --- a/lib/mnesia/test/mnesia_trans_access_test.erl +++ b/lib/mnesia/test/mnesia_trans_access_test.erl @@ -40,18 +40,41 @@ end_per_testcase(Func, Conf) -> -endif. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -all(doc) -> - ["Evil access of records in the scope of transactions", - "Invoke all functions in the API and try to cover all legal uses", - "cases as well the illegal dito. This is a complement to the", - "other more explicit test cases."]; -all(suite) -> - [ - write, read, wread, delete, delete_object, - match_object, select, select14, all_keys, - transaction, nested_activities, - index_tabs, index_lifecycle - ]. +all() -> +[write, read, wread, delete, delete_object, + match_object, select, select14, all_keys, transaction, + {group, nested_activities}, {group, index_tabs}, + {group, index_lifecycle}]. + +groups() -> + [{nested_activities, [], + [basic_nested, {group, nested_transactions}, + mix_of_nested_activities]}, + {nested_transactions, [], + [nested_trans_both_ok, nested_trans_child_dies, + nested_trans_parent_dies, nested_trans_both_dies]}, + {index_tabs, [], + [index_match_object, index_read, {group, index_update}, + index_write]}, + {index_update, [], + [index_update_set, index_update_bag]}, + {index_lifecycle, [], + [add_table_index_ram, add_table_index_disc, + add_table_index_disc_only, create_live_table_index_ram, + create_live_table_index_disc, + create_live_table_index_disc_only, del_table_index_ram, + del_table_index_disc, del_table_index_disc_only, + {group, idx_schema_changes}]}, + {idx_schema_changes, [], + [idx_schema_changes_ram, idx_schema_changes_disc, + idx_schema_changes_disc_only]}]. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + %% Write records @@ -404,12 +427,6 @@ transaction(Config) when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -nested_activities(suite) -> - [ - basic_nested, - nested_transactions, - mix_of_nested_activities - ]. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -520,13 +537,6 @@ n_f4() -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -nested_transactions(doc) -> - ["Verify that nested_transactions are handled as expected"]; -nested_transactions(suite) -> - [nested_trans_both_ok, - nested_trans_child_dies, - nested_trans_parent_dies, - nested_trans_both_dies]. nested_trans_both_ok(suite) -> []; nested_trans_both_ok(Config) when is_list(Config) -> @@ -671,13 +681,6 @@ read_op(Oid) -> Ops end. -index_tabs(suite) -> - [ - index_match_object, - index_read, - index_update, - index_write - ]. %% Read matching records by using an index @@ -767,10 +770,6 @@ index_read(Config) when is_list(Config) -> ?match({'EXIT', {aborted, no_transaction}}, mnesia:index_read(Tab, 2, ValPos)), ?verify_mnesia(Nodes, []). -index_update(suite) -> [index_update_set, index_update_bag]; -index_update(doc) -> ["See Ticket OTP-2083, verifies that a table with a index is " - "update in the correct way i.e. the index finds the correct " - "records after a update"]. index_update_set(suite) -> []; index_update_set(Config)when is_list(Config) -> [Node1] = Nodes = ?acquire_nodes(1, Config), @@ -1046,19 +1045,6 @@ index_write(Config)when is_list(Config) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Add and drop indecies -index_lifecycle(suite) -> - [ - add_table_index_ram, - add_table_index_disc, - add_table_index_disc_only, - create_live_table_index_ram, - create_live_table_index_disc, - create_live_table_index_disc_only, - del_table_index_ram, - del_table_index_disc, - del_table_index_disc_only, - idx_schema_changes - ]. add_table_index_ram(suite) -> []; add_table_index_ram(Config) when is_list(Config) -> @@ -1171,13 +1157,6 @@ del_table_index(Config, Storage) -> ?match({atomic, ok}, mnesia:transaction(NestedFun)), ?verify_mnesia(Nodes, []). -idx_schema_changes(suite) -> [idx_schema_changes_ram, - idx_schema_changes_disc, - idx_schema_changes_disc_only]; -idx_schema_changes(doc) -> - ["Tests that index tables are handled correctly when schema changes.", - "For example when a replica is deleted or inserted", - "TICKET OTP-2XXX (ELVIRA)"]. idx_schema_changes_ram(suite) -> []; idx_schema_changes_ram(Config) when is_list(Config) -> |