summaryrefslogtreecommitdiff
path: root/test/socket/test_socket.rb
AgeCommit message (Collapse)Author
2017-12-12Fix test-all tests to avoid creating report_on_exception warningseregon
* The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-11socket.c: null byte at Socket.getnameinfonobu
* ext/socket/socket.c (sock_s_getnameinfo): check null byte. patched by tommy (Masahiro Tomita) in [ruby-dev:50286]. [Bug #13994] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-10* test/socket/test_socket.rb (test_udp_recvmsg_truncation):odaira
AIX does not set the MSG_TRUNC flag for a message partially read by recvmsg(2) with the MSG_PEEK flag set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-24ignore exception is the address is IPv6naruse
some environments disables IPv6 even if they have IPv6 addresses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-21* test/socket/test_socket.rb (test/socket/test_socket.rb): skip the test ↵ngoto
when Socket::SO_TIMESTAMP is not defined. Fix error on Solaris 10. [Bug #11728] [ruby-dev:49377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-18* test/socket/test_socket.rb (test_udp_recvmsg_truncation): rflags isakr
nil on Solaris 10 which have no HAVE_STRUCT_MSGHDR_MSG_CONTROL. Reported by Naohisa Goto. [ruby-core:71557] [Bug #11709] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-18add tests.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17socket: fix recvmsg without argumentnormal
* ext/socket/ancdata.c (bsock_recvmsg_internal): grow buffer on unspecified maxdatlen [ruby-core:71517] [Bug #11701] * ext/socket/lib/socket.rb (Socket#recvmsg): nil default for dlen (Socket#recvmsg_nonblock): ditto * test/socket/test_socket.rb (test_recvmsg_udp_no_arg): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-14* ext/socket/lib/socket.rb: Specify frozen_string_literal: true.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02use assert_raisenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28* ext/socket/unixsocket.c (rsock_init_unixsock): Open a socketakr
after path length check. This fixes a fd leak by TestSocket_UNIXSocket#test_too_long_path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28test_socket.rb: ignore interface without addressnobu
* test/socket/test_socket.rb (test_udp_server): ignore interface with no address assigned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-27use Socket.getifaddrs to show interface names and so onnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-24test_udp_server don't test IPv6 link-local addresses.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-18Use Etc.uname instead of uname command invocation.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-18* test/socket/test_addrinfo.rb: remove unused variables.hsbt
* test/socket/test_nonblock.rb: ditto. * test/socket/test_socket.rb: ditto. * test/socket/test_unix.rb: ditto. * test/testunit/test_parallel.rb: ditto. * test/webrick/test_filehandler.rb: ditto. * test/xmlrpc/test_features.rb: ditto. * test/zlib/test_zlib.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13* ext/socket/lib/socket.rb: Don't test $! in "ensure" clause becauseakr
it may be set before the body. Reported by ko1 and mrkn. [ruby-core:59088] [Bug #9247] * lib/cgi/core.rb: Ditto. * lib/drb/ssl.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-11* ext/socket: New method, Socket.getifaddrs, implemented.akr
[ruby-core:54777] [Feature #8368] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-09* ext/socket/ancdata.c (bsock_sendmsg_internal): Always setakr
controls_num to raise NotImplementedError appropriately. (bsock_recvmsg_internal): Raise NotImplementedError if :scm_rights=>true is given on platforms which don't have 4.4BSD style control message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-06* ext/socket/rubysocket.h (SockAddrStringValueWithAddrinfo): New macro.akr
(rsock_sockaddr_string_value_with_addrinfo): New declaration. (rsock_addrinfo_inspect_sockaddr): Ditto. (rsock_sys_fail_addrinfo): Ditto. (rsock_sys_fail_sockaddr_or_addrinfo): Ditto. * ext/socket/raddrinfo.c (rsock_addrinfo_inspect_sockaddr): Renamed from addrinfo_inspect_sockaddr and exported. (rsock_sockaddr_string_value_with_addrinfo): New function to obtain string and possibly addrinfo object. * ext/socket/socket.c (rsock_sys_fail_sockaddr): Don't use rsock_sys_fail_host_port which is IP dependent. Invoke rsock_sys_fail_addrinfo. (rsock_sys_fail_addrinfo): New function using rsock_addrinfo_inspect_sockaddr. (rsock_sys_fail_addrinfo_or_sockaddr): New function. (sock_connect): Use SockAddrStringValueWithAddrinfo and rsock_sys_fail_addrinfo_or_sockaddr. (sock_connect_nonblock): Ditto. (sock_bind): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-06* ext/socket: Improve socket exception message to show socket address.akr
[ruby-core:45617] [Feature #6583] proposed Eric Hodel. * ext/socket/rubysocket.h (rsock_sys_fail_host_port): Declared. (rsock_sys_fail_path): Ditto. (rsock_sys_fail_sockaddr): Ditto. * ext/socket/udpsocket.c (udp_connect): Use rsock_sys_fail_host_port. (udp_bind): Ditto. (udp_send): Ditto. * ext/socket/init.c (rsock_init_sock): Specify a string for rb_sys_fail argument. (make_fd_nonblock): Ditto. (rsock_s_accept): Ditto. * ext/socket/ipsocket.c (init_inetsock_internal): Use rsock_sys_fail_host_port. * ext/socket/socket.c (rsock_sys_fail_host_port): Defined. (rsock_sys_fail_path): Ditto. (rsock_sys_fail_sockaddr): Ditto. (setup_domain_and_type): Use rsock_sys_fail_sockaddr. (sock_connect_nonblock): Ditto. (sock_bind): Ditto. (sock_gethostname): Specify a string for rb_sys_fail argument. (socket_s_ip_address_list): Ditto. * ext/socket/basicsocket.c (bsock_shutdown): Specify a string for rb_sys_fail argument. (bsock_setsockopt): Use rsock_sys_fail_path. (bsock_getsockopt): Ditto. (bsock_getpeereid): Refine the argument for rb_sys_fail. * ext/socket/unixsocket.c (rsock_init_unixsock): Use rsock_sys_fail_path. (unix_path): Ditto. (unix_send_io): Ditto. (unix_recv_io): Ditto. (unix_addr): Ditto. (unix_peeraddr): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-26Revert "Darwin 12 (OS X Mountain Lion) also has Bug #6692"naruse
This reverts commit r37033. darwin12 seems to use an address started with fe80. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-26Darwin 12 (OS X Mountain Lion) also has Bug #6692naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24Show nd6 options and whether the packet is reached to the server or not.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24Add version check for darwin's bug.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20* test/socket/test_socket.rb: Ignore IPv6 unique local addresses on OSdrbrain
X (iCloud Back to my Mac addresses) for test_udp_socket since they do not act as loopback addresses. [Bug #6692] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-14Check IFDISABLED on Mac OS X.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10fix the path of ifconfig.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10skip addresses whose interface is set as POINTOPOINT.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-10Skip IPv6 addresses whose interface is set as IFDISABLED.naruse
FreeBSD 9.0 with default setting (ipv6_activate_all_interfaces is not YES) sets IFDISABLED to interfaces which don't have global IPv6 address. Link-local IPv6 addresses on those interfaces don't work. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-07Cent OS 5.6 (2.6.18-238.19.1.el5xen) doesn't correctly worknaruse
sendmsg with pktinfo for link-local ipv6 addresses git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03add test for close-on-exec.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03close a socket in test_socket_new.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13* test/socket/test_socket.rb (test_connect_timeout): added a testakr
based on a patch by Eric Wong. [ruby-core:38910] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12* thread.c (rb_thread_io_blocking_region): new function to runnobu
blocking region with GIL released, for fd. * thread.c (rb_thread_fd_close): implement. [ruby-core:35203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01* test/socket/test_addrinfo.rb: extract Errno::EADDRINUSE as a method.akr
* test/socket/test_socket.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-24refine an assertion message.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-23* ext/socket/raddrinfo.c (ruby_getaddrinfo__darwin): new workaround forakr
getaddrinfo problem on Mac OS X Snow Leopard. [ruby-core:29427] patch by Wataru Kimura. [ruby-core:30842] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-14* test/socket/test_socket.rb (test_udp_server): rescue Errno::ENOSYSakr
for Windows. * test/socket/test_nonblock.rb (test_sendmsg_nonblock_error): ditto. [ruby-dev:41597] reported by Masaya Tarui. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-23call unix_server.close only if unix_server is not nil.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19* test_socket.rb (test_udp_server): cannot check the existance of sendmsg byusa
respond_to?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17fix skip condition.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-17 * ext/socket/socket.c (socket_s_ip_address_list): drop inactiveusa
adapters. * test/socket/test_{nonblock,addrinfo,socket}.rb: skip some tests on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01* include/ruby/intern.h (rb_time_num_new): declared.akr
* time.c (nsec2timev): extracted from time_new_internal. (time_new_internal): change argument to VALUE. (rb_time_new): follow the argument change. (rb_time_nano_new): ditto. (rb_time_num_new): new function. * ext/socket/ancdata.c (ancillary_timestamp): use rb_time_num_new to represent struct bintime preciously. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-18don't use /tmp as example socket path.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-14assert connects doesn't raise.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-02* ext/socket/ancdata.c (rsock_discard_cmsg_resource): definedakr
unconditionally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27add a test.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-26* ext/socket/lib/socket.rb (BasicSocket#connect_address): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25* ext/socket/option.c (sockopt_level): extracted from sockopt_level_m.akr
(sockopt_optname): extracted from sockopt_optname_m. (sockopt_data): apply StringValue. (sockopt_s_linger): new method. (sockopt_linger): new method. (inspect_linger): show onoff value if it is neither 0 nor 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e