py27 and py34 unit tests fail when run on a host running devstack

Bug #1599330 reported by Michael Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
Fix Released
Medium
Matt Alline

Bug Description

It appears we have incomplete mocks for the py27 and py34 unit tests. When run on a host with a running devstack they report a large (14+) number of test failures, mostly related to neutron client calls.

To reproduce:
1. Install devstack with Octavia enabled
2. Checkout a fresh copy of master Octavia
3. Run tox -e py27 or py34

An example:
======================================================================
FAIL: octavia.tests.unit.controller.worker.tasks.test_network_tasks.TestNetworkTasks.test_update_vip
tags: worker-2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/michjohn/projects/dnsname/octavia/octavia/tests/unit/controller/worker/tasks/test_network_tasks.py", line 392, in test_update_vip
    net_task = network_tasks.UpdateVIP()
  File "/home/michjohn/projects/dnsname/octavia/octavia/controller/worker/tasks/network_tasks.py", line 40, in __init__
    self.network_driver = utils.get_network_driver()
  File "/home/michjohn/projects/dnsname/octavia/octavia/common/utils.py", line 68, in get_network_driver
    invoke_on_load=True
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/stevedore/driver.py", line 46, in __init__
    verify_requirements=verify_requirements,
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/stevedore/named.py", line 55, in __init__
    verify_requirements)
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/stevedore/extension.py", line 171, in _load_plugins
    self._on_load_failure_callback(self, ep, err)
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/stevedore/extension.py", line 163, in _load_plugins
    verify_requirements,
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/stevedore/named.py", line 123, in _load_one_plugin
    verify_requirements,
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/stevedore/extension.py", line 188, in _load_one_plugin
    obj = plugin(*invoke_args, **invoke_kwds)
  File "/home/michjohn/projects/dnsname/octavia/octavia/network/drivers/neutron/allowed_address_pairs.py", line 48, in __init__
    super(AllowedAddressPairsDriver, self).__init__()
  File "/home/michjohn/projects/dnsname/octavia/octavia/network/drivers/neutron/base.py", line 46, in __init__
    extensions = self.neutron_client.list_extensions()
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/neutronclient/v2_0/client.py", line 608, in list_extensions
    return self.get(self.extensions_path, params=_params)
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/neutronclient/v2_0/client.py", line 342, in get
    headers=headers, params=params)
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/neutronclient/v2_0/client.py", line 319, in retry_request
    headers=headers, params=params)
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/neutronclient/v2_0/client.py", line 282, in do_request
    self._handle_fault_response(status_code, replybody, resp)
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/neutronclient/v2_0/client.py", line 257, in _handle_fault_response
    exception_handler_v20(status_code, error_body)
  File "/home/michjohn/projects/dnsname/octavia/.tox/py34/lib/python3.4/site-packages/neutronclient/v2_0/client.py", line 84, in exception_handler_v20
    request_ids=request_ids)
neutronclient.common.exceptions.NeutronClientException: <MagicMock name='mock.request().text' id='139857024574296'>
Neutron server returns request_ids: [<MagicMock name='mock.request()' id='139857024561840'>]

Revision history for this message
Michael Johnson (johnsom) wrote :

If you run clean.sh to shutdown devstack, the tests pass again.

Lubosz Kosnik (diltram)
Changed in octavia:
status: New → Confirmed
Changed in octavia:
assignee: nobody → Matt Alline (matt-alline)
Changed in octavia:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to octavia (master)

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

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

Reviewed: https://review.openstack.org/339756
Committed: https://git.openstack.org/cgit/openstack/octavia/commit/?id=55e6e3a77a941e856348e9a933ede3d8d07b47d8
Submitter: Jenkins
Branch: master

commit 55e6e3a77a941e856348e9a933ede3d8d07b47d8
Author: Matt Alline <email address hidden>
Date: Fri Jul 8 12:47:19 2016 -0500

    Fixed running tox while stacked

    Tox tests for py27 and py34 would fail various numbers of tests
    when tox was run multiple times without a clean stack. This patch
    tracked down the missing mocks for the various tests and put them
    into place. Now running tox should pass green no matter if the
    user has a running stack or does not have a running stack.

    Change-Id: I0b11c83ec7ccfdc57790213d415b30d52fd55a61
    Closes-Bug: 1599330

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

This issue was fixed in the openstack/octavia 0.9.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.