From: Henry Gessau Date: Fri, 25 Apr 2014 19:46:58 +0000 (-0400) Subject: Allow ML2 plugin test cases to be run independently X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8ccaf4905367c87d506549837b4bb658af83b135;p=openstack-build%2Fneutron-build.git Allow ML2 plugin test cases to be run independently Some test cases in neutron.tests.unit.ml2.test_ml2_plugin override the network_vlan_ranges option in the ml2_type_vlan config group. However, the test module does not import the ML2 type driver module where this config group's options are registered. When unit tests are run by tox/testr the module is imported during test discovery. Running the tests independently via nose or testtools requires the option to be explicitly imported. Change-Id: I355a2d1212992eafed44f6d843c0fc9deb665df7 Closes-bug: #1287792 --- diff --git a/neutron/tests/unit/ml2/test_ml2_plugin.py b/neutron/tests/unit/ml2/test_ml2_plugin.py index 1abc600df..fd592a779 100644 --- a/neutron/tests/unit/ml2/test_ml2_plugin.py +++ b/neutron/tests/unit/ml2/test_ml2_plugin.py @@ -36,6 +36,11 @@ from neutron.tests.unit import test_extension_extradhcpopts as test_dhcpopts from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc +config.cfg.CONF.import_opt('network_vlan_ranges', + 'neutron.plugins.ml2.drivers.type_vlan', + group='ml2_type_vlan') + + PLUGIN_NAME = 'neutron.plugins.ml2.plugin.Ml2Plugin'