Can't run quantum.tests.unit.test_dhcp_agent.TestDhcpAgentEventHandler solely

Bug #1156696 reported by Alexej Ababilov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Alexej Ababilov

Bug Description

TestDhcpAgentEventHandler tests cannot be run independently making difficult to use testr (that runs tests in parallel in an unpredictable order):

$ nosetests quantum.tests.unit.test_dhcp_agent:TestDhcpAgentEventHandler
quantum.tests.unit.test_dhcp_agent.TestDhcpAgentEventHandler.test_disable_dhcp_helper_driver_failure ... ERROR
quantum.tests.unit.test_dhcp_agent.TestDhcpAgentEventHandler.test_disable_dhcp_helper_known_network ... ERROR
quantum.tests.unit.test_dhcp_agent.TestDhcpAgentEventHandler.test_disable_dhcp_helper_unknown_network ... ERROR
quantum.tests.unit.test_dhcp_agent.TestDhcpAgentEventHandler.test_disable_isolated_metadata_proxy ... ERROR

...

======================================================================
ERROR: quantum.tests.unit.test_dhcp_agent.TestDhcpAgentEventHandler.test_disable_dhcp_helper_driver_failure
----------------------------------------------------------------------
_StringException: Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/tmp/quantum/quantum/tests/unit/test_dhcp_agent.py", line 426, in setUp
    self.dhcp = dhcp_agent.DhcpAgent(HOSTNAME)
  File "/tmp/quantum/quantum/agent/dhcp_agent.py", line 82, in __init__
    self._populate_networks_cache()
  File "/tmp/quantum/quantum/agent/dhcp_agent.py", line 90, in _populate_networks_cache
    self.root_helper
  File "/tmp/quantum/quantum/agent/linux/dhcp.py", line 228, in existing_dhcp_networks
    confs_dir = os.path.abspath(os.path.normpath(conf.dhcp_confs))
  File "/tmp/.venv/lib/python2.6/site-packages/oslo/config/cfg.py", line 1191, in __getattr__
    return self._get(name)
  File "/tmp/.venv/lib/python2.6/site-packages/oslo/config/cfg.py", line 1513, in _get
    value = self._substitute(self._do_get(name, group))
  File "/tmp/.venv/lib/python2.6/site-packages/oslo/config/cfg.py", line 1529, in _do_get
    info = self._get_opt_info(name, group)
  File "/tmp/.venv/lib/python2.6/site-packages/oslo/config/cfg.py", line 1629, in _get_opt_info
    raise NoSuchOptError(opt_name, group)
NoSuchOptError: no such option: dhcp_confs

These tests require importing an option from quantum.agent.linux.dhcp module.

Tags: unittest
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Changed in quantum:
assignee: nobody → Alessio Ababilov (aababilov)
status: New → In Progress
Changed in quantum:
importance: Undecided → Low
milestone: none → havana-1
tags: added: unittest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/24652
Committed: http://github.com/openstack/quantum/commit/37ad346a7da82575e5d6cdd3b90317fc50700957
Submitter: Jenkins
Branch: master

commit 37ad346a7da82575e5d6cdd3b90317fc50700957
Author: Alessio Ababilov <email address hidden>
Date: Mon Mar 18 18:48:30 2013 +0200

    Allow tests in TestDhcpAgentEventHandler run independently

    Tests in TestDhcpAgentEventHandler depend on dhcp_confs
    option that is defined in quantum.agent.linux.dhcp. We have
    to register the option in order to allow independent testing.

    This problem is similar to bug #1125951.

    Fixes: bug #1156696

    Change-Id: I323908c6f70697e056294b1817ff32ce5d32b32c

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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