OVS data port unit tests broken at master

Bug #1829465 reported by Chris MacNaughton on 2019-05-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack neutron-gateway charm
Undecided
Chris MacNaughton

Bug Description

==============================
Failed 2 tests - output below:
==============================

unit_tests.test_neutron_utils.TestNeutronUtils.test_configure_ovs_ovs_data_port_bridge
--------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/chris/code/canonical/neutron-gateway/.tox/py36/lib/python3.6/site-packages/mock/mock.py", line 1330, in patched'
    b' return func(*args, **keywargs)'
    b' File "/home/chris/code/canonical/neutron-gateway/unit_tests/test_neutron_utils.py", line 327, in test_configure_ovs_ovs_data_port_bridge'
    b' self.add_ovsbridge_linuxbridge.assert_has_calls(calls)'
    b' File "/home/chris/code/canonical/neutron-gateway/.tox/py36/lib/python3.6/site-packages/mock/mock.py", line 978, in assert_has_calls'
    b' ), cause)'
    b' File "<string>", line 3, in raise_from'
    b'AssertionError: Calls not found.'
    b"Expected: [call('br-data', 'br-eth0')]"
    b''

unit_tests.test_neutron_utils.TestNeutronUtils.test_configure_ovs_ovs_data_port
-------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/chris/code/canonical/neutron-gateway/.tox/py36/lib/python3.6/site-packages/mock/mock.py", line 1330, in patched'
    b' return func(*args, **keywargs)'
    b' File "/home/chris/code/canonical/neutron-gateway/unit_tests/test_neutron_utils.py", line 279, in test_configure_ovs_ovs_data_port'
    b' self.add_bridge_port.assert_has_calls(calls)'
    b' File "/home/chris/code/canonical/neutron-gateway/.tox/py36/lib/python3.6/site-packages/mock/mock.py", line 978, in assert_has_calls'
    b' ), cause)'
    b' File "<string>", line 3, in raise_from'
    b'AssertionError: Calls not found.'
    b"Expected: [call('br-data', 'eth0', promisc=True)]"
    b''

only affects python3

Changed in charm-neutron-gateway:
status: New → Triaged
assignee: nobody → Chris MacNaughton (chris.macnaughton)
milestone: none → 19.04
milestone: 19.04 → 19.07

This issue basically affects all charms that have tests which use NeutronPortContext. The method 'list_nics' should now be mocked to return expected values.

See: https://github.com/juju/charm-helpers/commit/92a6feb5c16e0ee869cb15aea338d7db72b06a53

Fix proposed to branch: master
Review: https://review.opendev.org/659731

Changed in charm-neutron-gateway:
status: Triaged → In Progress

Reviewed: https://review.opendev.org/659731
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-gateway/commit/?id=75c1a037ade9a9228b2d5d233f8964eb67fc4763
Submitter: Zuul
Branch: master

commit 75c1a037ade9a9228b2d5d233f8964eb67fc4763
Author: Chris MacNaughton <email address hidden>
Date: Fri May 17 09:32:37 2019 +0200

    Add new list_nics mock

    Change-Id: Ia3812ab0a141c795296ddcaf1815ef687c15094d
    Closes-Bug: #1829465

Changed in charm-neutron-gateway:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers