]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove individual cfg.CONF.resets from tests
authorHenry Gessau <gessau@cisco.com>
Wed, 12 Mar 2014 05:36:13 +0000 (01:36 -0400)
committerHenry Gessau <gessau@cisco.com>
Mon, 17 Mar 2014 16:34:56 +0000 (12:34 -0400)
oslo.config.CONF.reset is added to cleanup in BaseTestCase, so it does
not need to be done by individual test cases.

Change-Id: I5fced5c2d480e78e5bb7cc150f0b653313884456
Closes-Bug: #1291144

41 files changed:
neutron/tests/unit/cisco/n1kv/test_n1kv_plugin.py
neutron/tests/unit/cisco/test_network_plugin.py
neutron/tests/unit/cisco/test_nexus_plugin.py
neutron/tests/unit/cisco/test_plugin_model.py
neutron/tests/unit/db/loadbalancer/test_db_loadbalancer.py
neutron/tests/unit/embrane/test_embrane_l3_plugin.py
neutron/tests/unit/embrane/test_embrane_neutron_plugin.py
neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py
neutron/tests/unit/ibm/test_sdnve_agent.py
neutron/tests/unit/ibm/test_sdnve_api.py
neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py
neutron/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py
neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py
neutron/tests/unit/ml2/drivers/test_bigswitch_mech.py
neutron/tests/unit/ml2/drivers/test_l2population.py
neutron/tests/unit/ml2/test_mechanism_ncs.py
neutron/tests/unit/ml2/test_ml2_plugin.py
neutron/tests/unit/ml2/test_port_binding.py
neutron/tests/unit/ml2/test_type_vxlan.py
neutron/tests/unit/nec/test_nec_agent.py
neutron/tests/unit/oneconvergence/test_nvsd_agent.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py
neutron/tests/unit/services/loadbalancer/agent/test_agent.py
neutron/tests/unit/test_agent_ext_plugin.py
neutron/tests/unit/test_agent_netns_cleanup.py
neutron/tests/unit/test_agent_ovs_cleanup.py
neutron/tests/unit/test_api_v2.py
neutron/tests/unit/test_db_migration.py
neutron/tests/unit/test_db_plugin.py
neutron/tests/unit/test_dhcp_agent.py
neutron/tests/unit/test_extension_extended_attribute.py
neutron/tests/unit/test_extension_pnet.py
neutron/tests/unit/test_neutron_manager.py
neutron/tests/unit/test_quota_ext.py
neutron/tests/unit/test_routerserviceinsertion.py
neutron/tests/unit/test_servicetype.py
neutron/tests/unit/vmware/extensions/test_maclearning.py
neutron/tests/unit/vmware/extensions/test_networkgw.py
neutron/tests/unit/vmware/test_agent_scheduler.py
neutron/tests/unit/vmware/test_dhcpmeta.py
neutron/tests/unit/vmware/test_nsx_sync.py

index 40fc4b8e42f72c681321513ffaa3ee7e23c4109d..81b3c91db33ecb33e1a6a9005746bc0f7d71c953 100644 (file)
@@ -18,7 +18,6 @@
 # @author: Abhishek Raut, Cisco Systems Inc.
 
 from mock import patch
-from oslo.config import cfg
 
 from neutron.api import extensions as neutron_extensions
 from neutron.api.v2 import attributes
@@ -201,7 +200,6 @@ class N1kvPluginTestCase(test_plugin.NeutronDbPluginV2TestCase):
         n1kv_neutron_plugin.N1kvNeutronPluginV2._setup_vsm = _fake_setup_vsm
 
         neutron_extensions.append_api_extensions_path(extensions.__path__)
-        self.addCleanup(cfg.CONF.reset)
         ext_mgr = NetworkProfileTestExtensionManager()
 
         # Save the original RESOURCE_ATTRIBUTE_MAP
index 23f4f41c262e388df36486f40f4c3927614101d4..bbff6b8488e59ff3ce7dfac871f9c74bc68d68e6 100644 (file)
@@ -101,7 +101,6 @@ class CiscoNetworkPluginV2TestCase(test_db_plugin.NeutronDbPluginV2TestCase):
             for group in config[module]:
                 for opt, val in config[module][group].items():
                     module.cfg.CONF.set_override(opt, val, group)
