From 2f649454ef96abe4d338b3e424121d52617d2657 Mon Sep 17 00:00:00 2001 From: Alessio Ababilov Date: Fri, 15 Feb 2013 09:52:24 +0200 Subject: [PATCH] Allow tests from test_dhcp_agent run independently 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 --- quantum/tests/unit/test_dhcp_agent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quantum/tests/unit/test_dhcp_agent.py b/quantum/tests/unit/test_dhcp_agent.py index f7f3ed0ed0..26b5bf89e9 100644 --- a/quantum/tests/unit/test_dhcp_agent.py +++ b/quantum/tests/unit/test_dhcp_agent.py @@ -86,6 +86,7 @@ fake_down_network = FakeModel('12345678-dddd-dddd-1234567890ab', 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( @@ -267,6 +268,7 @@ class TestDhcpAgent(unittest.TestCase): 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)