summaryrefslogtreecommitdiff
path: root/test/net
AgeCommit message (Collapse)Author
2019-01-02test/net/fixtures/Makefile: moved from test/net/imapmrkn
This Makefile can be used to update test certificates. It should have been moved at which the certificates was moved at r56836. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-02Try to update cert (2nd try)kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-02Try to update certkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-27Fix Net::Protocol::BufferedIO#write when sending large multi-byte stringnobu
This commit should fix Net::Protocol::BufferedIO#write when sending large multi-byte string like following example. ``` $ ruby -rnet/http -rjson -v -e "Net::HTTP.post(URI('http://httpbin.org/post'), { text: 'あ'*100_000 }.to_json, 'Content-Type' => 'application/json')" ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] Traceback (most recent call last): 19: from -e:1:in `<main>' 18: from lib/ruby/2.6.0/net/http.rb:500:in `post' 17: from lib/ruby/2.6.0/net/http.rb:605:in `start' 16: from lib/ruby/2.6.0/net/http.rb:920:in `start' 15: from lib/ruby/2.6.0/net/http.rb:502:in `block in post' 14: from lib/ruby/2.6.0/net/http.rb:1281:in `post' 13: from lib/ruby/2.6.0/net/http.rb:1493:in `send_entity' 12: from lib/ruby/2.6.0/net/http.rb:1479:in `request' 11: from lib/ruby/2.6.0/net/http.rb:1506:in `transport_request' 10: from lib/ruby/2.6.0/net/http.rb:1506:in `catch' 9: from lib/ruby/2.6.0/net/http.rb:1507:in `block in transport_request' 8: from lib/ruby/2.6.0/net/http/generic_request.rb:123:in `exec' 7: from lib/ruby/2.6.0/net/http/generic_request.rb:189:in `send_request_with_body' 6: from lib/ruby/2.6.0/net/protocol.rb:247:in `write' 5: from lib/ruby/2.6.0/net/protocol.rb:265:in `writing' 4: from lib/ruby/2.6.0/net/protocol.rb:248:in `block in write' 3: from lib/ruby/2.6.0/net/protocol.rb:275:in `write0' 2: from lib/ruby/2.6.0/net/protocol.rb:275:in `each_with_index' 1: from lib/ruby/2.6.0/net/protocol.rb:275:in `each' lib/ruby/2.6.0/net/protocol.rb:280:in `block in write0': undefined method `bytesize' for nil:NilClass (NoMethodError) ``` [Fix GH-2058] From: Eito Katagiri <eitoball@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10Preserve HTTP header key as string [Bug #15394]naruse
to prevent send Host header twice accidentally. From: Sangyong Sim <sangyong-sim@cookpad.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-14test_ftp.rb: loosen another timeout requirementk0kubun
for Travis osx. https://travis-ci.org/ruby/ruby/jobs/454864155 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-14test_ftp.rb: loosen timeout for Travis osxk0kubun
https://travis-ci.org/ruby/ruby/jobs/454798071 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-08test_ftp.rb: extend timeout for --jit-wait testingk0kubun
to avoid random failures like https://app.wercker.com/ruby/ruby/runs/mjit-test1/5be394b818310600284f2b50?step=5be394f1591ca800079b1329 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21Exclude CI platform specific failures by --excludes optionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21skip tests broken with OpenSSL 1.1.1 on Travis osxk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16test/net/imap/test_imap.rb (test_exception_during_idle): kill infinite loopernormal
It is possible for Mutex#sleep (via ConditionVariable#wait) to prematurely wake up under MJIT (because Mutex#sleep can't handle spurious wakeups). This affects @idle_done_cond in Net::IMAP#idle and means the response handler may never set `in_idle' to `true`. In any case, ensure the infinite looping `raiser' thread stops running when the test is done. Will work on reducing the effect of spurious wakeups from MJIT... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09net/http, net/ftp: skip SSL/TLS session resumption testsrhe
Due to a bug in OpenSSL 1.1.0h[1] (it's only in this specific version; it was introduced just before the release and is already fixed in their stable branch), the callback set by SSLContext#session_new_cb= does not get called for clients, making net/http and net/ftp not attempt session resumption. Let's disable the affected test cases for now. Another option would be to fallback to using SSLSocket#session as we did before r64234. But since only a single version is affected and hopefully a new stable version containing the fix will be released in near future, I chose not to add such workaround code to lib/. [1] https://github.com/openssl/openssl/pull/5967 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-08net/http, net/ftp: fix session resumption with TLS 1.3rhe
When TLS 1.3 is in use, the session ticket may not have been sent yet even though a handshake has finished. Also, the ticket could change if multiple session ticket messages are sent by the server. Use SSLContext#session_new_cb instead of calling SSLSocket#session immediately after a handshake. This way also works with earlier protocol versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-25increase body sizenaruse
To try to block writing on travis. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-24test/net/http/test_httpresponse.rb: add testcases for net/httpresponsemame
This change adds testcases for Response#inspect and #code_type, and improves line coverage of lib/net/http/response.rb (91.8 % to 92.94 %). A patch from @owlworks. https://github.com/ruby/ruby/pull/1898 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22remove debug printnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22check net.core.wmem_default and max instead of tcpnaruse
https://travis-ci.org/ruby/ruby/jobs/395416137 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-22show net.ipv4.tcp_wmem to debug failure on travisnaruse
https://travis-ci.org/ruby/ruby/builds/395318841 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-08assert_raise(Net::ReadTimeout) on Windows [Bug #14829]naruse
From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-08th is nilusa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-07skip write_timeout test on Windowsnaruse
This test is about write_timeout. To ensure it really raised Net::WriteTimeout, skip this test on Windows, whose write returns immediately even for large data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-07Some platforms immediately returns from Socket#writeusa
* test/net/http/test_http.rb (test_timeout_during_HTTP_session_write): on some platforms such as Windows immediately returns from Socket#write, and have to wait to read its response. So, we can not handle Net::WriteTimeout and should handle Net::ReadTimeout instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-06Add Net::HTTPClientException [Bug #14688]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-06Introduce write_timeout to Net::HTTP [Feature #13396]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11net/imap: Fix ArgumentError in send_string_datashugo
Thanks to ShockwaveNN (Pavel Lobashov) for reporting the bug. [ruby-core:86990] [Bug #14750] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-30io.c: workaround for EPROTOTYPEnobu
* io.c (internal_write_func, internal_writev_func): retry at unexpected EPROTOTYPE on macOS, to get rid of a kernel bug. [ruby-core:86690] [Bug #14713] * ext/socket/init.c (rsock_{sendto,send,write}_blocking): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28test_ftp.rb: extend read_timeout for --jit-waitk0kubun
testing. I'm running `make test-all RUN_OPTS='--jit-wait'` and the read_timeout was too slow for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-08Raise ArgumentError if host component is nilnaruse
From: oss92 <mohamed.o.alnagdy@gmail.com> fix https://github.com/ruby/ruby/pull/1278 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30net/pop: make modified strings mutablenormal
Thanks to Michael Zimmerman for the bug report * lib/net/pop.rb: make modified strings mutable [ruby-core:85210] [Bug #14416] * test/net/pop/test_pop.rb: new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-06net/ftp: fix FrozenError in BufferedSocketnormal
I noticed this bug while working on something else with RUBYOPT=-d on, existing test cases all passed with it. Note: I use String.new because it is the local style, here, I prefer +'' (or ''.b, for a future commit) * lib/net/ftp.rb (BufferedSocket#read): use String.new * test/net/ftp/test_buffered_socket.rb (test_read_nil): new test [ruby-core:84675] [Bug #14323] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28`$SAFE` as a process global state. [Feature #14250]ko1
* vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state. * vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc` objects don't need to keep `$SAFE` at the creation. Also make `is_from_method` and `is_lambda` as 1 bit fields. * cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation. * eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access `vm->safe_level_` directly. * eval_jump.c: End procs `END{}` doesn't keep `$SAFE`. * proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c. * safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes. * safe.c (safe_setter): use `rb_set_safe_level()`. * thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`. It should be obsolete. * transcode.c (load_transcoder_entry): `rb_safe_level()` only returns 0 or 1 so that this check is not needed. * vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc. * vm.c (rb_proc_create): renamed to `proc_create`. * vm.c (rb_proc_dup): moved from proc.c. * vm.c (vm_invoke_proc): do not need to set and restore `$SAFE` for `Proc#call`. * vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer meaning. * lib/drb/drb.rb: restore `$SAFE`. * lib/erb.rb: restore `$SAFE`, too. * test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests. * test/rubygems/test_gem.rb: do not set `$SAFE = 1`. * bootstraptest/test_proc.rb: catch up this change. * spec/ruby/optional/capi/string_spec.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. * test/fiddle/test_func.rb: ditto. * test/fiddle/test_handle.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. * test/pathname/test_pathname.rb: ditto. * test/readline/test_readline.rb: ditto. * test/ruby/test_file.rb: ditto. * test/ruby/test_optimization.rb: ditto. * test/ruby/test_proc.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_thread.rb: ditto. * test/rubygems/test_gem_specification.rb: ditto. * test/test_tempfile.rb: ditto. * test/test_tmpdir.rb: ditto. * test/win32ole/test_win32ole.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21Extend timeout for CI.shugo
http://ci.rvm.jp/results/trunk-asserts-nopara@ruby-sky1/266962 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20raise error if value contains CR/LF in iniheader of initialize_http_headernaruse
like r59693, initialize_http_header also should raise error. [Bug #14208] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14Fix a command injection vulnerability in Net::FTP.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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-12-06remove unnecessary read_timeout.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05Remove unnecessary read_timeout.shugo
http://ci.rvm.jp/results/trunk-asserts-nopara@ruby-sky1/219867 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-25openssl: revert changes in SSLContext#{min,max}_version= in r60310rhe
And adapt a net/http test to their old behavior. [ruby-core:83491] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26Host header should add branckets to IPv6 address [Bug #12642]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23OpenSSL may show the different error messagenaruse
https://github.com/ruby/ruby/commit/d02211c9da608742b09aec768db79442007eabc0#commitcomment-25119729 From: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Fixed misspelling words.hsbt
These are detected by https://github.com/client9/misspell git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21ignore server side errornaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Revert "ignore server side error"naruse
This reverts commit r60314. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21ignore server side errornaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21fic expected error messagenaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Introduce Net::HTTP#min_version/max_version [Feature #9450]naruse
Set SSL minimum/maximum version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-03Fix leaked file descriptorkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-28Net::HTTP.new: Support no_proxy parameter [Feature #11195]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-26Make retries for Net::HTTP configurable [Feature #10674]naruse
by stereobooster fix https://github.com/ruby/ruby/pull/1654 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-25HTTPHeader#add_field should allow binary [Bug #13926]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e