diff options
author | Peter Andersson <[email protected]> | 2013-01-05 15:09:58 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2013-01-05 15:09:58 +0100 |
commit | 626f4720baafedca7a58711c0e8d30a2f1b522ee (patch) | |
tree | 202b78ad7b4d1af6b800afed5a764e1af373ca57 /lib/common_test/test/ct_error_SUITE.erl | |
parent | 4d4b3c710cf76d94c1545ffc530f00c11b9d6b7e (diff) | |
download | otp-626f4720baafedca7a58711c0e8d30a2f1b522ee.tar.gz otp-626f4720baafedca7a58711c0e8d30a2f1b522ee.tar.bz2 otp-626f4720baafedca7a58711c0e8d30a2f1b522ee.zip |
Add test case to verify that config data gets properly restored
Diffstat (limited to 'lib/common_test/test/ct_error_SUITE.erl')
-rw-r--r-- | lib/common_test/test/ct_error_SUITE.erl | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl index 6d90b29f41..a077cb2560 100644 --- a/lib/common_test/test/ct_error_SUITE.erl +++ b/lib/common_test/test/ct_error_SUITE.erl @@ -44,8 +44,12 @@ %% there will be clashes with logging processes etc). %%-------------------------------------------------------------------- init_per_suite(Config) -> - Config1 = ct_test_support:init_per_suite(Config), - Config1. + DataDir = ?config(data_dir, Config), + TestDir = filename:join(DataDir, "error/test/"), + CTH = filename:join(TestDir, "verify_config.erl"), + ct:pal("Compiling ~p: ~p", + [CTH,compile:file(CTH,[{outdir,TestDir},debug_info])]), + ct_test_support:init_per_suite([{path_dirs,[TestDir]} | Config]). end_per_suite(Config) -> ct_test_support:end_per_suite(Config). @@ -61,7 +65,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [cfg_error, lib_error, no_compile, timetrap_end_conf, timetrap_normal, timetrap_extended, timetrap_parallel, - timetrap_fun, timetrap_fun_group, misc_errors]. + timetrap_fun, timetrap_fun_group, misc_errors, + config_restored]. groups() -> []. @@ -285,6 +290,24 @@ misc_errors(Config) when is_list(Config) -> TestEvents = events_to_check(misc_errors), ok = ct_test_support:verify_events(TestEvents, Events, Config). +%%%----------------------------------------------------------------- +%%% +config_restored(Config) when is_list(Config) -> + DataDir = ?config(data_dir, Config), + Suite = filename:join(DataDir, "error/test/config_restored_SUITE"), + {Opts,ERPid} = setup([{suite,Suite}, + {ct_hooks,[verify_config]}], + Config), + ok = ct_test_support:run(Opts, Config), + Events = ct_test_support:get_events(ERPid, Config), + + ct_test_support:log_events(config_restored, + reformat(Events, ?eh), + ?config(priv_dir, Config), + Opts), + + TestEvents = events_to_check(config_restored), + ok = ct_test_support:verify_events(TestEvents, Events, Config). %%%----------------------------------------------------------------- %%% HELP FUNCTIONS @@ -1439,4 +1462,8 @@ test_events(misc_errors) -> {?eh,test_stats,{2,7,{0,0}}}, {?eh,test_done,{'DEF','STOP_TIME'}}, {?eh,stop_logging,[]} - ]. + ]; + +test_events(config_restored) -> + []. + |