aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/gen_tcp_misc_SUITE.erl
AgeCommit message (Collapse)Author
2016-08-25Replace usage of deprecated time unitsRickard Green
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-03-23gen_tcp_misc_SUITE: Clean up send_timeout{_active}/1Björn Gustavsson
Eliminate gratuitous use of funs. Don't limit the send attempts to 1000; it might not be enough. Rely on four minut timetrap to fail the test case if there will never be a send timeout error.
2016-03-23Clean up the determination of the hostnameBjörn Gustavsson
2016-03-15update copyright-yearHenrik Nord
2016-03-10Fix commentsBjörn Gustavsson
Remove out-commented code. Make sure that comments that are not at the end of a line starts with two '%' characters and not just one. That will become important later when we'll remove all ?line macros and ask Emacs to re-indent the files.
2016-03-10gen_tcp_misc_SUITE: Use unique node namesBjörn Gustavsson
Use unique node names to ensure that one failed test case will not cause other test cases to fail if a slave node was left.
2016-03-10Eliminate use of doc and suite clausesBjörn Gustavsson
Those clause are obsolete and never used by common_test.
2016-03-10Eliminate use of test_server:sleep/1Björn Gustavsson
2016-03-09Eliminate use of test_server:fail/0,1Björn Gustavsson
2016-03-09Modernize timetrapsBjörn Gustavsson
2016-02-17Eliminate use of test_server.hrl and test_server_line.hrlBjörn Gustavsson
As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl.
2015-07-10ose: Remove all code related to the OSE portLukas Larsson
The OSE port is no longer supported and this commit removed it and any changes related to it. The things that were general improvements have been left in the code.
2015-06-18Change license text to APLv2Bruce Yinhe
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 '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-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-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-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-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-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-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
2014-08-25Fix misspellings of 'another'Tuncer Ayaz
2014-03-28kernel: tweak testsDan Gudmundsson
heart tests decrease atom table size so node crashes faster Fix timetrap and sync
2014-03-26ose: Implement tcp inet driver for OSELukas Larsson
The inet driver for OSE has to handle signals instead of selects and thus the wrappers for ready_input/output are a little bit different. However the majority of the inet code remains the same.
2013-09-23add {active,N} socket option for TCP, UDP, and SCTPSteve Vinoski
Add the {active,N} socket option, where N is an integer in the range -32768..32767, to allow a caller to specify the number of data messages to be delivered to the controlling process. Once the socket's delivered message count either reaches 0 or is explicitly set to 0 with inet:setopts/2 or by including {active,0} as an option when the socket is created, the socket transitions to passive ({active, false}) mode and the socket's controlling process receives a message to inform it of the transition. TCP sockets receive {tcp_passive,Socket}, UDP sockets receive {udp_passive,Socket} and SCTP sockets receive {sctp_passive,Socket}. The socket's delivered message counter defaults to 0, but it can be set using {active,N} via any gen_tcp, gen_udp, or gen_sctp function that takes socket options as arguments, or via inet:setopts/2. New N values are added to the socket's current counter value, and negative numbers can be used to reduce the counter value. Specifying a number that would cause the socket's counter value to go above 32767 causes an einval error. If a negative number is specified such that the counter value would become negative, the socket's counter value is set to 0 and the socket transitions to passive mode. If the counter value is already 0 and inet:setopts(Socket, [{active,0}]) is specified, the counter value remains at 0 but the appropriate passive mode transition message is generated for the socket. This commit contains a modified preloaded prim_inet.beam due to changes in prim_inet.erl. Add tests for {active,N} mode for TCP, UDP, and SCTP sockets. Add documentation for {active,N} mode for inet, gen_tcp, gen_udp, and gen_sctp.
2013-06-12Update copyright yearsBjörn-Egil Dahlberg
2013-03-14Set max ports for slave nodeLukas Larsson
2013-02-25Update to work with new default windows max portsLukas Larsson
2013-01-23Add testcase for oct countersPatrik Nyblom
2013-01-21Isolate iter_max_socks to own nodeLukas Larsson
This prevents this testcase from ruining the entire testrun if it should fail critically.
2012-07-19kernel: Remove VxWorks from testsBjörn-Egil Dahlberg
2012-05-23Merge branch 'lukas/kernel/fix-gen_udp_tcp-leak/OTP-10094' into maintLukas Larsson
* lukas/kernel/fix-gen_udp_tcp-leak/OTP-10094: Add testcase for controlling_process(P,self()) Fix port leaking after controlling_process(Port, self())
2012-05-04Remove race in gen_tcp_misc_SUITE:otp_9389Patrik Nyblom
2012-04-10Add testcase for controlling_process(P,self())Lukas Larsson
2012-03-30Update copyright yearsBjörn-Egil Dahlberg
2012-01-04Fix returned error from gen_tcp:accept/1,2 when running out of portsPer Hedeland
The {error, enfile} return value is badly misleading and confusing for this case, since the Posix ENFILE errno value has a well-defined meaning that has nothing to do with Erlang ports. The fix changes the return value to {error, system_limit}, which is consistent with e.g. various file(3) functions. inet:format_error/1 has also been updated to support system_limit in the same manner as file:format_error/1.
2011-12-08Add explanatory text for tc failureLukas Larsson
2011-12-05honor packet_size for http packet parsing to fix OTP-9389Steve Vinoski
Allow applications to use a packet_size setting on a socket to control acceptable HTTP header line length. This gives them the ability to accept HTTP headers larger than the default settings allow, but also lets them avoid DOS attacks by accepting header lines only up to whatever length they wish to allow. Without this change, if an HTTP request/response line or header arrives on a socket in http, http_bin, httph, or httph_bin parsing mode, and the request/response line or header is too long to fit into a default inet_drv buffer of 1460 bytes, an unexpected error occurs. These problems were described and discussed on erlang-questions in June 2011 in this thread: http://erlang.org/pipermail/erlang-questions/2011-June/059563.html In the original code, no buffer reallocation occurs to enlarge the buffer, even if packet_size or line_length are set in a way that should allow the HTTP data to be parsed properly. The only available workaround was to collect headers and parse them using erlang:decode_packet, but that approach has drawbacks such as having to collect all HTTP header data before it can be handed to decode_packet for correct parsing, and also requiring each and every Erlang web server developer/maintainer to add the workaround to his or her web server. Change the packet parser to honor the packet_size setting for HTTP parsing. If packet_size is set, and an HTTP request/response or header line exceeds the default 1460 byte TCP buffer limit, return an indication to tcp_remain that it should realloc the buffer to enlarge it to packet_size. Also fix the HTTP parsing code to properly honor line_length by truncating any HTTP request/response or header lines that exceed that setting. For backward compatibility, default behavior is unchanged; if an application wants to be able to accept long HTTP header lines, it must set packet_size to an appropriate value. Buffer reallocation occurs only when needed, so the original default buffer size in the code is still the default. Make the line mode parsing honor packet_size as well, for consistency. Add new regression tests to the emulator decode_packet suite and also to the kernel gen_tcp_misc suite. The documentation for packet_size in inet:setopts/2 is already sufficient. Many thanks to Sverker Eriksson for his guidance on how to best fix this bug and also for reviewing a number of patch attempts prior to this one.
2011-03-21Add testcasePatrik Nyblom
2011-03-11Update copyright yearsBjörn-Egil Dahlberg
2011-02-17Rename Suite Callback to Common Test HookLukas Larsson
2011-02-17Fix formatting for kernelLukas Larsson
2011-02-17Add init_per_suite and end_per_suiteLukas Larsson
2011-02-17Add ts_install_scb to suite/0Lukas Larsson