summaryrefslogtreecommitdiff
path: root/test/net
AgeCommit message (Collapse)Author
2021-05-27Promote net-smtp to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote net-pop to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote net-imap to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-27Promote net-ftp to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
2021-05-06[ruby/net-http] Do not require stringioKazuki Yamaguchi
It is not used in net/http library code since commit 15ccd0118c13 (r36473 in ruby svn trunk, 2012). require's in test suite are also cleaned up. https://github.com/ruby/net-http/commit/996d18a43f
2021-05-06[ruby/net-imap] Move UTF7 & datetime formatting to net/imap/data_encodingnicholas a. evans
Partially implements #10. https://github.com/ruby/net-imap/commit/0d43c5e856
2021-05-06[ruby/net-imap] Update AUTH=PLAIN to be a little closer to RFC4616nicholas a. evans
* Add authzid support * must not contain NULL chars * improve rdoc https://github.com/ruby/net-imap/commit/a587fc71b7
2021-05-05test/net/ftp/test_ftp.rb - fix intermittent MinGW failureMSP-Greg
Fixes intermittent error as below: [242/838] 5316=test_ftp #<Thread:0x0000020aa8733f20 D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:2532 run> terminated with exception (report_on_exception is true): D:/a/ruby/ruby/src/tool/lib/minitest/unit.rb:199:in `assert': Expected #<Errno::ECONNRESET: An existing connection was forcibly closed by the remote host.> to be nil. (MiniTest::Assertion) from D:/a/ruby/ruby/src/tool/lib/test/unit/core_assertions.rb:504:in `assert' from D:/a/ruby/ruby/src/tool/lib/minitest/unit.rb:299:in `assert_nil' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:430:in `ensure in block in test_list_read_timeout_exceeded' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:431:in `block in test_list_read_timeout_exceeded' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:2539:in `block in create_ftp_server' D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:426:in `write': An existing connection was forcibly closed by the remote host. (Errno::ECONNRESET) from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:426:in `print' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:426:in `block (2 levels) in test_list_read_timeout_exceeded' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:420:in `each' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:420:in `each_with_index' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:420:in `block in test_list_read_timeout_exceeded' from D:/a/ruby/ruby/src/test/net/ftp/test_ftp.rb:2539:in `block in create_ftp_server' Notes: Merged: https://github.com/ruby/ruby/pull/4449
2021-05-04test/net/imap/test_imap.rb: wait a moment before socket is closedYusuke Endoh
to try to suppress a failure on Solaris. This is the same as 19504d115dc09558255fcb5213f80dd8454ab189 http://rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20210504T070007Z.fail.html.gz ``` 1) Error: IMAPTest#test_idle_done_not_during_idle: Errno::EINVAL: Invalid argument - connect(2) for [::1]:33839 /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:1214:in `__connect_nonblock' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:1214:in `connect_nonblock' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:56:in `connect_internal' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:137:in `connect' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:642:in `block in tcp' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:227:in `each' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:227:in `foreach' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/.ext/common/socket.rb:632:in `tcp' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/lib/net/imap.rb:1223:in `tcp_socket' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/lib/net/imap.rb:1180:in `initialize' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/test/net/imap/test_imap.rb:289:in `new' /export/home/chkbuild/chkbuild-sunc/tmp/build/20210504T070007Z/ruby/test/net/imap/test_imap.rb:289:in `test_idle_done_not_during_idle' ```
2021-05-04Fix test/net/http/test_https.rb host naming for WindowsMSP-Greg
Notes: Merged: https://github.com/ruby/ruby/pull/4424
2021-05-04Workaround failures on WindowsNobuyoshi Nakada
2021-04-30test/net/smtp/test_smtp.rb: wait a moment before socket is closedYusuke Endoh
On Solaris, Socket.tcp seems to fail with EINVAL if the server closes the connection immediately after accpeted. I think this is a bug of Socket.tcp, but seems difficult to fix soon. http://rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20210429T100007Z.fail.html.gz ``` 1) Failure: Net::TestSMTP#test_eof_error_backtrace [/export/home/chkbuild/chkbuild-sunc/tmp/build/20210429T100007Z/ruby/test/net/smtp/test_smtp.rb:193]: [ruby-core:78550] [Bug #13018]. [EOFError] exception expected, not #<Net::ReadTimeout: Net::ReadTimeout>. ```
2021-04-28[ruby/net-http] Decode user and password from env configured proxyLukas Eipert
If someone sets an env variable defining a http_proxy, containing a username / password with percent-encoded characters, then the resulting base64 encoded auth header will be wrong. For example, suppose a username is `Y\X` and the password is `R%S] ?X`. Properly URL encoded the proxy url would be: http://Y%5CX:R%25S%5D%20%3FX@proxy.example:8000 The resulting proxy auth header should be: `WVxYOlIlU10gP1g=`, but the getters defined by ruby StdLib `URI` return a username `Y%5CX` and password `R%25S%5D%20%3FX`, resulting in `WSU1Q1g6UiUyNVMlNUQlMjAlM0ZY`. As a result the proxy will deny the request. Please note that this is my first contribution to the ruby ecosystem, to standard lib especially and I am not a ruby developer. References: - https://gitlab.com/gitlab-org/gitlab/-/issues/289836 - https://bugs.ruby-lang.org/projects/ruby-master/repository/trunk/revisions/58461 - https://bugs.ruby-lang.org/issues/17542 https://github.com/ruby/net-http/commit/e57d4f38aa
2021-04-28test/net/ftp/test_ftp.rb: Use RubyVM::JIT instead of RubyVM::MJITYusuke Endoh
2021-04-28test/net/ftp/test_ftp.rb: reduce the size of a long responseYusuke Endoh
"9" * 999999999 (about 1 GB) was too large for some CI servers. This commit changes the size to 999999 (about 1 MB). http://rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20210427T141707Z.fail.html.gz http://rubyci.s3.amazonaws.com/raspbian10-aarch64/ruby-master/log/20210427T145408Z.fail.html.gz
2021-04-28test/net/ftp/test_ftp.rb: remove unused variableYusuke Endoh
2021-04-27[ruby/net-ftp] Add test casesShugo Maeda
https://github.com/ruby/net-ftp/commit/865232bb2a
2021-04-27[ruby/net-ftp] Reduce resource cosumption of Net::FTP::TIME_PARSERShugo Maeda
Reported by Alexandr Savca as a DoS vulnerability, but Net::FTP is a client library and the impact of the issue is low, so I have decided to fix it as a normal issue. Based on patch by nobu. https://github.com/ruby/net-ftp/commit/a93af636f8
2021-04-27[ruby/net-ftp] Close the passive connection data socket if there is an error ↵Jeremy Evans
setting up the transfer Previously, the connection leaked in this case. This uses begin/ensure and checking for an error in the ensure block. An alternative approach would be to not even perform the connection until after the RETR (or other) command has been sent. However, I'm not sure all FTP servers support that. The current behavior is: * Send (PASV/EPSV) * Connect to the host/port returned in 227/229 reply * Send (RETR/other command) Changing it to connect after the RETR could break things. FTP servers might expect that the client has already connected before sending the RETR. The alternative approach is more likely to introduce backwards compatibility issues, compared to the begin/ensure approach taken here. Fixes Ruby Bug 17027 https://github.com/ruby/net-ftp/commit/6e8535f076
2021-04-27[ruby/net-ftp] Re-apply 827e471d438fdec1ae329afb5912b8e06d534823Hiroshi SHIBATA
https://github.com/ruby/net-ftp/commit/3ca80368c4
2021-04-22Merge net-imap-0.2.0Hiroshi SHIBATA
2021-01-23Fix a warningKazuhiro NISHIYAMA
``` .../ruby/test/net/http/test_httpresponse.rb:81: warning: constant RubyVM::MJIT is deprecated ```
2021-01-21[ruby/net-http] RubyVM::MJIT is deprecated, prefer RubyVM::JIT nowNobuyoshi Nakada
https://github.com/ruby/net-http/commit/abc6ea1877
2021-01-13Rename RubyVM::MJIT to RubyVM::JITTakashi Kokubun
because the name "MJIT" is an internal code name, it's inconsistent with --jit while they are related to each other, and I want to discourage future JIT implementation-specific (e.g. MJIT-specific) APIs by this rename. [Feature #17490]
2020-12-29Try increasing SMTP's read_timeout for --jit-waitTakashi Kokubun
for random hangs like: http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302796 http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302188 http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3301293
2020-12-13Wait testing/helper threads to terminateNobuyoshi Nakada
2020-12-04Guard all accesses to RubyVM::MJIT with defined?(RubyVM::MJIT) &&Benoit Daloze
* Otherwise those tests, etc cannot run on alternative Ruby implementations.
2020-11-18test/net/smtp - use TCPSocket when UNIXSocket unavailableMSP-Greg
Notes: Merged: https://github.com/ruby/ruby/pull/3778
2020-11-17Skip tests related TLS with Windows platform.Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3776
2020-11-17Import net-smtp-0.2.0 from https://github.com/ruby/net-smtpHiroshi SHIBATA
2020-09-26test/net/smtp/test_smtp.rb: Stop io leaksYusuke Endoh
`make test-all` was very noisy by warnings like ``` Leaked file descriptor: Net::TestSMTP#test_start_with_position_argument: 6 : #<TCPSocket:fd 6, AF_INET, 127.0.0.1, 43770> ```
2020-09-24test/net/http/test_https.rb: The test logic was buggyYusuke Endoh
The expected certs must be `[CA_CERT, SERVER_CERT]` before 1.1.1g and `[SERVER_CERT]` after 1.1.1h.
2020-09-24test/net/http/test_https.rb: the order of verify_callback seems to varyYusuke Endoh
... depending upon the environment.
2020-09-24test/net/http/test_https.rb: Stop the error due to openssl 1.1.1hYusuke Endoh
On some environments that uses OpenSSL 1.1.1h, the two tests now fail. http://rubyci.s3.amazonaws.com/android29-x86_64/ruby-master/log/20200924T062352Z.fail.html.gz https://github.com/ruby/ruby/runs/1159288773?check_suite_focus=true ``` 1) Failure: TestNetHTTPS#test_get [/data/data/com.termux/files/home/cb/tmp/build/20200924T062352Z/ruby/test/net/http/test_https.rb:47]: <"0\x82\x03\xED0\x82\x02\xD5\xA0\x03..."> expected but was <"0\x82\x03\xE30\x82\x02\xCB\xA0\x03...">. ``` Not sure why, but verify_callback now seems to receive only SERVER_CERT but not CA_CERT. It would be good to investigate the issue furthermore, but tentatively, I want to stop the failures.
2020-09-14[ruby/net-smtp] Net::SMTP.start arguments are keyword argumentsTOMITA Masahiro
The helo argument is not important, but the helo argument must be specified to specify the user and secret arguments. If helo, user, secret, and authtype arguments are keyword arguments, it is not necessary to specify the helo argument. https://github.com/ruby/net-smtp/commit/269774deac
2020-09-14[ruby/net-smtp] TLS should not check the host name by default.TOMITA Masahiro
In tlsconnect(), the host name is checked when @ssl_context.verify_mode is not OpenSSL::SSL::VERIFY_NONE, but the verify_mode of @ssl_context generated by default is nil. https://github.com/ruby/net-smtp/commit/bde75a15b5
2020-08-03[ruby/net-http] Fix SSL session reuse test with LibreSSL 3.2+Jeremy Evans
https://github.com/ruby/net-http/commit/5ae9620fbc
2020-08-03[ruby/net-http] Switch invalid server name formatJeremy Evans
invalid_servername is not a valid name in an SSL request due to the use of the underscore, and LibreSSL 3.2.0 will raise an exception for this. These tests are not testing the allowed characters in the server name, but how net/http handles cases where the server name provided does not match the IP address you are trying to connect to, so I think it's better to just modify the tests to use a correct format. While here, fix a typo in a test name, and use better code in the ensure block so the same test doesn't issue both a failure and an error. https://github.com/ruby/net-http/commit/0e8dc91120
2020-06-22Skip test_read_body_block_mod for --jit-waitTakashi Kokubun
2020-06-21Try increasing read_timeout a little moreTakashi Kokubun
It failed again http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3018488
2020-06-21Increase read_timeout for --jit-waitTakashi Kokubun
This tries to fix a random failure like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3017837
2020-06-21Increase read timeout of FTP tests with --jit-waitTakashi Kokubun
Trying to eliminate some newer random failures http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3016543
2020-06-14Try using longer read_timeout for --jit-waitTakashi Kokubun
failure on TestFTP. When we skip a test, the place to hang (long wait for compilation) just moves to another test and it doesn't seem to finish. http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3003055
2020-06-13Skip test_getbinaryfile_command_injection on --jit-waitTakashi Kokubun
Timeout-based test often fails with --jit-wait as a false positive. Like other tests in the TestFTP, let me skip this as well. http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3001181 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3000134 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2999923 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2998857
2020-06-05`local_address` may raise IOError in debug printKazuhiro NISHIYAMA
https://rubyci.org/logs/rubyci.s3.amazonaws.com/wsl2/ruby-master/log/20200605T020004Z.fail.html.gz ``` [ 984/20282] IMAPTest#test_connection_closed_without_greeting#<Thread:0x000055b6e9589d28 /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:133 run> terminated with exception (report_on_exception is true): /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/.ext/common/socket.rb:252:in `local_address': closed stream (IOError) from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/.ext/common/socket.rb:252:in `connect_address' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `block (2 levels) in test_connection_closed_without_greeting' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `each_object' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `each' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `map' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `block in test_connection_closed_without_greeting' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:134:in `block in start_server' ```
2020-06-05Add sockets to debug printKazuhiro NISHIYAMA
debug print does not include `in_tcp_socket_2`, so I think other socket connected to server socket. Add sockets to debug print, and check other socket is in same process or not. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200604T160009Z.fail.html.gz ``` 1) Failure: IMAPTest#test_connection_closed_without_greeting [/export/home/chkbuild/chkbuild-gcc/tmp/build/20200604T160009Z/ruby/test/net/imap/test_imap.rb:523]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:server=>#<TCPServer:(closed)>, :port=>35490, :server_created=> {:server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>", :t=>45917010.30510591}, :in_start_server_before_accept=>{:t=>45917010.305154555}, :in_tcp_socket=> {:host=>"::1", :port=>35490, :server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>", :t=>45917010.40560127}, :in_start_server=> {:sock_addr=>["AF_INET6", 35490, "::1", "::1"], :sock_peeraddr=>["AF_INET6", 51584, "::1", "::1"], :t=>45917010.40767231}, :in_start_server_sock_closed=>{:t=>45917010.40770047}, :in_rescue=> {:e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:35490>, :server_addr=>"::1", :t=>45917010.40867455}} >. ```
2020-04-08[ruby/net-ftp] Added guard condition for the old ruby versionsHiroshi SHIBATA
https://github.com/ruby/net-ftp/commit/a56ba121ee
2020-04-08[ruby/net-ftp] Guard with under the Ruby 2.6Hiroshi SHIBATA
https://github.com/ruby/net-ftp/commit/bed4bc31db
2020-03-25Ignore test_getbinaryfile for --jit-waitTakashi Kokubun
To fix this properly, we'd need to configure timeout for the server and the client because waiting for compilation takes time. Until we figure out how to do it, let me skip this.
2020-03-21test/net/http/test_http.rb: relax open_timeout limitYusuke Endoh
The test fails randomly on the CI of OpenCSW SPARC Solaris 10: https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20200321T091909Z.fail.html.gz ``` 1) Failure: TestNetHTTP_v1_2_chunked#test_timeout_during_HTTP_session [/export/home/rubyci/unstable10s/tmp/build/20200321T091909Z/ruby/test/net/http/test_http.rb:575]: [Net::ReadTimeout] exception expected, not #<Net::OpenTimeout: execution expired>. ``` The environment uses RUBY_TEST_SUBPROCESS_TIMEOUT_SCALE=20, so the open timeout 0.1 sec. means 2.0 sec. for the environment, but it seems too strict because the environment is painfully slow.