Skip to content

Commit

Permalink
Allow tests from test_dhcp_agent run independently
Browse files Browse the repository at this point in the history
Some tests from test_dhcp_agent depend on each other
and cannot be run in arbitrary order. TestDhcpAgent
and TestDhcpAgentEventHandler need config options that
are initialized in other tests. This patch eliminates
such dependencies.

Fixes: bug #1125951
Change-Id: I10bc46a5e1244ea0f7a05a20bb162c50303f282e
  • Loading branch information
Alessio Ababilov committed Feb 15, 2013
1 parent 55fd446 commit 73e43ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions quantum/tests/unit/test_dhcp_agent.py
Expand Up @@ -86,6 +86,7 @@ def __str__(self):

class TestDhcpAgent(unittest.TestCase):
def setUp(self):
cfg.CONF.register_opts(dhcp_agent.DeviceManager.OPTS)
cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS)
cfg.CONF.register_opts(dhcp_agent.DhcpLeaseRelay.OPTS)
self.driver_cls_p = mock.patch(
Expand Down Expand Up @@ -267,6 +268,7 @@ def test_periodoc_resync_helper(self):
class TestDhcpAgentEventHandler(unittest.TestCase):
def setUp(self):
cfg.CONF.register_opts(dhcp_agent.DeviceManager.OPTS)
cfg.CONF.register_opts(dhcp_agent.DhcpLeaseRelay.OPTS)
cfg.CONF.set_override('interface_driver',
'quantum.agent.linux.interface.NullDriver')
config.register_root_helper(cfg.CONF)
Expand Down

0 comments on commit 73e43ac

Please sign in to comment.