Unittests crashes in system has no ipv6 support

Bug #1174404 reported by Vasyl Khomenko
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Qiu Yu
neutron
Invalid
Undecided
Unassigned

Bug Description

I'm trying to run unittests and got errors trying to execute tests:

======================================================================
ERROR: nova.tests.test_service.TestWSGIService.test_service_random_port_with_ipv6
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:'nova'

Traceback (most recent call last):
  File "/root/openstack/nova/app/nova/tests/test_service.py", line 189, in test_service_random_port_with_ipv6
    test_service = service.WSGIService("test_service")
  File "/root/openstack/nova/app/nova/service.py", line 608, in __init__
    max_url_len=max_url_len)
  File "/root/openstack/nova/app/nova/wsgi.py", line 120, in __init__
    self._socket = eventlet.listen(bind_addr, family, backlog=backlog)
  File "/usr/lib/python2.6/site-packages/eventlet/convenience.py", line 35, in listen
    sock = socket.socket(family, socket.SOCK_STREAM)
  File "/usr/lib/python2.6/site-packages/eventlet/greenio.py", line 116, in __init__
    fd = _original_socket(family_or_realsock, *args, **kwargs)
  File "/usr/lib64/python2.6/socket.py", line 184, in __init__
    _sock = _realsocket(family, type, proto)
error: [Errno 97] Address family not supported by protocol

======================================================================
ERROR: nova.tests.test_wsgi.TestWSGIServer.test_start_random_port_with_ipv6
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:'nova'

Traceback (most recent call last):
  File "/root/openstack/nova/app/nova/tests/test_wsgi.py", line 106, in test_start_random_port_with_ipv6
    host="::1", port=0)
  File "/root/openstack/nova/app/nova/wsgi.py", line 120, in __init__
    self._socket = eventlet.listen(bind_addr, family, backlog=backlog)
  File "/usr/lib/python2.6/site-packages/eventlet/convenience.py", line 35, in listen
    sock = socket.socket(family, socket.SOCK_STREAM)
  File "/usr/lib/python2.6/site-packages/eventlet/greenio.py", line 116, in __init__
    fd = _original_socket(family_or_realsock, *args, **kwargs)
  File "/usr/lib64/python2.6/socket.py", line 184, in __init__
    _sock = _realsocket(family, type, proto)
error: [Errno 97] Address family not supported by protocol

======================================================================
ERROR: nova.tests.test_wsgi.TestWSGIServerWithSSL.test_app_using_ipv6_and_ssl
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:'nova'

Traceback (most recent call last):
  File "/root/openstack/nova/app/nova/tests/test_wsgi.py", line 212, in test_app_using_ipv6_and_ssl
    use_ssl=True)
  File "/root/openstack/nova/app/nova/wsgi.py", line 120, in __init__
    self._socket = eventlet.listen(bind_addr, family, backlog=backlog)
  File "/usr/lib/python2.6/site-packages/eventlet/convenience.py", line 35, in listen
    sock = socket.socket(family, socket.SOCK_STREAM)
  File "/usr/lib/python2.6/site-packages/eventlet/greenio.py", line 116, in __init__
    fd = _original_socket(family_or_realsock, *args, **kwargs)
  File "/usr/lib64/python2.6/socket.py", line 184, in __init__
    _sock = _realsocket(family, type, proto)
error: [Errno 97] Address family not supported by protocol

Revision history for this message
Christopher Yeoh (cyeoh-0) wrote :

Perhaps should skip the test if the system has no IPv6 support. Is there any easy way to test for that?

Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/31629

Changed in nova:
assignee: nobody → Qiu Yu (unicell)
status: Confirmed → In Progress
Revision history for this message
Qiu Yu (unicell) wrote :

I happen to have one system with the same symptom. It runs a customized kernel without ipv6 support.

Guess it should be easy to reproduce on RHEL based systems without loading 'ipv6' kernel module. It's not easy to reproduce on Ubuntu systems because 'ipv6' has already built-in.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/31629
Committed: http://github.com/openstack/nova/commit/a24d3dabc1f4ca506ab6d542e4ec1d87bbdd09b8
Submitter: Jenkins
Branch: master

commit a24d3dabc1f4ca506ab6d542e4ec1d87bbdd09b8
Author: Qiu Yu <email address hidden>
Date: Thu Jun 6 23:45:41 2013 +0800

    Skip ipv6 tests on system without ipv6 support

    On system without ipv6 support, CONFIG_IPV6 disabled kernel for
    instance, WSGI service testcases for ipv6 would fail for "[Errno 97]
    Address family not supported by protocol".

    Since there is no easy way to detect actual ipv6 support,
    socket.has_ipv6 not working for this case, simply skip ipv6 tests if
    errno.EAFNOSUPPORT happens.

    Fixes: bug 1174404

    Change-Id: I9fa8653f5ccfbcb8c31c51bfda137cb58388afde

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
pritesh (pritesh)
Changed in neutron:
assignee: nobody → pritesh (pritesh)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/131308

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/131308
Reason: Thanks for the link Sean.

If Canonical no longer supports 10.04, I don't think we can reasonably expect Neutron to support 10.04.

@Pritesh: please upgrade your env, if you can. We're going in the direction of making IPv6 support mandatory from Kilo on. So I'm afraid it no longer makes sense to get this change in.

pritesh (pritesh)
Changed in neutron:
assignee: pritesh (pritesh) → nobody
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.