aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
AgeCommit message (Collapse)Author
2018-10-05[socket-nif|test] Two more test cases (tcp) reworkedMicael Karlberg
Two (tcp) test cases where reworked using the command evaluator. OTP-14831
2018-10-05Adjust test case to realityRaimo Niskanen
2018-10-05[socket-nif|test] Two more test cases (udp) reworkedMicael Karlberg
Two test cases where reworked using the command evaluator. OTP-14831
2018-10-04[socket-nif|test] begin rework socket suiteMicael Karlberg
Begin rework socket test suite using a command evaluator. OTP-14831
2018-10-04Merge branch 'bmk/20181004/nififying_inet_freebsd_fixes/OTP-14831' into ↵Micael Karlberg
bmk/20180918/nififying_inet/OTP-14831
2018-10-04[socket-nif|test] Add controlling_process test caseMicael Karlberg
Added a test case that specifically tested setting the controlling_process. Also, ensure that invalid updates of controlling-process (not owner) actually fails. OTP-14831
2018-10-04make sure a set ERL_LIBS does not interfere with testsHenrik Nord
2018-10-04[socket-nif|test] Updated test case for connect timeoutMicael Karlberg
The connect timeout test case uses the listen backlog argument to test connect timeout (its set to 1). The idea is that when the server backlog is full, it should not reply. The client attempting to connect will then get a timeout. But as it turns out, this behaviour is not "set in stone". On FreeBSD 11.2, the result is instead a 'econnreset'. It should also be noted that this local connections. That is, both end of the connection is on the same machine. So, test case has been updated to also accept a econnreset (even though that is not what it is testing). OTP-14831
2018-10-03[logger] Add handler callback filter_config/1Siri Hansen
This function is called when a logger API function for fetching handler configuration is called. The point is to allow the handler to remove internal data fields that it might have stored in the configuration database, before returning the handler configuration to the caller. An example of such internal data are the 'handler_pid' and 'mode_tab' fields that logger_std_h and logger_disk_log_h store in their configuration maps.
2018-10-03[logger] Start using handler callback changing_config/3 in built-in handlersSiri Hansen
The new parameter to this function, SetOrUpdate, indicates how unspecified configuration data fields shall be set. The rule is that if SetOrUpdate equals set, then default values shall be used, and if SetOrUpdate equals update, then existing configuration values shall be used. Consequently, these examples now apply to logger_std_h and logger_disk_log_h: set_handler_config(default, config, #{sync_mode_qlen => 20}) sets the value of sync_mode_qlen to 20, and resets all other (writable) fields in the config map to their default values. update_handler_config(default, config, #{sync_mode_qlen => 20}) sets the value of sync_mode_qlen to 20, and leaves all other fields in the config map unchanged.
2018-10-01Merge branch 'richcarl/erts/erl_init-cleanup/OTP-15336'Lukas Larsson
* richcarl/erts/erl_init-cleanup/OTP-15336: sasl: Order systools_make:preloaded modules alphabetically Update preloaded modules Move calling on_load for preloaded modules to erl_init Make erl_init.c pass the boot module to erl_init.beam Remove obsolete comment text Remove undocumented and unused -# display_items emulator option Remove broken and undocumented boot function emulator option Replace remaining references to otp_ring0 with erl_init Drop otp_ring0, using erl_init instead Update preloaded modules Add erl_init module Conflicts: erts/emulator/beam/erl_init.c erts/preloaded/ebin/erl_prim_loader.beam erts/preloaded/ebin/erl_tracer.beam erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_code_purger.beam erts/preloaded/ebin/erts_dirty_process_signal_handler.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/erts_literal_area_collector.beam erts/preloaded/ebin/init.beam erts/preloaded/ebin/otp_ring0.beam erts/preloaded/ebin/prim_buffer.beam erts/preloaded/ebin/prim_eval.beam erts/preloaded/ebin/prim_file.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/ebin/prim_zip.beam erts/preloaded/ebin/zlib.beam
2018-10-01Fix bug for sockopt pktoptions on BSDRaimo Niskanen
The macros for the BSD style option names had accidentally wound up outside the option parsing loop, causing unclear behaviour and Valgrind errors.
2018-09-28[socket-nif] Add support for socket (level otp) buffer optionsMicael Karlberg
Add support for otp level socket options rcvbuf, rcvctrlbuf and sndctrlbuf. These options define default sizes for these buffers. The 'rcvbuf' is used when receiving messages when calling the recv, recvfrom and recvmsg functions. The 'rcvctrlbuf' is used for the control message header info when calling the recvmsg function. The 'sndctrlbuf' is used for the control message header info when calling the sendmsg function. OTP-14831
2018-09-27[socket-nif|test] Test case groupingMicael Karlberg
The test cases has been slighly regrouped. The to-group has moved into the api-group. OTP-14831
2018-09-27[socket-nif|test] Add operation timeout test casesMicael Karlberg
Add a number of *basic* operation (connect, accept, send and recv). All of which are not yet implemented (skipped with 'not-yet-implemented'). All of these are basic and only local (both sides on the same host). OTP-14831
2018-09-27[socket-nif] Add proper recv timeout handlingMicael Karlberg
Added proper recv timeout handling. Made use of the enif_select(mode = cancel) feature. Each time a timeout expires, the "active" recv (the surrent reader select) has to be cancelled. Not yet tested...something for the new test suite... Also, added support for getopt(controlling_pprocess) that, for some reason, was not yet implemented. OTP-14831
2018-09-27[socket-nif|test] Add first preliminary socket test suiteMicael Karlberg
Add a proper but very basic test suite. The only (6) test cases now are very basic (open-close and send-receive). OTP-14831
2018-09-20[socket-nif] Add proper send timeout handlingMicael Karlberg
Added proper send timeout handling. Made use of the enif_select(mode = cancel) feature. Each time a timeout expires, the "active" send (the surrent write select) has to be cancelled. OTP-14831
2018-09-19[socket-nif] Add proper connect and accept timeout handlingMicael Karlberg
Added proper connect and accept timeout handling. Made use of the enif_select(mode = cancel) feature. Each time a timeout expires, the previous operation (connect or accept) has to be cancelled (actually its the select operation that has to be cancelled). Only partial implementation of cancel for now (connect and accept). More to follow... OTP-14831
2018-09-19Merge branch 'maint'Raimo Niskanen
2018-09-19Merge branch 'raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145' into maintRaimo Niskanen
* raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145: Elaborate the disclaimer for 'pktoptions' Improve platform filter Fix endianness bug for CMSG parsing
2018-09-19Improve platform filterRaimo Niskanen
2018-09-18[socket-nif] Added (more) tests for [recv|send]msgMicael Karlberg
Added some more tests for sendmsg (with cmsghdr). OTP-14831
2018-09-18[socket-nif] Add more data types (with doc) and (C) debugMicael Karlberg
Add more debug printouts for the new sendmsg. Also added new (erlang) types with doc. OTP-14831
2018-09-18[socket-nif] Add preliminary support for sendmsgMicael Karlberg
Added function sendmsg/2,3,4. Actually worked on the first try. Something must be wrong... Still no supported cmsghdr's (only support headers where the data part is already a binary, which therefor does not require any processing). So if the cmsghdrs actually work is unclear. OTP-14831
2018-09-18[socket-nif] Processing of more cmsg headersMicael Karlberg
Added processing or more cmsg headers (for more options). Now (also) supports: socket:timestamp. Also various fixes and cleanups. For some reason calling getopt(Sock, 0, {13, int}) (or similar) fails with badarg even though the nif-function (nif_getopt) actually returns a valid value (for instance: {ok, 0}). OTP-14831
2018-09-18[socket-nif] Add more control message decodingMicael Karlberg
Added decoding of the "known" control message options: pktinfo, recvtos, recvttl and recvorigdstaddr). OTP-14831
2018-09-18[socket-nif] Debugged and stuffMicael Karlberg
It seems to work, with atleast some of the cmsg options. More testing needed... OTP-14831
2018-09-18[socket-nif] Add support for socket (level ip) option sendsrcaddrMicael Karlberg
Added support for ip level socket option SENDSRCADDR. This option requires sendmsg to actually use, so we cannot test this fully at the moment. OTP-14831
2018-09-18[socket-nif] Add support for socket (level ip) option recvorigdstaddrMicael Karlberg
Added support for ip level socket option RECVORIGDSTADDR. This option requires recvmsg to actually use, so we cannot test this fully at the moment (although both set and get works). OTP-14831
2018-09-18[socket-nif] Add support for socket (level ip) option retoptsMicael Karlberg
Added support for ip level socket option RETOPTS. OTP-14831
2018-09-18[socket-nif] Add support for socket (level ip) option transparentMicael Karlberg
Added support for ip level socket option TRANSPARENT. OTP-14831
2018-09-18[socket-nif] Add support for socket (level ip) option pktinfoMicael Karlberg
Added support for ip level socket option PKTINFO. This option requires sendmsg and/or recvmsg to actually use, so we cannot test this fully at the moment (although both set and get works). OTP-14831
2018-09-18[socket-nif] Add support for socket (level ipv6) option recverrMicael Karlberg
Added support for the IPv6 socket option RECVERR. To actually make use of this option, we need the recvmsg function, which we don't have yet. Baby steps. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ip) option recverrMicael Karlberg
Added support for the IP socket option RECVERR. To actually make use of this option, we need the recvmsg function, which we don't have yet. Baby steps. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option router_alertMicael Karlberg
Added support for the IPv6 socket option ROUTER_ALERT. Only supported for raw sockets. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option unicast_hopsMicael Karlberg
Added support for the IPv6 socket option UNICAST_HOPS. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option flowinfoMicael Karlberg
Added support for the IPv6 socket option(s) FLOWINFO. The option returns with einval when calling setsockopt, so either you need to be a privileged user to update, or its not actually possible to update this option (even though it says nothing about that in the man page. It only talks about set). This is the same behaviour as with DSTOPTS. Needs furher checking. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option dstoptsMicael Karlberg
Added support for the IPv6 socket option(s) DSTOPTS. The option returns with einval when calling setsockopt, so either you need to be a privileged user to update, or its not actually possible to update this option (even though it says nothing about that in the man page. It only talks about set). This is the same behaviour as with RTHDR and HOPLIMIT. On FreeBSD, it says that HOPOPTS requires superuser privileges. Needs furher checking. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option authhdr & hopoptsMicael Karlberg
Added support for the IPv6 socket option(s) AUTHHDR and HOPOPTS. Its possible that the option is AUTHHDR is obsolete. It says so in the include files and when trying to get it (getsockopt) it returns with enoprotoopt. The option HOPOPTS returns with einval when calling setsockopt, so either you need to be a privileged user to update, or its not actually possible to update this option (even though it says nothing about that in the man page. It only talks about set). This is the same behaviour as with RTHDR and HOPLIMIT. On FreeBSD, it says that HOPOPTS requires superuser privileges. Needs furher checking. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option rthdrMicael Karlberg
Added support for the IPv6 socket option RTHDR. On FreeBSD this option requires superuser privileges to update. There is no mention of this on linux, but its still not possible to update (einval), so I assume that its the same there. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option recvpktinfoMicael Karlberg
Added support for the IPv6 socket option RECVPKTINFO. This option is called PKTINFO on FreeBSD, so that value will also be accepted. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option multicast_loopMicael Karlberg
Added support for the IPv6 socket option MULTICAST_LOOP. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option multicast_ifMicael Karlberg
Added support for the IPv6 socket option MULTICAST_IF. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ipv6) option multicast_hopsMicael Karlberg
Added support for the IPv6 socket option MULTICAST_HOPS. OTP-14831.
2018-09-18[socket-nif] Add support for socket (level ip) option recvoptsMicael Karlberg
Added support for ip level socket option RECVOPTS. OTP-14831
2018-09-18[socket-nif] Add support for socket (level ip) option freebindMicael Karlberg
Added support for ip level socket option FREEBIND. Note that there is an option available on FreeBSD called IP_BINDANY, which seems to have similar properties (FREEBIND is *not* available on FreeBSD). There are some restrictions for this option though (which is not mentioned in the Linux man page). OTP-14831
2018-09-18[socket-nif] Add support for socket (level socket) option timestampMicael Karlberg
Added support for socket level socket option TIMESTAMP. OTP-14831
2018-09-18[socket-nif] Add support for socket (level socket) option(s) [rcv|snd]lowatMicael Karlberg
Added support for socket level socket option RCVLOWAT and SNDLOWAT. These are both a little strange, at least on Linux. See the man pages for more info. For instance, sndlowat cannot be set on Linux. OTP-14831
2018-09-18[socket-nif] Add support for socket (level socket) option(s) [rcv|snd]timeoMicael Karlberg
Added support for socket level socket option RCVTIMEO and SNDTIMEO. These are both a little strange, at least on linux. See the man pages for more info. OTP-14831