-            self.addCleanup(module.cfg.CONF.reset)
 
         # Configure the Nexus switch dictionary
         # TODO(Henry): add tests for other devices
@@ -1012,7 +1011,6 @@ class TestCiscoRouterInterfacesV2(CiscoNetworkPluginV2TestCase):
         super(TestCiscoRouterInterfacesV2, self).setUp()
         ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
         self.ext_api = test_extensions.setup_extensions_middleware(ext_mgr)
-        self.addCleanup(cisco_config.CONF.reset)
 
     @contextlib.contextmanager
     def _network_subnet_router(self):
index 3379cb842484425971fca9293eb540405a8910cf..395c406431d5e7c9ff7e9a45d5f297018a956843 100644 (file)
@@ -189,7 +189,6 @@ class TestCiscoNexusPlugin(base.BaseTestCase):
             'provider_vlan_auto_create', auto_create, 'CISCO')
         cfg.CONF.set_override(
             'provider_vlan_auto_trunk', auto_trunk, 'CISCO')
-        self.addCleanup(cfg.CONF.reset)
         with mock.patch.object(cdb, 'is_provider_vlan',
                                return_value=True) as mock_db:
             # Create a provider network
index dd0b22504d9384d5a99deee1c214b5e76bbda2a2..a87f9aad56267a0390e3ee41117b147eb0a9566d 100755 (executable)
@@ -36,8 +36,6 @@ class TestCiscoPluginModel(base.BaseTestCase):
 
         super(TestCiscoPluginModel, self).setUp()
 
-        self.addCleanup(cisco_config.CONF.reset)
-
     def test_non_nexus_device_driver(self):
         """Tests handling of an non-Nexus device driver being configured."""
         with mock.patch.dict(sys.modules, {'mock_driver': mock.Mock()}):
