aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test
AgeCommit message (Collapse)Author
2019-06-27[ct] Store correct paths with from-release in ct_release_testSiri Hansen
In opaque data given to callback module, the paths to application lib dirs were faulty for the release to upgrade from. This is now corrected.
2019-06-14Merge branch ↵Siri Hansen
'siri/ct/fail-after-failed-init_per_testcase/ERIERL-350/OTP-15869' into maint * siri/ct/fail-after-failed-init_per_testcase/ERIERL-350/OTP-15869: [ct] Allow post_init_per_testcase to change skip to fail
2019-06-10Merge branch 'siri/ct/hook-terminated-not-initiated/ERIERL-370/OTP-15863' ↵Siri Hansen
into maint * siri/ct/hook-terminated-not-initiated/ERIERL-370/OTP-15863: [ct] Fix bug where Hook:terminate/1 was called before Hook:init/2
2019-06-04[ct] Fix bug where Hook:terminate/1 was called before Hook:init/2Siri Hansen
This problem was introduced with commit acd87425acf7705328b01aa8f0a804207ffe4790, when the new hook function post_groups/2 and post_all/3 were added.
2019-05-21[ct] Allow post_init_per_testcase to change skip to failSiri Hansen
2019-04-16Merge branch 'siri/ct/fuzzer_support/ERIERL-143/OTP-14746' into maint-20Erlang/OTP
* siri/ct/fuzzer_support/ERIERL-143/OTP-14746: [ct] Fix bug with faulty suite name in end_per_suite config [ct] Add {testcase,TC,RepeatProps} syntax for repeating test cases [ct] Add post_groups/2 and post_all/3 hook functions # Conflicts: # lib/common_test/test/Makefile
2019-04-16Merge branch 'maint'Siri Hansen
2019-04-16Merge branch 'siri/ct/fuzzer_support/ERIERL-143/OTP-14746' into maintSiri Hansen
* siri/ct/fuzzer_support/ERIERL-143/OTP-14746: [ct] Fix bug with faulty suite name in end_per_suite config [ct] Add {testcase,TC,RepeatProps} syntax for repeating test cases [ct] Add post_groups/2 and post_all/3 hook functions
2019-04-16Merge branch 'maint'Siri Hansen
2019-04-16Merge branch 'siri/ct/reset_curr_tc/ERIERL-334/OTP-15717' into maintSiri Hansen
* siri/ct/reset_curr_tc/ERIERL-334/OTP-15717: [ct] Cleanup after timetrap timeout or kill during framework call or hook
2019-04-15[ct] Add {testcase,TC,RepeatProps} syntax for repeating test casesSiri Hansen
2019-04-15[ct] Add post_groups/2 and post_all/3 hook functionsPeter Andersson
2019-04-15[ct] Cleanup after timetrap timeout or kill during framework call or hookSiri Hansen
If a framework callback function exits due to a timetrap timeout, or the process in other way is killed, during the execution of such function, some internal common_test data was not cleaned up. An example of such data is the 'curr_tc' test data. This is now corrected.
2019-04-10Merge pull request #2197 from lbolla/spelling-mistakes-fixBjörn Gustavsson
Fix various spelling mistakes
2019-03-31Fix various spelling mistakesLorenzo Bolla
Fix ERL-541 and various other unreported spelling mistakes.
2019-02-15Merge branch 'maint'Siri Hansen
2019-02-15Merge branch ↵Siri Hansen
'siri/ct/post_end_per_testcase-change-status/ERIERL-282/OTP-15584' into maint * siri/ct/post_end_per_testcase-change-status/ERIERL-282/OTP-15584: [ct] Allow post_end_per_testcase hook to change tc status after timetrap
2019-02-11Merge branch 'maint'Sverker Eriksson
2019-02-11Merge branch 'siri/ct_netconfc/edit-config-list/OTP-15298' into maintSiri Hansen
* siri/ct_netconfc/edit-config-list/OTP-15298: [ct] Allow ct_netconfc:edit_config/3,4,5 to take a list of XML elements
2019-01-31[ct] Allow ct_netconfc:edit_config/3,4,5 to take a list of XML elementsSiri Hansen
The yang RFC allows more than one top element of config data in an edit-config element.
2019-01-31[ct] Add option {newline,string()} to ct_telnet:cmd and ct_telnet:sendSiri Hansen
By default, each command is appended with "\n", but in some cases a command must end with "\r\n" to evaluate correctly. This can now be specified with option {newline,"\r\n"}.
2019-01-30[ct] Improve error handling of bad regular expressions to ct_telnetSiri Hansen
2018-12-20[ct] Allow post_end_per_testcase hook to change tc status after timetrapSiri Hansen
2018-09-26Use os:getenv/2 where possiblePeter Lemenkov
Signed-off-by: Peter Lemenkov <[email protected]>
2018-07-27Change "can not" into "cannot"Raimo Niskanen
I did not find any legitimate use of "can not", however skipped changing e.g RFCs archived in the source tree.
2018-06-18Update copyright yearHenrik Nord
2018-06-07common_test: Remove EDoc comments in internal modulesHans Bolinder
2018-04-26Test cuddle for loggerSiri Hansen
2018-02-05common_test: Do not call erlang:get_stacktrace()Hans Bolinder
2017-12-04Merge branch 'maint'Peter Andersson
2017-12-04Add tests and doc for the new remaining_test_procs functionPeter Andersson
2017-11-30Stop using prim_file directly in test_serverJohn Högberg
Files opened with the file module are not guaranteed to work with prim_file, even when opened in raw mode.
2017-09-15common_test: Do not use deprecated functions in string(3)Siri Hansen
2017-06-19Update copyright yearHans Nilsson
2017-06-16[ct] Print unicode atoms and strings correctly in common_test logsSiri Hansen
And use correct encoding when printing to files.
2017-06-14Update copyright yearHans Nilsson
2017-05-10[ct] Clean up after keep_logs testSiri Hansen
2017-05-08[ct_netconfc] Start multiple sessions per SSH connectionSiri Hansen
The following new functions are added to ct_netconfc: * connect/1,2 - open an SSH connection to a netconf server * disconnect/1 - close the given SSH connectoin * session/1,2,3 - open an SSH channel on the give connection and send 'hello' to start a netconf session. This allows running multiple channels on on SSH connection, realizing one netconf session per channel. The existing ct_netconfc:open will always run one channel(session) per SSH connection.
2017-05-04Update copyright yearRaimo Niskanen
2017-03-20[ct] Add 'keep_logs' optionSiri Hansen
If setting the value for this option to an integer, N, common_test will remove all ct_run.* directories in the current log directory, except the N newest. The default value for the 'keep_logs' option is 'all', which means that no logs will be deleted. 'keep_logs' can be used in combination with refresh_logs, or in a normal common_test test run.
2017-03-06Merge branch 'siri/ct_hooks/callbacks-on-skip/OTP-10599' into maintSiri Hansen
* siri/ct_hooks/callbacks-on-skip/OTP-10599: [ct] Update built-in ct hooks with new Suite parameter [cth_surefire] Handle skips from test spec [ct] Remove excessive skipped/failed tag in hook function [ct] Send tc_start event on force_stop and failed sequence [ct] Correctly handle process died in init and end_per_testcase [ct] Fix faulty hook callbacks for skipped tests Add dummy end_per_suite/1 [ct] Fix hooks and fail when one of init/end_per_* does not exit [ct] Add Suite argument to hook callback functions [ct] Fix function_clause in ct_framework when hook function crashes
2017-02-22Merge branch 'siri/ct/get_dirs_from_testspec/OTP-14132' into maintSiri Hansen
* siri/ct/get_dirs_from_testspec/OTP-14132: [ct] Add ct_testspec:get_tests/1
2017-02-21[cth_surefire] Handle skips from test specSiri Hansen
When a test case is skipped from the test spec, there is no call to the common_test hook functions 'pre_init_per_testcase' and 'post_end_per_testcase'. This causes cth_surefire to erroneously mark the previous test case as skipped in the xml report. The actually skipped test case is not present in the xml report at all. This is now corrected. OTP-14129
2017-02-20[ct] Remove excessive skipped/failed tag in hook functionSiri Hansen
When skipping or failing in a configuration function, the configuration function itself would get {auto_skipped,Reason}, {skipped,Reason} or {failed,Reason} in the hook callbacks on_tc_skip or on_tc_fail. The other test cases that were skipped as a result of this would only get Reason in the hook callbacks. This is now corrected.
2017-02-20[ct] Send tc_start event on force_stop and failed sequenceSiri Hansen
If test cases were skipped because of option {force_stop,skip_rest} or because of a failed sequence, then no tc_start event would be sent, only only tc_done. This is now corrected.
2017-02-20[ct] Correctly handle process died in init and end_per_testcaseSiri Hansen
Documentation says that a test case is skipped if init_per_testcase fails. This is correct if init_per_testcase fails in a normal way, but if it gets an exit signal causing the process to die, then the case was earlier marked as failed with reason {skip,...}. This is now corrected, so the case is auto skipped. If end_per_testcase crashes, it does not change the result of a test case, it only adds a warning in the comment field. But if it gets an exit signal causing the process to die while running end_per_testcase, then the case was earlier marked as failed in addition to this warning. This is now corrected, so the result of the test case is not changed by an exit signal during end_per_testcase.
2017-02-20[ct] Fix faulty hook callbacks for skipped testsSiri Hansen
The following bugs are corrected: * Tests that were skipped before calling pre_init_per_* got faulty calls to the corresponding post_init_per_*. E.g. if a test was skipped because suite/0 returned a 'require' statement that was not fulfilled, then post_init_per_suite would be called, even though pre_init_per_suite and init_per_suite were not called. * Tests that were skipped before or in init_per_testcase got faulty calls to pre_end_per_testcase and post_end_per_testcase (end_per_testcase is not called in these situations). Test are added to make sure that the expected callbacks, and only those, are called when tests are skipped in different ways. Conflicts: lib/common_test/test/ct_hooks_SUITE.erl
2017-02-20[ct] Fix hooks and fail when one of init/end_per_* does not exitSiri Hansen
The following bugs are corrected: - if init_per_suite is exported from a test suite, but not end_per_suite, then pre/post_end_per_suite will be called with Suite=ct_framework instead of the correct suite name. - if end_per_group is exported from a suite, but not init_per_group, then end_per_group is never called. According to the documentation, if implementing an init config function, you must also implement the end config function, so the two scenarios above are really not allowed. To make this more visible, common_test will now mark the non-exported config function as failed with reason 'undef' if the other function is exported. For example, if init_per_suite is exported, but not end_per_suite, then end_per_suite will be marked as failed with reason undef. (If none of them exist, then they will both be marked as passed since the default functions in ct_framework are called instead.) All hook functions are always called with the correct suite name, i.e. never with Suite=ct_framework. Conflicts: lib/common_test/test/ct_hooks_SUITE.erl
2017-02-20[ct] Add Suite argument to hook callback functionsSiri Hansen
An extra argument, Suite, is added as the first argument to each of the following hook callback functions: - pre_init_per_group - post_init_per_group - pre_end_per_group - post_end_per_group - pre_init_per_testcase - post_init_per_testcase - pre_end_per_testcase - post_end_per_testcase - on_tc_fail - on_tc_skip For backwards compatibility, if the new function is not exported from a hook callback module, common_test will fall back to the old interface and call the function without the Suite argument. The reason for adding the new argument is that if a test suite is skipped by a 'skip_suites' statement in the test specification, then there will be no call to pre/post_init_per_suite, and thus the hook has no other way of knowing which Suite is skipped when it gets the on_tc_skip callback. The other callbacks are updated for symmetry.
2017-01-17Merge branch 'egil/cuddle-tests' into maintBjörn-Egil Dahlberg
* egil/cuddle-tests: stdlib: Increase timetrap for rand_SUITE common_test: Increase timetrap for cth_hooks_SUITE compiler: Increase timetrap timeouts for lc_SUITE