aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
AgeCommit message (Collapse)Author
2016-03-09Change '==' to '=' in code_SUITE:bad_erl_libsSiri Hansen
This bug was introduced by OTP-13388.
2016-03-03Fix code_SUITE after test_server changeSiri Hansen
test_server:start_node does no longer add the test_server path to the new node, since the needed code is present in the default path. This caused two test cases in code_SUITE to fail. code_SUITE:mult_lib_roots: Expected the test_server path to be first in the code path. This check is removed. code_SUITE:bad_erl_libs: Started a node with "-env ERL_LIBS ", i.e. not giving any value to the ERL_LIBS variable. This test succeeded by accident, since the combination with arguments set by test_server_node.erl and by slave.erl caused the node start to work, and no further checks were present in the test. This part of the test case is now removed.
2016-02-25kernel: Clarify heart optionBjörn-Egil Dahlberg
Change scheduler responsiveness to 'check_schedulers'.
2016-02-23kernel: Add heart options testBjörn-Egil Dahlberg
2016-02-16kernel: Add heart callback testBjörn-Egil Dahlberg
2016-02-02Merge branch 'rickard/monotonic-time-improvements/OTP-13222' into maintRickard Green
* rickard/monotonic-time-improvements/OTP-13222: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats
2016-01-28code: Correct the types for error returnsBjörn Gustavsson
The specifications for functions that load code in the 'code' module (e.g. code:load_file/1) have some problems: * The specs claim that the functions can return {error,on_load}, but they never do. However, they can return {error,on_load_failure} if the -on_load function in a module fails. * The specs claim that the functions can return {error,native_code}, but they never do. While we are it, also extend the on_load_errors/1 test case to test that the load functions return {error,on_load_failure} when an -on_load function fails.
2016-01-25Eliminate run-time system crash in code:load_abs/1Björn Gustavsson
The run-time system would terminate if code:load_abs/1 was called with a filename containing any non-latin1 characters. The reason is that code_server would attempt to construct a module name from the filename using list_to_atom/1 and that atoms currently are limited to the latin1 character set. But how should the error be reported? I have decided to that the simplest and least confusing way is to move the call to list_to_atom/1 to 'code' module and let it crash the calling process. The resulting stack back trace will make it clear what the reason for the crash was.
2016-01-20Introduce time warp safe trace timestamp formatsRickard Green
New timestamp options for trace, sequential trace, and system profile: - monotonic_timestamp - strict_monotonic_timestamp
2015-12-04Merge branch 'maint-17' into maintHenrik Nord
Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/vsn.mk lib/kernel/doc/src/notes.xml lib/kernel/src/kernel.appup.src lib/kernel/vsn.mk lib/ssl/doc/src/notes.xml lib/ssl/src/ssl.appup.src lib/ssl/src/ssl_cipher.erl lib/ssl/vsn.mk otp_versions.table
2015-12-02Merge branch 'soranoba/fix-file-position/PR-646' into maintRaimo Niskanen
* soranoba/fix-file-position/PR-646: Unify internal error handling Fix file:pread and :pwrite to use character encoding Clean up code for file:position/2 Fix file:position (not raw mode) OTP-13155
2015-11-26Fix file:pread and :pwrite to use character encodingRaimo Niskanen
2015-11-24Clean up code for file:position/2Raimo Niskanen
2015-11-19Testcase for inet:setopts/2 multiple raw optionsRaimo Niskanen
2015-10-26erts: Include test in group so that it is runIngela Anderton Andin
2015-10-26erts: Add {line_delimiter, byte()} option to inet:setopts/2Serge Aleynikov
A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols to use a custom line delimiting character. It is to be used in conjunction with {packet, line}. This option also works with erlang:decode_packet/3 when its first argument is 'line'.
2015-08-18Handle ERRNO_BLOCK in fd_driver async functionsSteve Vinoski
Several users on erlang-questions have reported problems with recent releases where output to standard_error causes standard_error_sup to die from receiving an unexpected eagain error. In the fd_driver, change the fd_async() function to handle EINTR, and change fd_ready_async() to handle ERRNO_BLOCK. Add a new test to standard_error_SUITE to generate output to standard_error and ensure that standard_error_sup does not die. Thanks to Kota Uenishi for contributing the test case.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-17Merge branch 'egil/cuddle-tests'Björn-Egil Dahlberg
* egil/cuddle-tests: kernel: Remove ?line macros in inet_SUITE:t_gethostbyaddr/1 erts: Tweak statistics_SUITE:scheduler_wall_time/1
2015-06-17Merge branch 'nybek/fix_so_linger_zero__simple'Raimo Niskanen
* nybek/fix_so_linger_zero__simple: Update prim_inet.beam Fix socket option {linger, {true, 0}} to abort TCP connections Apply 'show_econnreset' socket option to send errors as well Add 'show_econnreset' TCP socket option
2015-06-10Merge branch 'egil/fix-cover-error_logger/OTP-12818'Björn-Egil Dahlberg
* egil/fix-cover-error_logger/OTP-12818: cover: Unstick modules before loading remote kernel: Add module name to sticky_dir error message kernel: Remove ?line macros in error_logger_warn_SUITE
2015-06-10Merge branch 'nybek/fix_inet_drv_add_multi_timer_logic'Henrik Nord
* nybek/fix_inet_drv_add_multi_timer_logic: Fix add_multi_timer() in inet_drv Fix 6 tests in gen_tcp_misc_SUITE OTP-12817
2015-06-10Merge branch 'richcarl/avoid-try-native-load'Henrik Nord
* richcarl/avoid-try-native-load: Update list of funcalls in kernel code_SUITE Move architecture knowledge out of hipe loader Avoid repeated calls to system_info in hipe loader Avoid exception overhead if HiPE is disabled HiPE help shouldn't modify the calling process OTP-12816
2015-06-09Fix socket option {linger, {true, 0}} to abort TCP connectionsRory Byrne
Up until now, if {linger, {true, 0}} is set on the socket and there is data in the port driver queue, the connection is not aborted until the port queue is empty and close() is called on the underlying file descriptor. This bug allows an idle TCP client to prevent a server from terminating the connection and freeing resources. This patch fixes the problem by discarding the port queue if the socket is closed when {linger, {true, 0}} is set.
2015-06-09Apply 'show_econnreset' socket option to send errors as wellRory Byrne
Up till now all send errors have been translated into a generic {error, closed}. This patch allows {error, econnreset} to be returned on send errors when it is detected that the TCP peer has sent an RST.
2015-06-09Add 'show_econnreset' TCP socket optionRory Byrne
An ECONNRESET is a socket error which tells us that a TCP peer has sent an RST. The RST indicates that they have aborted the connection and that the payload we have received should not be considered complete. Up until now, the implementation of TCP in inet_drv.c has hidden the receipt of the RST from the user, treating it as though it was just a FIN terminating the read side of the socket. There are many cases where user code needs to be able to distinguish between a socket that was closed normally and one that was aborted. Setting the option {show_econnreset, true} enables the user to receive ECONNRESET errors on both active and passive sockets. A connected socket returned from gen_tcp:accept/1 will inherit the show_econnreset setting of the listening socket. By default this option is set to {show_econnreset, false}. Note that this patch only enables the reporting of ECONNRESET when the socket is being read from. It does not report ECONNRESET (or EPIPE) when the user tries to write to a connection when an RST has already been received. Currently the TCP implementation in inet_drv.c hides all such send errors from the user in favour of returning {error, close}. A separate patch will be needed to enable the reporting of such errors.
2015-06-09kernel: Remove ?line macros in inet_SUITE:t_gethostbyaddr/1Björn-Egil Dahlberg
2015-06-08kernel: Remove ?line macros in error_logger_warn_SUITEBjörn-Egil Dahlberg
2015-06-05Merge branch 'bjorn/kernel/cuddle-with-tests'Björn Gustavsson
* bjorn/kernel/cuddle-with-tests: Clean up rpc_SUITE:call_benchmark/1 Eliminate use of erlang:now/0 for generating random numbers Eliminate use of erlang:now/0 for measuring time Eliminate use of erlang:now/0 for generating unique node names
2015-06-05Clean up rpc_SUITE:call_benchmark/1Björn Gustavsson
The call_benchmark/1 test case is supposed to return a comment about the number of RPC calls per second, but the return value from the function that produces the comment (do_call_benchmark/4) is ignored. The test case is essentially useless except as a smoke test. Simplify the test case and correct the showing of the number of RPC calls per second, as well as eliminate the use of erlang:now/0.
2015-06-04Fix add_multi_timer() in inet_drvRory Byrne
Fix the sorting logic in add_multi_timer() and expand the test case coverage around this area.
2015-06-04Fix 6 tests in gen_tcp_misc_SUITERory Byrne
All of the tests are related to gen_tcp:accept/[1,2] and each of them has the same problem: they ignore the return value of the ?EXPECT_ACCEPTS macro.
2015-06-04Merge branch 'egil/cuddle-tests'Björn-Egil Dahlberg
* egil/cuddle-tests: erts: Remove remaining ?line macros in trace_meta_SUITE erts: Relax trace_meta_SUITE:on_and_off_test/1 erts: Remove ?line macro in trace_meta_SUITE:on_and_off_test/1 kernel: Remove remaining ?line macros in gen_tcp_misc_SUITE kernel: Relax gen_tcp_misc_SUITE don't wait for timeout kernel: Relax test gen_tcp_misc_SUITE:wrapping_oct/1
2015-06-04kernel: Remove remaining ?line macros in gen_tcp_misc_SUITEBjörn-Egil Dahlberg
Also, fixup some confusing indentations. This commit only contains whitespace changes and removal of ?line macros.
2015-06-04Update list of funcalls in kernel code_SUITERichard Carlsson
2015-06-02Merge branch 'nybek/fix_gen_tcp_shutdown'Zandra Hird
OTP-12797
2015-05-28kernel: Relax gen_tcp_misc_SUITE don't wait for timeoutBjörn-Egil Dahlberg
It's unnecessary to wait for timeout in some of these testcases. The tests should not check for stray messages while waiting for timeout, that is mostly covered by message order and pattern matching anyway.
2015-05-28kernel: Relax test gen_tcp_misc_SUITE:wrapping_oct/1Björn-Egil Dahlberg
2015-05-28Merge branch 'richcarl/warnings-by-default/OTP-12781'Björn-Egil Dahlberg
* richcarl/warnings-by-default/OTP-12781: stdlib: Use warning channel in test qlc_SUITE:otp_6964/1 stdlib: Fix testcase for qlc_SUITE kernel: Fix code_SUITE with respect to new logger default Map error logger warnings to warning messages by default
2015-05-27kernel: Fix code_SUITE with respect to new logger defaultBjörn-Egil Dahlberg
2015-05-27Eliminate use of erlang:now/0 for generating random numbersBjörn Gustavsson
2015-05-27Eliminate use of erlang:now/0 for measuring timeBjörn Gustavsson
2015-05-26Eliminate use of erlang:now/0 for generating unique node namesBjörn Gustavsson
Use erlang:unique_integer([positive]) when generating unique node names.
2015-05-26Merge branch 'nybek/limit_leading_zeros_in_ipv6_addresses'Henrik Nord
* nybek/limit_leading_zeros_in_ipv6_addresses: Fix parsing of IPv6 addresses to limit leading zeros OTP-12773
2015-05-22Map error logger warnings to warning messages by defaultRichard Carlsson
Also fix and document the broken +We option.
2015-05-22Fix parsing of IPv6 addresses to limit leading zerosRory Byrne
The current implementations of inet:parse_ipv6_address/1 and inet:parse_ipv6strict_address/1 permit address strings which have an unlimited number of leading zeros. Addresses such as: "0000000000000000000000000000000ffff::" "::00000000000000000000000000000000000000000000000000000000" "::0000000f435:1" If we are using this facility to validate string representations of IPv6 addresses, then we would end up validating addresses which are non-conformant (with respect to RFC 4291 section 2.2) and potentially dangerous. This patch ensures that each segment of an IPv6 address has a maximum of 4 hex digits.
2015-05-20Revert "Map error logger warnings to warning messages by default"Zandra Hird
This reverts commit 4c4d7fa40e5fb59854724ce74b8aa3546525cb90. This pr is causing some test failures that were missed at first.
2015-05-18Map error logger warnings to warning messages by defaultRichard Carlsson
Also fix and document the broken +We option.
2015-05-12Fix gen_tcp:shutdown/2 by making it asynchronousRory Byrne
If the driver queue is empty, or the user is requesting a 'read' shutdown, then the shutdown() syscall is performed synchronously, as per the old version of shutdown/2. However, if the user is requesting a 'write' or 'read_write' shutdown, and there is data in the driver queue for the socket, then the shutdown() syscall is delayed and handled asynchronously when the driver queue is written out. This version of shutdown solves a number of issues with the old version. The two main solutions it offers are: * It doesn't block when the TCP peer is idle or slow. This is the expected behaviour when shutdown() is called: the caller needs to be able to continue reading from the socket, not be prevented from doing so. * It doesn't truncate the output. The current version of gen_tcp:shutdown/2 will truncate any outbound data in the driver queue after about 10 seconds if the TCP peer is idle of slow. Worse yet, it doesn't even inform anyone that the data has been truncated: 'ok' is returned to the caller; and a FIN rather than an RST is sent to the TCP peer. For a detailed description of all the problems with the old version of shutdown, please see the EEP Light that was written to justify this patch.
2015-05-11Send format and args on process exit to error_loggerJosé Valim
Previously, the emulator would generate a whole string with values and call the error_logger passing "~s~n". This commit changes it to a format string containing ~p with the respective values as arguments.