create_websocket needs support for IPv6

Bug #1719575 reported by Dr. Jens Harbott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Dr. Jens Harbott

Bug Description

When the novnc endpoint contains an IPv6 address or an hostname that points to one, tempest.api.compute.servers.test_novnc.NoVNCConsoleTestJSON.test_novnc fails because create_websocket() is hardcoded to create a socket with AF_INET only, while one would need AF_INET6 in that case.

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "tempest/api/compute/servers/test_novnc.py", line 168, in test_novnc
        self._websocket = compute.create_websocket(body['url'])
      File "tempest/common/compute.py", line 298, in create_websocket
        client_socket.connect((url.hostname, url.port))
      File "/usr/lib/python2.7/socket.py", line 228, in meth
        return getattr(self._sock,name)(*args)
    socket.gaierror: [Errno -9] Address family for hostname not supported

This is related to https://launchpad.net/bugs/1656329

Changed in tempest:
assignee: nobody → Dr. Jens Harbott (j-harbott)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

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

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

Reviewed: https://review.openstack.org/507823
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=6bc422d2eb0a6b76aee479b08ed8b033938fd3d2
Submitter: Zuul
Branch: master

commit 6bc422d2eb0a6b76aee479b08ed8b033938fd3d2
Author: Jens Harbott <email address hidden>
Date: Wed Sep 27 10:29:34 2017 +0000

    Add IPv6 support to create_websocket()

    The current implementation is hardcoded to use AF_INET, which means
    IPv4. We need to be able to support IPv6 connections, too, so we use the
    socket.getaddrinfo() function as described in [1] in order to provide a
    more generic solution.

    [1] https://docs.python.org/2/library/socket.html

    Change-Id: I2ccbe3b25e79031a3c961871034c0c1b94d7ee80
    Closes-Bug: 1719575
    Related-Bug: 1656329

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 18.0.0

This issue was fixed in the openstack/tempest 18.0.0 release.

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.