summaryrefslogtreecommitdiff
path: root/test/net
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a warningKazuhiro NISHIYAMA2021-01-231-1/+1
| | | | | | ``` .../ruby/test/net/http/test_httpresponse.rb:81: warning: constant RubyVM::MJIT is deprecated ```
* [ruby/net-http] RubyVM::MJIT is deprecated, prefer RubyVM::JIT nowNobuyoshi Nakada2021-01-211-1/+3
| | | | https://github.com/ruby/net-http/commit/abc6ea1877
* Rename RubyVM::MJIT to RubyVM::JITTakashi Kokubun2021-01-133-19/+19
| | | | | | | | 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]
* Try increasing SMTP's read_timeout for --jit-waitTakashi Kokubun2020-12-291-0/+11
| | | | | | | 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
* Wait testing/helper threads to terminateNobuyoshi Nakada2020-12-132-2/+2
|
* Guard all accesses to RubyVM::MJIT with defined?(RubyVM::MJIT) &&Benoit Daloze2020-12-042-16/+16
| | | | * Otherwise those tests, etc cannot run on alternative Ruby implementations.
* test/net/smtp - use TCPSocket when UNIXSocket unavailableMSP-Greg2020-11-182-4/+6
|
* Skip tests related TLS with Windows platform.Hiroshi SHIBATA2020-11-172-2/+2
|
* Import net-smtp-0.2.0 from https://github.com/ruby/net-smtpHiroshi SHIBATA2020-11-173-1/+250
|
* test/net/smtp/test_smtp.rb: Stop io leaksYusuke Endoh2020-09-261-9/+17
| | | | | | | | `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> ```
* test/net/http/test_https.rb: The test logic was buggyYusuke Endoh2020-09-241-4/+4
| | | | | The expected certs must be `[CA_CERT, SERVER_CERT]` before 1.1.1g and `[SERVER_CERT]` after 1.1.1h.
* test/net/http/test_https.rb: the order of verify_callback seems to varyYusuke Endoh2020-09-241-4/+4
| | | | ... depending upon the environment.
* test/net/http/test_https.rb: Stop the error due to openssl 1.1.1hYusuke Endoh2020-09-241-4/+8
| | | | | | | | | | | | | | | | | | | 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.
* [ruby/net-smtp] Net::SMTP.start arguments are keyword argumentsTOMITA Masahiro2020-09-141-6/+88
| | | | | | | | | 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
* [ruby/net-smtp] TLS should not check the host name by default.TOMITA Masahiro2020-09-141-1/+3
| | | | | | | | 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
* [ruby/net-http] Fix SSL session reuse test with LibreSSL 3.2+Jeremy Evans2020-08-031-0/+8
| | | | https://github.com/ruby/net-http/commit/5ae9620fbc
* [ruby/net-http] Switch invalid server name formatJeremy Evans2020-08-031-5/+5
| | | | | | | | | | | | | | | | 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
* Skip test_read_body_block_mod for --jit-waitTakashi Kokubun2020-06-221-1/+2
|
* Try increasing read_timeout a little moreTakashi Kokubun2020-06-211-1/+1
| | | | | It failed again http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3018488
* Increase read_timeout for --jit-waitTakashi Kokubun2020-06-211-0/+1
| | | | | This tries to fix a random failure like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3017837
* Increase read timeout of FTP tests with --jit-waitTakashi Kokubun2020-06-211-1/+13
| | | | | Trying to eliminate some newer random failures http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3016543
* Try using longer read_timeout for --jit-waitTakashi Kokubun2020-06-141-7/+4
| | | | | | | | 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
* Skip test_getbinaryfile_command_injection on --jit-waitTakashi Kokubun2020-06-131-0/+2
| | | | | | | | | | 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
* `local_address` may raise IOError in debug printKazuhiro NISHIYAMA2020-06-051-1/+1
| | | | | | | | | | | | | | | 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' ```
* Add sockets to debug printKazuhiro NISHIYAMA2020-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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}} >. ```
* [ruby/net-ftp] Added guard condition for the old ruby versionsHiroshi SHIBATA2020-04-081-2/+2
| | | | https://github.com/ruby/net-ftp/commit/a56ba121ee
* [ruby/net-ftp] Guard with under the Ruby 2.6Hiroshi SHIBATA2020-04-081-1/+1
| | | | https://github.com/ruby/net-ftp/commit/bed4bc31db
* Ignore test_getbinaryfile for --jit-waitTakashi Kokubun2020-03-251-0/+2
| | | | | | | 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.
* test/net/http/test_http.rb: relax open_timeout limitYusuke Endoh2020-03-211-1/+1
| | | | | | | | | | | | | | | 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.
* Skip test_abort_tls with --jit-wait for nowTakashi Kokubun2020-03-121-0/+2
| | | | | Perhaps the server blocks for an unexpectedly long time by waiting for JIT. As it's usually passing, I don't think it's detecting a bug.
* Let Net::HTTP.get take request headers (#2957)Takashi Kokubun2020-03-102-1/+26
| | | | | | | | | | | * Let Net::HTTP.get take request headers * Add more test cases for no header usages * Add examples with request headers * Add a NEWS entry [ci skip] [Feature #16686]
* Fixed FD leakNobuyoshi Nakada2020-03-041-0/+2
|
* Promote net-http to the default gems.Hiroshi SHIBATA2020-02-211-5/+5
| | | | | test/net/http/test_https.rb: rename fixture methods to read_fixture because it conflicts with test-unit gem.
* Add more debug printKazuhiro NISHIYAMA2020-01-291-2/+11
| | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-master/log/20200129T022510Z.fail.html.gz
* Add more debug printKazuhiro NISHIYAMA2020-01-261-9/+49
| | | | | | | | 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"}>. ```
* Add #verify_hostname= and #verify_hostname to skip hostname verification (#2858)Yuta Iwama2020-01-231-0/+23
| | | | | | | | | | | | According to https://github.com/ruby/openssl/pull/60, > Currently an user who wants to do the hostname verification needs to call SSLSocket#post_connection_check explicitly after the TLS connection is established. if an user who wants to skip the hostname verification, SSLSocket#post_connection_check doesn't need to be called https://bugs.ruby-lang.org/issues/16555
* Revert "lib/net/http/response.rb: support raw deflate correctly"Yusuke Endoh2019-12-161-16/+16
| | | | | | | | | | | | | | | | This reverts commit 5105240b1e851410020b3b3f1a2bead7ffdd4291. In RFC 2616: ``` deflate The "zlib" format defined in RFC 1950 [31] in combination with the "deflate" compression mechanism described in RFC 1951 [29]. ``` So "Content-Encoding: deflate" means zlib format, not raw deflate. [Bug #11268]
* lib/net/http/response.rb: support raw deflate correctlyYusuke Endoh2019-12-161-16/+16
| | | | | | | | | | | | | | Net::HTTP had used `Zlib::Inflate.new(32 + Zlib::MAX_WBITS)` for all content encoding (deflate, zlib, and gzip). But the argument `32 + Zlib::MAX_WBITS` means zlib and gzip decoding with automatic header detection, so (raw) deflate compression had not been supported. This change makes it support raw deflate correctly by passing an argument `-Zlib::MAX_WBITS` (which means raw deflate) to `Zlib::Inflate.new`. All deflate-mode tests are fixed too. [Bug #11268]
* Add more debug infoKazuhiro NISHIYAMA2019-12-151-1/+8
| | | | | | | | | | | | | 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"}>. ```
* Move `rescue` for debug into block of assert_raiseKazuhiro NISHIYAMA2019-12-121-2/+2
|
* Add more debug info when Errno::EINVALKazuhiro NISHIYAMA2019-12-121-0/+2
| | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191212T072406Z.fail.html.gz
* fix ipaddr parameter of Net::HTTP.start to support proxyNARUSE, Yui2019-12-101-0/+39
| | | | 54072e329cab7207fba133caba4fc12b45add8f9
* test/net/http/test_https.rb (test_get_SNI_failure): stop proxy settingsYusuke Endoh2019-12-103-43/+45
| | | | | | | | | | | | | | Because the test fails under HTTP proxy settings. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20191210T000004Z.fail.html.gz ``` 1) Failure: TestNetHTTPS#test_get_SNI_failure [/export/home/users/chkbuild/cb-gcc/tmp/build/20191210T000004Z/ruby/test/net/http/test_https.rb:81]: [OpenSSL::SSL::SSLError] exception expected, not #<Net::HTTPServerException: 403 "Forbidden">. ``` The new SNI feature introduced at 54072e329c may need to be improved for HTTP proxy environment.
* Add ipaddr optional parameter to Net::HTTP#startNARUSE, Yui2019-12-091-0/+31
| | | | | | | | | | | | | | | | to replace the address for TCP/IP connection [Feature #5180] There're 3 layers of hostname: * host address for TCP/IP * TLS server name * HTTP Host header value To test DNS round robin or check server certificate from server local, people sometimes want to connect server with given IP address but keep TLS server name and HTTP Host header value. closes [Feature #15215] closes https://github.com/ruby/ruby/pull/1893 closes https://github.com/ruby/ruby/pull/1977
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-181-19/+19
| | | | | | 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.
* Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans2019-11-181-13/+0
| | | | | | | | | | | | | | | | | 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.
* Ignore Errno::EPIPE when sending requests in net/httpJeremy Evans2019-09-271-0/+11
| | | | | | | | An EPIPE when sending the request should be ignored. Even if you cannot write more data, you may still be able to read the server's response. Fixes [Bug #14466]
* Add Net::FTP#features and Net::FTP#optionShugo Maeda2019-09-021-0/+96
| | | | | Patch by darkphnx (Dan Wentworth) . Thanks! [Feature #15964]
* Adding missing test for Net::HTTPGenericRequest initializer (#1835)Espartaco Palma2019-08-161-0/+1
| | | | | A new exception is raised if an URI::HTTP is received and that object doesn't have a hostname property. Complementary to #1278
* Test missing Content-Type warningsNobuyoshi Nakada2019-07-241-4/+11
|