summaryrefslogtreecommitdiff
path: root/test/net/imap
AgeCommit message (Collapse)Author
2021-05-27Promote net-imap to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4530
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-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-04-22Merge net-imap-0.2.0Hiroshi SHIBATA
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-01-29Add more debug printKazuhiro NISHIYAMA
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20200129T022510Z.fail.html.gz
2020-01-26Add more debug printKazuhiro NISHIYAMA
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20200125T032406Z.fail.html.gz ``` IMAPTest#test_connection_closed_without_greeting [/export/home/rubyci/chkbuild-tmp/tmp/build/20200125T032406Z/ruby/test/net/imap/test_imap.rb:485]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:"server before close"=>"#<TCPServer:fd 10, AF_INET6, ::1, 48515>", :sock_addr=>["AF_INET6", 48515, "::1", "::1"], :sock_peeraddr=>["AF_INET6", 35223, "::1", "::1"], :e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:48515>, :server=>#<TCPServer:(closed)>, :port=>48515, :server_addr=>"::1"}>. ```
2019-12-15Add more debug infoKazuhiro NISHIYAMA
closed server doesn't have useful info. So call inspect before close. And add local debug code in comment. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191215T092405Z.fail.html.gz ``` 1) Failure: IMAPTest#test_connection_closed_without_greeting [/export/home/rubyci/chkbuild-tmp/tmp/build/20191215T092405Z/ruby/test/net/imap/test_imap.rb:483]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:41748>, :server=>#<TCPServer:(closed)>, :port=>41748, :server_addr=>"::1"}>. ```
2019-12-12Move `rescue` for debug into block of assert_raiseKazuhiro NISHIYAMA
2019-12-12Add more debug info when Errno::EINVALKazuhiro NISHIYAMA
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191212T072406Z.fail.html.gz
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-11-18Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans
This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-06-30Removed unused variablesNobuyoshi Nakada
2019-06-25test/net/imap/test_imap.rb: use Thread#stop? to wait for server threadYusuke Endoh
Still timeout occurs. Retry for 5dd8fdd3f328f741fae4abba00c478e8a51d2a7e. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190625T032405Z.fail.html.gz
2019-06-15test/net/imap/test_imap.rb: wait for the server thread to startYusuke Endoh
In some slow CI environments, the invocation of a thread seems very slow. This causes a test failure to attempt to connect a server that does not start yet. https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190615T002420Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20190611T022407Z.fail.html.gz
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
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-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
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-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-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-08-27lib/net/imap.rb: Accept continuation requests without response textshugo
The IMAP server of DOCOMO returns such continuation requests. [ruby-list:50558] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-18test/net/imap/test_imap.rb: Use Addrinfo.tcp in case localhost is ::1.shugo
[ruby-dev:50208] [Bug #13825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-26lib/net/imap.rb: support CHANGEDSINCE and MODSEQshugo
Patch by plehoux (Philippe-Antoine Lehoux). [ruby-core:64272] [Feature #10119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-19lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Servershugo
Based on the patch by keysen (Jérémy Carlier). [ruby-core:81641] [Bug #13649] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22net/imap: separate @continuation_request_exception from @exceptionshugo
Otherwise literal data will be sent even if NO response is returned because @exception is set to nil in receive_responses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19net/imap: Net::IMAP#append should not block when NO response is receivedshugo
[ruby-dev:50129] [Bug#13579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-13test/net/imap: fix race condition in test_exception_during_idleshugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-11net/imap: Net::IMAP#disconnect need not do anything if already disconnectedshugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19Move certificates to test/net/fixtures/.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-07* test/net/imap/test_imap.rb (test_idle_timeout): Because of theodaira
timeout specified in "imap.idle(0.2)", there is no gurantee that the server thread has done all the work before the client thread performs the assertions. It depends on the thread scheduling. Add checks to avoid false positives (on AIX, particularly). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-240.1 second is not enough for FreeBSDnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* lib/net/imap.rb: remove an empty comment line and -*-.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-22* lib/net/imap (idle): add a new argument timeout for keep-alive.shugo
[ruby-core:63693] [Bug #10031] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09* lib/net/imap.rb: use frozen_string_literal: true.shugo
* test/net/imap/test_imap.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08* lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dspshugo
is omitted. [ruby-core:69093] [Bug #11128] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-07* test/net/imap/test_imap.rb (ImapTest#imaps_test): forced error on SSL socketsusa
causes Errno::ECONNRESET or Errno::ECONNABORTED instead of Errno::EPIPE on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-06* lib/net/imap.rb: Fix undefined variable usage & refactor/DRYshugo
code. Patch by @aledovsky. [Fixes GH-770] * test/net/test_imap.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* lib/net/imap.rb (search_response): parse MODSEQ in SEARCHshugo
responses properly. [ruby-core:64203] [Bug #10112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10* test/net/imap/test_imap.rb: Don't ignore exceptions on serverakr
threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-29* test/net/imap/test_imap_response_parser.rb: removed needless code.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-09fold too long linenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03 * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a bodyshugo
type as "MIXED" followed immediately by params [ruby-core:62864] [Bug #9885] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28No need to kill a thread.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28* lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket whenakr
any exception occur. This fixes a fd leak by IMAPTest#test_imaps_post_connection_check which start_tls_session() raises an exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26test_imap.rb: fix leaked threadsnobu
* test/net/imap/test_imap.rb (imaps_test): join work threads not to leak threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e