aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
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-21kernel: Fix hanging os:cmd race conditionLukas Larsson
If the port terminates before Port ! close is issued, there will be no 'closed' reply, so the old code would hang. As it turns out there is no way to figure out if a closed reply is supposed to come as that reply is sent after all links and monitors are triggered. So we have to use the synchronous port_close to close the port.
2017-02-21stdlib: Improve pretty-printing of terms with mapsHans Bolinder
As of committing this branch maps:fold/3 calls maps:to_list/1, which means that the time and memory needed for printing maps is not always proportional to the size of the generated deep list of characters.
2017-02-21filename: Add safe_relative_path/1Björn Gustavsson
Add safe_relative_path/1 to guard against directory traversal attacks. It either returns a shorter path without any ".." or "." components, or 'unsafe' if an ".." component would climb up above the root of the relative path. Here are a few examples: safe_relative_path("a/b/..") => "a" safe_relative_path("a/..") => "" safe_relative_path("a/../..") => unsafe safe_relative_path("/absolute/path") => unsafe The returned path can be used directly or combined with an absolute path using filename:join/2.
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-20Add dummy end_per_suite/1Siri Hansen
common_test requires that if init_per_suite/1 exists, then end_per_suite/1 must also exist. If end_per_suite/1 does not exist, then it will be marked in the log as failed with reason 'undef'. Some test suites are corrected to avoid this.
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-02-20Merge branch 'hans/ssh/iolist_on_unicode/ERL-364/OTP-14230' into maintHans Nilsson
2017-02-20Merge branch 'hans/ssh/cuddle_tests' into maintHans Nilsson
2017-02-20kernel: Fail sticky_dir tc if module not stickyLukas Larsson
Running this test when for some reason stdlib has been unstickied could cause the emulator to die. So we check first to make sure that the expected files are sticky.
2017-02-17ssh: replace byte-only function with element-size agnosticHans Nilsson
An error report on ssh_cli pointed to a usage of erlang:iolist_size/1. It is replaced by a specialized function.
2017-02-17ssh: increase timetrap in ssh_to_openssh_SUITE to not interrupt some slow ↵Hans Nilsson
machines
2017-02-17Merge branch 'ssh_sftpd_relative_path' into hans/ssh/sftpd_fixes/OTP-14225Hans Nilsson
Conflicts: lib/ssh/test/ssh_sftpd_SUITE.erl
2017-02-17Merge branch 'ssh_sftpd_cwd_with_root' into hans/ssh/sftpd_fixes/OTP-14225Hans Nilsson
Conflicts: lib/ssh/test/ssh_sftpd_SUITE.erl
2017-02-17Merge branch 'hans/ssh/try_sftp_access_outside_root' into ↵Hans Nilsson
hans/ssh/sftpd_fixes/OTP-14225
2017-02-16Merge branch 'hans/ssh/ssh_acceptor_bug/OTP-14108' into maintHans Nilsson
2017-02-16Merge branch 'hans/public_key/ssh_fingerprint_algorithm_list/OTP-14223' into ↵Hans Nilsson
maint
2017-02-15[ct] Fix function_clause in ct_framework when hook function crashesSiri Hansen
If CtHook:pre_init_per_testcase(...,end_per_testcase,...) failed, then the ct_framework:end_tc would fail with function_clause. This is now corrected.
2017-02-15ssh: handle return values and exceptions from ssh_acceptor:handle_connectionHans Nilsson
2017-02-15ssh: More exact test for is_tcp_socketHans Nilsson
2017-02-15ssh: Add error case for bad socketHans Nilsson
2017-02-15ssh: speling errorHans Nilsson
2017-02-15ssh: speling errorHans Nilsson
2017-02-15ssh: reword documentationHans Nilsson
2017-02-15[xmerl] Correct handling of implicit XML namespaceLars Thorsen
The namespace_conformant option did not work when parsing documents without explicit XML namespace declaration.
2017-02-15Documentation: tuple funs are unsupportedMagnus Henoch
Remove use of tuple fun from erl_call documentation. It seems like fun math:sqrt/1 isn't parsed correctly by erl_call, so I replaced the example with a simpler one that doesn't require a fun.
2017-02-15Return correct state in the case of failureKarolis Petrauskas
2017-02-14ssh: allow a list of fingerprint algos in silently_accept_hosts optionHans Nilsson
2017-02-14public_key: generate a list of ssh fingerprints on requestHans Nilsson
2017-02-14Merge branch 'hans/ssh/cuddle_tests' into maintHans Nilsson
2017-02-14ssh: new test - try access outside sftp treeHans Nilsson
2017-02-14Merge branch 'ingela/ssl/handshake-match/ERL-347/OTP-14222' into maintIngela Anderton Andin
* ingela/ssl/handshake-match/ERL-347/OTP-14222: ssl: Test case robustness ssl: Avoid SSL/TLS hello format confusion
2017-02-13ssl: Test case robustnessIngela Anderton Andin
2017-02-12Check for directory with correct pathKarolis Petrauskas
When opening file in the ssh_sftpd, directory check should be performed on the server's file tree.
2017-02-12Fix relative path handling in sftpdKarolis Petrauskas
Relative path handling fixed to allow opening a file by a path relative to the current working directory.
2017-02-12Consider root_dir and cwd in ssh_sftpd, if both are providedKarolis Petrauskas
The SFTPD server should use root_dir and cwd when resolving file paths, if both are provided. The root directory should be used for resolving absolute file names, and cwd should be used for resolving relative paths.
2017-02-09Merge branch 'hasse/stdlib/shell_tab_compl/ERL-352/OTP-14200' into maintHans Bolinder
* hasse/stdlib/shell_tab_compl/ERL-352/OTP-14200: stdlib: Improve Erlang shell's tab-completion of long names
2017-02-09Merge branch 'siri/systools/warnings_as_errors-return/OTP-14170' into maintSiri Hansen
* siri/systools/warnings_as_errors-return/OTP-14170: [systools] Fix return value for warnings_as_errors + silent
2017-02-09Merge pull request #1333 from lepoetemaudit/observer-term-error-spellingBjörn Gustavsson
Fix observer term conversion error spelling
2017-02-09Merge branch 'hasse/dialyzer/correct_plt_tests' into maintHans Bolinder
* hasse/dialyzer/correct_plt_tests: dialyzer: Correct PLT tests
2017-02-08stdlib: Improve Erlang shell's tab-completion of long namesHans Bolinder
2017-02-08ssh: modify ssh_algorithms_SUITE:init_per_suite for some Windows hangningHans Nilsson
2017-02-08Fix observer term conversion error spellingDave Jeffrey
In the observer UI, when inspecting state, the error given when attempting to convert a bad term contains a spelling mistake.
2017-02-08Merge pull request #1282 from leoliu/maintDan Gudmundsson
[tools] Update erlang-edoc.el to include param and returns OTP-14217
2017-02-08Merge branch 'maint-19' into maintRaimo Niskanen
Conflicts: OTP_VERSION
2017-02-08ssl: Avoid SSL/TLS hello format confusionIngela Anderton Andin
Valid SSL 3.0 or TLS hellos might accidentally match SSL 2.0 format (and sometimes the other way around before inspecting data) so we need to match SSL 3.0 and TLS first and only match SSL 2.0 hellos when flag to support it is set.