Project

General

Profile

Bug #11394

Error in test/rinda/test_rinda.rb when IPv6 address is only ::1 assigned to the loopback device

Added by ngoto (Naohisa Goto) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-dev:49199]

Description

システム上に存在するIPv6アドレスが、ループバックデバイスに割り当てられた ::1 だけの場合、test/rinda/test_rinda.rb で以下のエラーが発生します。

Linux (Debian wheezy)の場合 。

# ifconfig eth0 inet6 del fe80::XXXX:XXXX:XXXX:XXXX/64
% ruby test/runner.rb test/rinda/test_rinda.rb
Run options: 

# Running tests:

[ 9/39] Rinda::TestRingServer#test_make_socket_ipv6_multicast = 0.00            
  1) Error:
Rinda::TestRingServer#test_make_socket_ipv6_multicast:
Errno::ENODEV: No such device - setsockopt(2)
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `setsockopt'
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `make_socket'
    /XXXXXXXX/test/rinda/test_rinda.rb:642:in `test_make_socket_ipv6_multicast'

[12/39] Rinda::TestRingServer#test_ring_server_ipv6_multicast = 0.00            
  2) Error:
Rinda::TestRingServer#test_ring_server_ipv6_multicast:
Errno::ENODEV: No such device - setsockopt(2)
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `setsockopt'
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `make_socket'
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:107:in `block in initialize'
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:105:in `each'
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:105:in `initialize'
    /XXXXXXXX/test/rinda/test_rinda.rb:678:in `new'
    /auto/user3/gen-info/ngoto/testruby/daily/src/github/ruby/test/rinda/test_rinda.rb:678:in `test_ring_server_ipv6_multicast'

Leaked file descriptor: Rinda::TestRingServer#test_ring_server_ipv6_multicast: 10 : #<Socket:fd 10>
Finished tests in 1.545205s, 25.2394 tests/s, 250.4522 assertions/s.            
39 tests, 387 assertions, 0 failures, 2 errors, 2 skips

ruby -v: ruby 2.3.0dev (2015-07-16) [x86_64-linux]

Solaris 10 の場合。

$ ruby test/runner.rb test/rinda/test_rinda.rb 
Run options: 

# Running tests:

[ 3/39] Rinda::TestRingFinger#test_make_socket_ipv6_multicast = 0.00 s                
  1) Error:
Rinda::TestRingFinger#test_make_socket_ipv6_multicast:
Errno::ENETUNREACH: Network is unreachable - connect(2) for [ff02::1]:7647
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `connect'
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `make_socket'
    /XXXXXXXX/test/rinda/test_rinda.rb:773:in `test_make_socket_ipv6_multicast'

[ 4/39] Rinda::TestRingFinger#test_make_socket_ipv6_multicast_hops = 0.00 s      
  2) Error:
Rinda::TestRingFinger#test_make_socket_ipv6_multicast_hops:
Errno::ENETUNREACH: Network is unreachable - connect(2) for [ff02::1]:7647
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `connect'
    /PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `make_socket'
    /XXXXXXXX/test/rinda/test_rinda.rb:797:in `test_make_socket_ipv6_multicast_hops'

Leaked file descriptor: Rinda::TestRingServer#test_ring_server_ipv6_multicast: 11     
Closed file descriptor: Rinda::TestRingServer#test_shutdown: 11
Finished tests in 2.053681s, 18.9903 tests/s, 188.4421 assertions/s.             
39 tests, 387 assertions, 0 failures, 2 errors, 0 skips

ruby -v: ruby 2.3.0dev (2015-07-24) [sparc64-solaris2.10]

当該テストを、IPv6がloopbackだけの場合はskipするように変更したいと思います。

#1

Updated by ngoto (Naohisa Goto) almost 5 years ago

  • Status changed from Open to Closed

Applied in changeset r51362.


  • test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6): prevent to use
    IPv6 loopback interface for
    Rinda::TestRingFinger#test_make_socket_ipv6_multicast and
    Rinda::TestRingFinger#test_make_socket_ipv6_multicast_hops.
    The tests are skipped if there are no IPv6 devices other than the
    loopback device. [Bug #11394] [ruby-dev:49199]

  • test/rinda/test_rinda.rb (test_make_socket_ipv6_multicast): ditto
    for Rinda::TestRingServer#test_make_socket_ipv6_multicast.

  • test/rinda/test_rinda.rb (test_ring_server_ipv6_multicast): ditto
    for Rinda::TestRingServer#test_ring_server_ipv6_multicast.

Also available in: Atom PDF