unit test fails: test_openvswitch_odl_handlers.TestRegisteredHooks.test_hooks

Bug #1645473 reported by Ryan Beisner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack openvswitch-odl charm
Fix Released
Medium
Alex Kavanagh
neutron-api-odl (Juju Charms Collection)
Invalid
Undecided
Unassigned
openvswitch-odl (Juju Charms Collection)
Invalid
Medium
Alex Kavanagh

Bug Description

openvswitch-odl charm unit tests are failing:

unit_tests.test_openvswitch_odl_handlers.TestRegisteredHooks.test_hooks

http://logs.openstack.org/99/403899/1/check/gate-charm-openvswitch-odl-python35/e387f09/console.html

2016-11-28 20:57:26.838226 | ==============================
2016-11-28 20:57:26.838252 | Failed 1 tests - output below:
2016-11-28 20:57:26.838263 | ==============================
2016-11-28 20:57:26.838268 |
2016-11-28 20:57:26.838288 | unit_tests.test_openvswitch_odl_handlers.TestRegisteredHooks.test_hooks
2016-11-28 20:57:26.838554 | -----------------------------------------------------------------------
2016-11-28 20:57:26.838568 |
2016-11-28 20:57:26.838578 | Captured traceback:
2016-11-28 20:57:26.838589 | ~~~~~~~~~~~~~~~~~~~
2016-11-28 20:57:26.838603 | b'Traceback (most recent call last):'
2016-11-28 20:57:26.838641 | b' File "/home/jenkins/workspace/gate-charm-openvswitch-odl-python35/unit_tests/test_openvswitch_odl_handlers.py", line 53, in test_hooks'
2016-11-28 20:57:26.838665 | b' self.registered_hooks_test_helper(handlers, hook_set, defaults)'
2016-11-28 20:57:26.838713 | b' File "/home/jenkins/workspace/gate-charm-openvswitch-odl-python35/.tox/py35/lib/python3.5/site-packages/charms_openstack/test_utils.py", line 227, in registered_hooks_test_helper'
2016-11-28 20:57:26.838732 | b' "for function \'{}\'".format(f))'
2016-11-28 20:57:26.838755 | b' File "/usr/lib/python3.5/unittest/case.py", line 820, in assertEqual'
2016-11-28 20:57:26.838771 | b' assertion_func(first, second, msg=msg)'
2016-11-28 20:57:26.838795 | b' File "/usr/lib/python3.5/unittest/case.py", line 1018, in assertListEqual'
2016-11-28 20:57:26.838816 | b' self.assertSequenceEqual(list1, list2, msg, seq_type=list)'
2016-11-28 20:57:26.838852 | b' File "/usr/lib/python3.5/unittest/case.py", line 1000, in assertSequenceEqual'
2016-11-28 20:57:26.838876 | b' self.fail(msg)'
2016-11-28 20:57:26.838896 | b' File "/usr/lib/python3.5/unittest/case.py", line 665, in fail'
2016-11-28 20:57:26.838910 | b' raise self.failureException(msg)'
2016-11-28 20:57:26.838938 | b"AssertionError: Lists differ: ['charm.installed'] != ['charm.installed', 'ovsdb-manager.access.available']"
2016-11-28 20:57:26.838947 | b''
2016-11-28 20:57:26.838963 | b'Second list contains 1 additional elements.'
2016-11-28 20:57:26.838974 | b'First extra element 1:'
2016-11-28 20:57:26.838987 | b"'ovsdb-manager.access.available'"
2016-11-28 20:57:26.838994 | b''
2016-11-28 20:57:26.839005 | b"- ['charm.installed']"
2016-11-28 20:57:26.839035 | b"+ ['charm.installed', 'ovsdb-manager.access.available'] : for function 'configure_openvswitch'"
2016-11-28 20:57:26.839042 | b''

Tags: uosci
Ryan Beisner (1chb1n)
summary: - unit_tests.test_openvswitch_odl_handlers.TestRegisteredHooks.test_hooks
+ unit test fails:
+ test_openvswitch_odl_handlers.TestRegisteredHooks.test_hooks
Ryan Beisner (1chb1n)
Changed in neutron-api-odl (Juju Charms Collection):
status: New → Invalid
Revision history for this message
Liam Young (gnuoy) wrote :

The error appears to be coming from the helper function registered_hooks_test_helper from charms_openstack.test_utils.

I added some debug to the test to output the value of self._hooks after the importlib.reload(module) in registered_hooks_test_helper and it shows:

{'when': {'configure_openvswitch': [{'kwargs': {}, 'args': ('ovsdb-manager.access.available',)}, {'kwargs': {}, 'args': ('charm.installed',)}], 'odl_mac_registration': [{'kwargs': {}, 'args': ('controller-api.access.available',)}], 'default_config_changed': [{'kwargs': {}, 'args': ('config.changed',)}], 'unconfigure_openvswitch': [{'kwargs': {}, 'args': ('ovs.configured',)}], 'configure_neutron_plugin': [{'kwargs': {}, 'args': ('neutron-plugin.connected',)}], 'odl_node_registration': [{'kwargs': {}, 'args': ('controller-api.access.available',)}]}, 'when_not': {'default_install': [{'kwargs': {}, 'args': ('charm.installed',)}], 'unconfigure_openvswitch': [{'kwargs': {}, 'args': ('ovsdb-manager.access.available',)}]}, 'hook': {'default_update_status': [{'kwargs': {}, 'args': ('update-status',)}]}}

which shows that charm.installed is missing from configure_openvswitch args

Changed in openvswitch-odl (Juju Charms Collection):
assignee: nobody → Alex Kavanagh (ajkavanagh)
Changed in openvswitch-odl (Juju Charms Collection):
status: New → In Progress
Changed in openvswitch-odl (Juju Charms Collection):
status: In Progress → Fix Committed
Liam Young (gnuoy)
Changed in openvswitch-odl (Juju Charms Collection):
importance: Undecided → Medium
milestone: none → 17.01
James Page (james-page)
Changed in charm-openvswitch-odl:
assignee: nobody → Alex Kavanagh (ajkavanagh)
importance: Undecided → Medium
status: New → Fix Committed
Changed in openvswitch-odl (Juju Charms Collection):
status: Fix Committed → Invalid
James Page (james-page)
Changed in charm-openvswitch-odl:
milestone: none → 17.02
James Page (james-page)
Changed in charm-openvswitch-odl:
status: Fix Committed → Fix Released
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.