index bda949f51844da65d4fa80d9d05d10fa9e306e83..8a2c8e6a315e8ac31ac8573c9ba4e12cb7c18dde 100644 (file)
@@ -352,15 +352,11 @@ class LoadBalancerPluginDbTestCase(LoadBalancerTestMixin,
         mock_lbaas_agent = mock.MagicMock()
         get_lbaas_agent_patcher.start().return_value = mock_lbaas_agent
         mock_lbaas_agent.__getitem__.return_value = {'host': 'host'}
-        self.addCleanup(cfg.CONF.reset)
 
         self._subnet_id = _subnet_id
 
 
 class TestLoadBalancer(LoadBalancerPluginDbTestCase):
-    def setUp(self):
-        self.addCleanup(cfg.CONF.reset)
-        super(TestLoadBalancer, self).setUp()
 
     def test_create_vip(self, **extras):
         expected = {
index 05a185e59f8702f6c61ceb3893a95c220f3dbfa7..5bdc9f8808c046728945d624cbca9117709c8119 100644 (file)
@@ -37,7 +37,6 @@ class TestEmbraneL3NatDBTestCase(router_test.L3NatDBIntTestCase):
 
     def setUp(self):
         cfg.CONF.set_override('admin_password', "admin123", 'heleos')
-        self.addCleanup(cfg.CONF.reset)
         self.addCleanup(db.clear_db)
         super(TestEmbraneL3NatDBTestCase, self).setUp()
 
index 4594de97106fedf6bb068ab0e87c1e8a58f90c06..bc96b2681db2c7108aaa1954f20dd4632d8e3f6e 100644 (file)
@@ -36,7 +36,6 @@ class EmbranePluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase):
 
     def setUp(self):
         cfg.CONF.set_override('admin_password', "admin123", 'heleos')
-        self.addCleanup(cfg.CONF.reset)
         self.addCleanup(db.clear_db)
         super(EmbranePluginV2TestCase, self).setUp(self._plugin_name)
 
index 28455c6b203575fc293dd937e2ca66a6177a2e3e..cee443c9792f1cbc030877f8784ee9c49bfa7b2d 100644 (file)
@@ -36,7 +36,6 @@ class TestHyperVNeutronAgent(base.BaseTestCase):
 
     def setUp(self):
         super(TestHyperVNeutronAgent, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
         # Avoid rpc initialization for unit tests
         cfg.CONF.set_override('rpc_backend',
                               'neutron.openstack.common.rpc.impl_fake')
index 3042d3d8c41009fdc772c4845aa1f96899e1a0c3..aef694cb7fd866fd9874e5890d3480aa245a23f8 100644 (file)
@@ -37,14 +37,12 @@ class CreateAgentConfigMap(base.BaseTestCase):
         self.assertTrue(sdnve_neutron_agent.create_agent_config_map(cfg.CONF))
 
     def test_create_agent_config_using_controller_ips(self):
-        self.addCleanup(cfg.CONF.reset)
         cfg.CONF.set_override('controller_ips',
                               ['10.10.10.1', '10.10.10.2'], group='SDNVE')
         cfgmap = sdnve_neutron_agent.create_agent_config_map(cfg.CONF)
         self.assertEqual(cfgmap['controller_ip'], '10.10.10.1')
 
     def test_create_agent_config_using_interface_mappings(self):
-        self.addCleanup(cfg.CONF.reset)
         cfg.CONF.set_override('interface_mappings',
                               ['interface1 : eth1', 'interface2 : eth2'],
                               group='SDNVE')
@@ -57,7 +55,6 @@ class TestSdnveNeutronAgent(base.BaseTestCase):
 
     def setUp(self):
         super(TestSdnveNeutronAgent, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
         notifier_p = mock.patch(NOTIFIER)
         notifier_cls = notifier_p.start()
         self.notifier = mock.Mock()
index ba76e055612eb3075332f6ec943174b21dbb5da4..ff54078de4a29b15a997dbe32d7e46556ff10b2c 100644 (file)
@@ -18,7 +18,6 @@
 
 
 import mock
-from oslo.config import cfg
 
 from neutron.openstack.common import uuidutils
 from neutron.plugins.ibm.common import constants
@@ -37,7 +36,6 @@ class TestSdnveApi(base.BaseTestCase):
 
     def setUp(self):
         super(TestSdnveApi, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
 
         class MockKeystoneClient(object):
             def __init__(self, **kwargs):
index 256707b5bb149a29a272e9497a3b7e60745f832f..ed4a21fba3875948b7f0a03e94f03fefd43931dc 100644 (file)
@@ -47,7 +47,6 @@ class TestLinuxBridge(base.BaseTestCase):
 
     def setUp(self):
         super(TestLinuxBridge, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
         interface_mappings = {'physnet1': 'eth1'}
         root_helper = cfg.CONF.AGENT.root_helper
 
@@ -704,7 +703,6 @@ class TestLinuxBridgeManager(base.BaseTestCase):
 class TestLinuxBridgeRpcCallbacks(base.BaseTestCase):
     def setUp(self):
         cfg.CONF.set_override('local_ip', LOCAL_IP, 'VXLAN')
-        self.addCleanup(cfg.CONF.reset)
         super(TestLinuxBridgeRpcCallbacks, self).setUp()
 
         self.u_execute_p = mock.patch('neutron.agent.linux.utils.execute')
index 439f428992b55a27c00d0ceae67ff7801e1e723d..2dac0fe2a24c4439cb4d24f38d5de19db4937a93 100644 (file)
@@ -45,8 +45,6 @@ class TestBrocadeMechDriverV2(test_db_plugin.NeutronDbPluginV2TestCase):
         for opt, val in ml2_opts.items():
             ml2_config.cfg.CONF.set_override(opt, val, 'ml2')
 
-        self.addCleanup(ml2_config.cfg.CONF.reset)
-
         def mocked_brocade_init(self):
             self._driver = mock.MagicMock()
 
index e35cd9b0d2977ffe395cc66bce9513e9ba3e638b..968d6f06a2878e9d2aff2d7a50a6bed5b812b346 100644 (file)
@@ -72,14 +72,12 @@ class CiscoML2MechanismTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
         }
         for opt, val in ml2_opts.items():
                 ml2_config.cfg.CONF.set_override(opt, val, 'ml2')
-        self.addCleanup(ml2_config.cfg.CONF.reset)
 
         # Configure the ML2 VLAN parameters
         phys_vrange = ':'.join([PHYS_NET, str(VLAN_START), str(VLAN_END)])
         vlan_config.cfg.CONF.set_override('network_vlan_ranges',
                                           [phys_vrange],
                                           'ml2_type_vlan')
-        self.addCleanup(vlan_config.cfg.CONF.reset)
 
         # Configure the Cisco Nexus mechanism driver
         nexus_config = {
index c1d3c527797b2f00f1f56e974bd6e1fb9c7a9974..fb10cceee9defc163fad29f22929b6e2929887a6 100644 (file)
@@ -46,14 +46,12 @@ class TestBigSwitchMechDriverBase(trp.BigSwitchProxyPluginV2TestCase):
         }
         for opt, val in ml2_opts.items():
                 ml2_config.cfg.CONF.set_override(opt, val, 'ml2')
-        self.addCleanup(ml2_config.cfg.CONF.reset)
 
         # Configure the ML2 VLAN parameters
         phys_vrange = ':'.join([PHYS_NET, str(VLAN_START), str(VLAN_END)])
         vlan_config.cfg.CONF.set_override('network_vlan_ranges',
                                           [phys_vrange],
                                           'ml2_type_vlan')
-        self.addCleanup(vlan_config.cfg.CONF.reset)
         super(TestBigSwitchMechDriverBase,
               self).setUp(ML2_PLUGIN)
 
index 2698b3db37144457febe959b521491fc80a5784b..aff42ea3844af95a633618dd5379c3460feb43c7 100644 (file)
@@ -83,7 +83,6 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
                                       'l2population'],
                                      'ml2')
         super(TestL2PopulationRpcTestCase, self).setUp(PLUGIN_NAME)
-        self.addCleanup(config.cfg.CONF.reset)
 
         self.adminContext = context.get_admin_context()
 
index 2e1c23551bbc8fdbbb88c62e94f6bbd9419ccbe9..9ae267823fce2186169a6198196d4a7d5cdd9ea8 100644 (file)
@@ -29,7 +29,6 @@ class NCSTestCase(test_plugin.NeutronDbPluginV2TestCase):
         config.cfg.CONF.set_override('mechanism_drivers',
                                      ['logger', 'ncs'],
                                      'ml2')
-        self.addCleanup(config.cfg.CONF.reset)
         super(NCSTestCase, self).setUp(PLUGIN_NAME)
         self.port_create_status = 'DOWN'
         mechanism_ncs.NCSMechanismDriver.sendjson = self.check_sendjson
index caeeb7a93bee04b867aa8e5ca2f13843d474693c..8c8cc6466ddc01a76930c60c5e13902317edbe93 100644 (file)
@@ -56,7 +56,6 @@ class Ml2PluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase):
         self.phys_vrange = ':'.join([self.physnet, self.vlan_range])
         config.cfg.CONF.set_override('network_vlan_ranges', [self.phys_vrange],
                                      group='ml2_type_vlan')
-        self.addCleanup(config.cfg.CONF.reset)
         super(Ml2PluginV2TestCase, self).setUp(PLUGIN_NAME,
                                                service_plugins=service_plugins)
         self.port_create_status = 'DOWN'
index f8946f76a95fbe75dfdcf76fc23f00d86fd8adc6..26c03166ff36b70effd5ce6379ab31c4985da98a 100644 (file)
@@ -36,7 +36,6 @@ class PortBindingTestCase(test_plugin.NeutronDbPluginV2TestCase):
         config.cfg.CONF.set_override('mechanism_drivers',
                                      ['logger', 'test'],
                                      'ml2')
-        self.addCleanup(config.cfg.CONF.reset)
         super(PortBindingTestCase, self).setUp(PLUGIN_NAME)
         self.port_create_status = 'DOWN'
         self.plugin = manager.NeutronManager.get_plugin()
index 1aad48e755229345a90cc82abe4fc4b18ef7300e..2e3c0adc33c820ecd03f8126c4668a130de094b5 100644 (file)
@@ -50,7 +50,6 @@ class VxlanTypeTest(base.BaseTestCase):
         self.driver.vxlan_vni_ranges = TUNNEL_RANGES
         self.driver._sync_vxlan_allocations()
         self.session = db.get_session()
-        self.addCleanup(cfg.CONF.reset)
         self.addCleanup(db.clear_db)
 
     def test_vxlan_tunnel_type(self):
index 2e45306159d633af1040255d1c52e2491c865ff8..35f28998ec1840e3e941ceb282e9d95c7ee88fa9 100644 (file)
@@ -37,7 +37,6 @@ class TestNecAgentBase(base.BaseTestCase):
 
     def setUp(self):
         super(TestNecAgentBase, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
         cfg.CONF.set_override('rpc_backend',
                               'neutron.openstack.common.rpc.impl_fake')
         cfg.CONF.set_override('host', 'dummy-host')
index d36e4934e84364a3f554c5393f80ae633bcdfa09..2559f9ccb77307bcc6f7ade41e9211a597c69f96 100644 (file)
@@ -33,7 +33,6 @@ class TestOneConvergenceAgentBase(base.BaseTestCase):
 
     def setUp(self):
         super(TestOneConvergenceAgentBase, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
         cfg.CONF.set_override('rpc_backend',
                               'neutron.openstack.common.rpc.impl_fake')
         with contextlib.nested(
index 4849eddf34f24f12e100c3e5befeaef2abfe413a..56aa12b160eef4e4bc6405c3efc0d2e1c49c0a11 100644 (file)
@@ -41,7 +41,6 @@ class CreateAgentConfigMap(base.BaseTestCase):
         self.assertTrue(ovs_neutron_agent.create_agent_config_map(cfg.CONF))
 
     def test_create_agent_config_map_fails_for_invalid_tunnel_config(self):
-        self.addCleanup(cfg.CONF.reset)
         # An ip address is required for tunneling but there is no default,
         # verify this for both gre and vxlan tunnels.
         cfg.CONF.set_override('tunnel_types', [p_const.TYPE_GRE],
@@ -54,7 +53,6 @@ class CreateAgentConfigMap(base.BaseTestCase):
             ovs_neutron_agent.create_agent_config_map(cfg.CONF)
 
     def test_create_agent_config_map_enable_tunneling(self):
-        self.addCleanup(cfg.CONF.reset)
         # Verify setting only enable_tunneling will default tunnel_type to GRE
         cfg.CONF.set_override('tunnel_types', None, group='AGENT')
         cfg.CONF.set_override('enable_tunneling', True, group='OVS')
@@ -63,20 +61,17 @@ class CreateAgentConfigMap(base.BaseTestCase):
         self.assertEqual(cfgmap['tunnel_types'], [p_const.TYPE_GRE])
 
     def test_create_agent_config_map_fails_no_local_ip(self):
-        self.addCleanup(cfg.CONF.reset)
         # An ip address is required for tunneling but there is no default
         cfg.CONF.set_override('enable_tunneling', True, group='OVS')
         with testtools.ExpectedException(ValueError):
             ovs_neutron_agent.create_agent_config_map(cfg.CONF)
 
     def test_create_agent_config_map_fails_for_invalid_tunnel_type(self):
-        self.addCleanup(cfg.CONF.reset)
         cfg.CONF.set_override('tunnel_types', ['foobar'], group='AGENT')
         with testtools.ExpectedException(ValueError):
             ovs_neutron_agent.create_agent_config_map(cfg.CONF)
 
     def test_create_agent_config_map_multiple_tunnel_types(self):
-        self.addCleanup(cfg.CONF.reset)
         cfg.CONF.set_override('local_ip', '10.10.10.10', group='OVS')
         cfg.CONF.set_override('tunnel_types', [p_const.TYPE_GRE,
                               p_const.TYPE_VXLAN], group='AGENT')
@@ -89,7 +84,6 @@ class TestOvsNeutronAgent(base.BaseTestCase):
 
     def setUp(self):
         super(TestOvsNeutronAgent, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
         notifier_p = mock.patch(NOTIFIER)
         notifier_cls = notifier_p.start()
         self.notifier = mock.Mock()
@@ -763,7 +757,6 @@ class AncillaryBridgesTest(base.BaseTestCase):
 
     def setUp(self):
         super(AncillaryBridgesTest, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
         notifier_p = mock.patch(NOTIFIER)
         notifier_cls = notifier_p.start()
         self.notifier = mock.Mock()
index 2ff2e895327259ec1437fabe1ccc1d9d3488dd78..ef66e29219af819d279b18cac5c33200fd3fa1fe 100644 (file)
@@ -25,10 +25,6 @@ from neutron.tests import base
 
 
 class TestLbaasService(base.BaseTestCase):
-    def setUp(self):
-        super(TestLbaasService, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
-
     def test_start(self):
         with mock.patch.object(
             agent.rpc_service.Service, 'start'
index 7dd528e289c25150492018d14c3183bc265b7651..a685e8a9b6d4fff162afcae5995ef4d1b1e8b2f0 100644 (file)
@@ -177,7 +177,6 @@ class AgentDBTestCase(AgentDBTestMixIn,
             self.saved_attr_map[resource] = attrs.copy()
         ext_mgr = AgentTestExtensionManager()
         self.addCleanup(self.restore_resource_attribute_map)
-        self.addCleanup(cfg.CONF.reset)
         super(AgentDBTestCase, self).setUp(plugin=plugin, ext_mgr=ext_mgr)
 
     def restore_resource_attribute_map(self):
index 4c691151fd07b1b90dedbc0d9906cc4cf3bf2f45..dddd4837334888476b037378232ce4be759dfb66 100644 (file)
 #    under the License.
 
 import mock
-from oslo.config import cfg
 
 from neutron.agent import netns_cleanup_util as util
 from neutron.tests import base
 
 
 class TestNetnsCleanup(base.BaseTestCase):
-    def setUp(self):
-        super(TestNetnsCleanup, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
 
     def test_kill_dhcp(self, dhcp_active=True):
         conf = mock.Mock()
index 0cdc2647d554b8674a3b6016d6a06060886cd010..defdf5a2c5a8cfbd68ea46a0dbc0ee91b8f223ea 100644 (file)
@@ -18,7 +18,6 @@
 import contextlib
 import itertools
 import mock
-from oslo.config import cfg
 
 from neutron.agent.linux import ip_lib
 from neutron.agent.linux import ovs_lib
@@ -28,9 +27,6 @@ from neutron.tests import base
 
 
 class TestOVSCleanup(base.BaseTestCase):
-    def setUp(self):
-        super(TestOVSCleanup, self).setUp()
-        self.addCleanup(cfg.CONF.reset)
 
     def test_setup_conf(self):
         conf = util.setup_conf()
index cbe45304ad2d0f663e3d2df287b75a57e892aade..1e501493644869dc2ce20f392886324843aa7646 100644 (file)
@@ -113,7 +113,6 @@ class APIv2TestBase(base.BaseTestCase):
         instance._NeutronPluginBaseV2__native_pagination_support = True
         instance._NeutronPluginBaseV2__native_sorting_support = True
         self.addCleanup(self._plugin_patcher.stop)
-        self.addCleanup(cfg.CONF.reset)
 
         api = router.APIRouter()
         self.api = webtest.TestApp(api)
@@ -1144,7 +1143,6 @@ class SubresourceTest(base.BaseTestCase):
         self._plugin_patcher = mock.patch(plugin, autospec=True)
         self.plugin = self._plugin_patcher.start()
         self.addCleanup(self._plugin_patcher.stop)
-        self.addCleanup(cfg.CONF.reset)
 
         router.SUB_RESOURCES['dummy'] = {
             'collection_name': 'dummies',
@@ -1387,7 +1385,6 @@ class ExtensionTestCase(base.BaseTestCase):
         self._plugin_patcher.stop()
         self.api = None
         self.plugin = None
-        cfg.CONF.reset()
         # Restore the global RESOURCE_ATTRIBUTE_MAP
         attributes.RESOURCE_ATTRIBUTE_MAP = self.saved_attr_map
 
index 2c3a7928fc1ddea232f19129c9c51f5a40b8f758..83c2ede4f953964ec01f47f4915bc9fcbed55e9e 100644 (file)
@@ -41,7 +41,6 @@ class TestCli(base.BaseTestCase):
         self.do_alembic_cmd_p = mock.patch.object(cli, 'do_alembic_command')
         self.do_alembic_cmd = self.do_alembic_cmd_p.start()
         self.addCleanup(self.do_alembic_cmd_p.stop)
-        self.addCleanup(cli.CONF.reset)
 
     def _main_test_helper(self, argv, func_name, exp_args=(), exp_kwargs={}):
         with mock.patch.object(sys, 'argv', argv):
index a23a3a7bc271958a9bc5011bf99797e5eccd36be..b5593fb13d782c105ac63e333c0cdea7ecc97312 100644 (file)
@@ -160,7 +160,6 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase):
         # NOTE(jkoelker) for a 'pluggable' framework, Neutron sure
         #                doesn't like when the plugin changes ;)
         db.clear_db()
-        cfg.CONF.reset()
         # Restore the original attribute map
         attributes.RESOURCE_ATTRIBUTE_MAP = self._attribute_map_bk
         super(NeutronDbPluginV2TestCase, self).tearDown()
index 711c287d1982e271211caa53f65e245c3d5cb904..5ef5e7aa2b68f71cdec18f7933d841d6f9395476 100644 (file)
@@ -490,7 +490,6 @@ class TestDhcpAgentEventHandler(base.BaseTestCase):
         self.plugin_p.stop()
         self.mock_makedirs_p.stop()
         self.mock_init_p.stop()
-        cfg.CONF.reset()
         super(TestDhcpAgentEventHandler, self).tearDown()
 
     def _enable_dhcp_helper(self, isolated_metadata=False):
@@ -1118,7 +1117,6 @@ class TestDeviceManager(base.BaseTestCase):
         self.dvr_cls_p.stop()
         self.device_exists_p.stop()
         self.iproute_cls_p.stop()
-        cfg.CONF.reset()
         super(TestDeviceManager, self).tearDown()
 
     def _test_setup_helper(self, device_exists, reuse_existing=False,
index b09d0ef93e636c351b361b870385dcaad418b489..3d7c0283c368620b5c0bfdc6d948a9c6319d7858 100644 (file)
@@ -104,7 +104,6 @@ class ExtensionExtendedAttributeTestCase(base.BaseTestCase):
         attributes.RESOURCE_ATTRIBUTE_MAP.update(
             extattr.EXTENDED_ATTRIBUTES_2_0)
         self.agentscheduler_dbMinxin = manager.NeutronManager.get_plugin()
-        self.addCleanup(cfg.CONF.reset)
         self.addCleanup(self.restore_attribute_map)
 
         quota.QUOTAS._driver = None
index 8040ff551e1965b4cdbad7b9488ea5cd4c0ae2af..d75cbfc2c81f525c36c1676c9114280df36fecd8 100644 (file)
@@ -82,7 +82,6 @@ class ProvidernetExtensionTestCase(testlib_api.WebTestCase):
         ext_mgr = ProviderExtensionManager()
         self.ext_mdw = test_extensions.setup_extensions_middleware(ext_mgr)
         self.addCleanup(self._plugin_patcher.stop)
-        self.addCleanup(cfg.CONF.reset)
         self.addCleanup(self._restore_attribute_map)
         self.api = webtest.TestApp(router.APIRouter())
 
index ab5d73156d83baa88025e6af1baff003a8bb9a6c..65bb8dc52245dd6d5905ca4c8f874265465ac302 100644 (file)
@@ -59,7 +59,6 @@ class NeutronManagerTestCase(base.BaseTestCase):
         # If test_config specifies some config-file, use it, as well
         config.parse(args=args)
         self.setup_coreplugin()
-        self.addCleanup(cfg.CONF.reset)
         self.useFixture(
             fixtures.MonkeyPatch('neutron.manager.NeutronManager._instance'))
 
index 7c395c1331a0394da3444e67c98dd2253ac1cf2e..0d88d937177619db244ec222592a91d5aa3bb949 100644 (file)
@@ -82,7 +82,6 @@ class QuotaExtensionTestCase(testlib_api.WebTestCase):
         self.api = None
         self.plugin = None
         db.clear_db()
-        cfg.CONF.reset()
 
         # Restore the global RESOURCE_ATTRIBUTE_MAP
         attributes.RESOURCE_ATTRIBUTE_MAP = self.saved_attr_map
index 712d71838625e8f690a74bd57ced9979e1a3e5f5..b1043d919c29a311d9209d0fc132e05008552259 100644 (file)
@@ -170,7 +170,6 @@ class RouterServiceInsertionTestCase(base.BaseTestCase):
         self.setup_coreplugin(plugin)
         cfg.CONF.set_override('service_plugins', [])
         cfg.CONF.set_override('quota_router', -1, group='QUOTAS')
-        self.addCleanup(cfg.CONF.reset)
 
         # Ensure existing ExtensionManager is not used
 
@@ -197,7 +196,6 @@ class RouterServiceInsertionTestCase(base.BaseTestCase):
     def tearDown(self):
         self.api = None
         db.clear_db()
-        cfg.CONF.reset()
         super(RouterServiceInsertionTestCase, self).tearDown()
 
     def _setup_core_resources(self):
index f3bdb1c8bfbd7831b41a97ba16426894340b28aa..135c87b0baf1804a6b04ab5851d449e7b52905fc 100644 (file)
@@ -179,7 +179,6 @@ class ServiceTypeExtensionTestCaseBase(testlib_api.WebTestCase):
         cfg.CONF.set_override('service_plugins',
                               ["%s.%s" % (dp.__name__,
                                           dp.DummyServicePlugin.__name__)])
-        self.addCleanup(cfg.CONF.reset)
         # Ensure existing ExtensionManager is not used
         extensions.PluginAwareExtensionManager._instance = None
         ext_mgr = TestServiceTypeExtensionManager()
index 10a7dc19a471c6bcbe27823f15aac8dfd889dc9d..af7125c6893cbba4263450c0ae9120f4c5be9d4c 100644 (file)
@@ -77,7 +77,6 @@ class MacLearningDBTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
         cfg.CONF.set_override('metadata_mode', None, 'NSX')
         self.addCleanup(self.fc.reset_all)
         self.addCleanup(self.restore_resource_attribute_map)
-        self.addCleanup(cfg.CONF.reset)
         super(MacLearningDBTestCase, self).setUp(plugin=PLUGIN_NAME,
                                                  ext_mgr=ext_mgr)
 
index 54e328e9c9706ce0ad634223b8b3944c8be78563..6c81f9c33c41bbe3192bdd2ab8fd79dd79c7839f 100644 (file)
@@ -81,7 +81,6 @@ class NetworkGatewayExtensionTestCase(base.BaseTestCase):
 
         # Update the plugin and extensions path
         self.setup_coreplugin(plugin)
-        self.addCleanup(cfg.CONF.reset)
 
         _plugin_patcher = mock.patch(plugin, autospec=True)
         self.plugin = _plugin_patcher.start()
index 9033ab522c74778663aebcc8214894b5273dbb80..a33dfd99696a17f2841fe15891fbec1771fc4931 100644 (file)
@@ -49,7 +49,6 @@ class DhcpAgentNotifierTestCase(test_base.OvsDhcpAgentNotifierTestCase):
         self.addCleanup(self.fc.reset_all)
         self.addCleanup(patch_sync.stop)
         self.addCleanup(self.mock_nsx_api.stop)
-        self.addCleanup(cfg.CONF.reset)
 
     def _test_gateway_subnet_notification(self, gateway='10.0.0.1'):
         cfg.CONF.set_override('metadata_mode', 'dhcp_host_route', 'NSX')
index 84ddb184cd921913380a4f3328806003cd132459..5b737bde90352ce437b2b8ada599fcfe216cfd3c 100644 (file)
@@ -268,7 +268,6 @@ class LsnManagerTestCase(base.BaseTestCase):
         self.mock_lsn_api = self.mock_lsn_api_p.start()
         nsx.register_dhcp_opts(cfg)
         nsx.register_metadata_opts(cfg)
-        self.addCleanup(cfg.CONF.reset)
         self.addCleanup(self.mock_lsn_api_p.stop)
 
     def test_lsn_get(self):
@@ -703,7 +702,6 @@ class PersistentLsnManagerTestCase(base.BaseTestCase):
         self.context = context.get_admin_context()
         self.mock_lsn_api_p = mock.patch.object(lsn_man, 'lsn_api')
         self.mock_lsn_api = self.mock_lsn_api_p.start()
-        self.addCleanup(cfg.CONF.reset)
         self.addCleanup(self.mock_lsn_api_p.stop)
         self.addCleanup(db.clear_db)
 
index 50634f771b0c9a1183bd2cd69281888274b45bfe..961bb7be3d2e898c875f73c16f05e664135a235f 100644 (file)
@@ -302,10 +302,6 @@ class SyncTestCase(base.BaseTestCase):
         self.addCleanup(mock_nm_get_plugin.stop)
         self.addCleanup(mock_nm_get_service_plugins.stop)
 
-    def tearDown(self):
-        cfg.CONF.reset()
-        super(SyncTestCase, self).tearDown()
-
     @contextlib.contextmanager
     def _populate_data(self, ctx, net_size=2, port_size=2, router_size=2):